/* ===== Base palette (light, eye-comfort) ===== */
:root{
    --bg:#f4f6f8; --panel:#fff; --muted:#6b7280; --text:#2d2d2d; --border:#d0d7de;
    --brand:#072b72; --brand-2:#0a3f9a;
    --wrap-max:1280px; --gap:12px;
}
a,
a:link,
a:visited,
a:hover,
a:active {
    color: inherit;           /* 부모 글자색 상속 */
    text-decoration: none;    /* 밑줄 제거 */
}

/* 키보드 포커스 시 파란 테두리 제거(필요시) */
a:focus {
    outline: none;
}
*{box-sizing:border-box} html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans KR",sans-serif;line-height:1.45}
/* 전역으로 제목은 굵게 */
h1, h2, h3 { font-weight: 700; }
/* Header */
.site-header{position:sticky;top:0;z-index:50;background:linear-gradient(#ffffffcc,#ffffffcc),var(--panel);backdrop-filter:saturate(120%) blur(6px);border-bottom:1px solid var(--border)}
.site-header .bar{max-width:var(--wrap-max);margin:0 auto;padding:10px 16px;display:flex;align-items:center;gap:12px;justify-content:space-between}
.brand{display:flex;align-items:center;gap:10px;font-weight: 700;}
.brand h1{margin:0;font-size:18px;letter-spacing:.2px;color:var(--brand)}
.nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.nav .btn{background:#fff;border:1px solid var(--border);color:var(--text);padding:8px 12px;border-radius:10px;cursor:pointer;text-decoration:none}
.nav .btn:hover{border-color:var(--brand)}
.nav .btn.primary{background:linear-gradient(180deg,var(--brand),var(--brand-2));color:#fff;border:none}
.nav .btn.active{outline:2px solid var(--brand);outline-offset:0}

/* Container / Card */
.wrap{max-width:var(--wrap-max);margin:0 auto;padding:20px 16px}
.card{background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:14px 14px 16px;margin-bottom:16px;overflow:visible}
h1,h2,h3{margin:0 0 12px} small,.muted{color:var(--muted)} .err{color:#ff7a45}.ok{color:#19c37d}

/* Buttons */
a.btn, button.btn, .btn{
    display:inline-flex;justify-content:center;align-items:center;text-decoration:none;
    font-size:14px;font-weight:500; padding:10px 14px; border-radius:10px;
    border:1px solid var(--border); background:var(--panel); color:var(--text);
    cursor:pointer; transition:background .2s,border-color .2s; min-height:38px;
}
a.btn:hover, button.btn:hover, .btn:hover{border-color:var(--brand);background:#f3f6fa}
.btn.ghost{background:#fff;color:var(--text)}
a.btn.danger, button.btn.danger, .btn.danger{background:#dc3545;border-color:#dc3545;color:#fff}
a.btn.danger:hover, button.btn.danger:hover, .btn.danger:hover{background:#b02a37;border-color:#b02a37}

/* Forms */
.grid{display:grid;gap:12px}
label{display:flex;flex-direction:column;gap:4px;font-size:14px}
input[type=text],input[type=password],input[type=email],select,textarea{
    background:#fff;color:var(--text);border:1px solid var(--border);border-radius:10px;
    padding:10px 12px;min-height:44px;font-size:15px;width:100%;
}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent)}
.row-end{display:flex;justify-content:center;gap:8px;margin-top:12px;width:100%}

/* Gauge */

.gauge{height:8px;background:#e9edf2;border:1px solid var(--border);border-radius:999px;overflow:hidden}
.gauge .bar{height:100%;width:0;background:linear-gradient(90deg,var(--brand),var(--brand-2))}
.usage-card .gauge{margin-top:8px}.usage-card small{display:inline-block;margin-top:6px}
/* ===================== Signature (clean) ===================== */

/* Toolbar */
.sig-wrap .sig-toolbar{
    display:flex;justify-content:space-between;align-items:center;
    gap:var(--gap);margin:6px 0 8px;flex-wrap:wrap
}
.sig-wrap .sig-toolbar .left,
.sig-wrap .sig-toolbar .right{display:flex;align-items:center;gap:var(--gap)}
.sig-wrap input#sigSearch{
    width:clamp(180px,50vw,280px);background:#fff;border:1px solid var(--border);
    color:var(--text);padding:8px 12px;border-radius:10px;min-height:44px
}
.sig-wrap .select select{
    background:#fff;border:1px solid var(--border);color:var(--text);
    padding:8px 12px;border-radius:10px;min-height:44px
}

/* 기본(그리드) — 다른 화면에서 재사용용 */
.sig-wrap .sig-list{
    display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
    gap:var(--gap)
}
.sig-card{background:#fff;border:1px solid var(--border);border-radius:14px;overflow:hidden;display:flex;flex-direction:column}
.sig-thumb{padding:6px;min-height:120px;background:#f9fbff;display:flex;justify-content:center;align-items:center;position:relative;overflow:visible}
.sig-thumb img{max-width:100%;height:auto;object-fit:contain;border-radius:6px;border:1px solid var(--border);background:#fff}
.sig-body{padding:12px}
.sig-title{display:flex;justify-content:space-between;gap:8px;margin-bottom:6px}
.sig-title h3{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}

/* ===== 리스트 모드 (덮어쓰기) ===== */
.sig-wrap.list .sig-list{display:flex !important;flex-direction:column;gap:10px}
.sig-wrap, .sig-wrap .sig-list, .card{overflow:visible}

/* 행 */
.sig-item{
    display:flex;align-items:center;gap:16px;
    padding:12px 16px;border:1px solid var(--border);border-radius:12px;
    background:var(--panel);min-height:100px
}
/* 썸네일(데스크톱 더 큼) */
.sig-item .sig-thumb{
    position:relative;overflow:visible;
    flex:0 0 220px;height:120px;display:flex;justify-content:center;align-items:center;
    background:#f9fbff;padding:8px;border-radius:10px
}
.sig-item .sig-thumb img{
    max-width:100%;max-height:100%;height:auto;object-fit:contain;
    border-radius:6px;border:1px solid var(--border);background:#fff
}

/* 본문/제목/오디오 */
.sig-item .sig-body{flex:1;min-width:0}
.sig-item .sig-title h3{margin:0 0 6px;font-size:16px}
.sig-item .sig-audio{margin-top:4px}
.sig-item .sig-audio audio{width:100%}

/* 액션(오른쪽) — 데스크톱: 두 칼럼, 높이 20px, gap 5px */
.sig-item .sig-actions{
    flex:0 0 360px;display:flex;flex-wrap:wrap;gap:5px;justify-content:flex-end
}
.sig-item .sig-actions .btn{
    flex:1 0 48%;height:20px;line-height:20px;font-size:12px;
    padding:0 8px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px
}
.sig-item .sig-actions .btn.danger{flex-basis:100%;height:20px;line-height:20px}

/* === 호버 확대 (데스크톱) === */
.sig-item .sig-thumb .hover-zoom,
.sig-card .sig-thumb .hover-zoom{
    position:absolute;top:50%;left:calc(100% + 10px);
    transform:translateY(-50%) scale(.96);opacity:0;pointer-events:none;
    padding:6px;border:1px solid var(--border);border-radius:10px;background:#fff;
    box-shadow:0 8px 30px rgba(0,0,0,.2);z-index:9999
}
.sig-item .sig-thumb .hover-zoom img,
.sig-card .sig-thumb .hover-zoom img{display:block;max-width:520px;max-height:70vh;object-fit:contain}
.sig-item .sig-thumb:hover .hover-zoom,
.sig-card .sig-thumb:hover .hover-zoom{opacity:1;transform:translateY(-50%) scale(1)}

/* ===================== Signature (clean) ===================== */

/* Toolbar */
.sig-wrap .sig-toolbar{
    display:flex;justify-content:space-between;align-items:center;
    gap:var(--gap);margin:6px 0 8px;flex-wrap:wrap
}
.sig-wrap .sig-toolbar .left,
.sig-wrap .sig-toolbar .right{display:flex;align-items:center;gap:var(--gap)}
.sig-wrap input#sigSearch{
    width:clamp(180px,50vw,280px);background:#fff;border:1px solid var(--border);
    color:var(--text);padding:8px 12px;border-radius:10px;min-height:44px
}
.sig-wrap .select select{
    background:#fff;border:1px solid var(--border);color:var(--text);
    padding:8px 12px;border-radius:10px;min-height:44px
}

/* 기본(그리드) — 다른 화면에서 재사용용 */
.sig-wrap .sig-list{
    display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
    gap:var(--gap)
}
.sig-card{background:#fff;border:1px solid var(--border);border-radius:14px;overflow:hidden;display:flex;flex-direction:column}
.sig-thumb{padding:6px;min-height:120px;background:#f9fbff;display:flex;justify-content:center;align-items:center;position:relative;overflow:visible}
.sig-thumb img{max-width:100%;height:auto;object-fit:contain;border-radius:6px;border:1px solid var(--border);background:#fff}
.sig-body{padding:12px}
.sig-title{display:flex;justify-content:space-between;gap:8px;margin-bottom:6px}
.sig-title h3{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}

/* ===== 리스트 모드 (덮어쓰기) ===== */
.sig-wrap.list .sig-list{display:flex !important;flex-direction:column;gap:10px}
.sig-wrap, .sig-wrap .sig-list, .card{overflow:visible}

/* 행 */
.sig-item{
    display:flex;align-items:center;gap:16px;
    padding:12px 16px;border:1px solid var(--border);border-radius:12px;
    background:var(--panel);min-height:100px
}
/* 썸네일(데스크톱 더 큼) */
.sig-item .sig-thumb{
    position:relative;overflow:visible;
    flex:0 0 220px;height:120px;display:flex;justify-content:center;align-items:center;
    background:#f9fbff;padding:8px;border-radius:10px
}
.sig-item .sig-thumb img{
    max-width:100%;max-height:100%;height:auto;object-fit:contain;
    border-radius:6px;border:1px solid var(--border);background:#fff
}

/* 본문/제목/오디오 */
.sig-item .sig-body{flex:1;min-width:0}
.sig-item .sig-title h3{margin:0 0 6px;font-size:20px}
.sig-item .sig-audio{margin-top:4px}
.sig-item .sig-audio audio{width:100%}

/* 액션(오른쪽) — 데스크톱: 두 칼럼, 높이 20px, gap 5px */
.sig-item .sig-actions{
    flex:0 0 300px;display:flex;flex-wrap:wrap;gap:5px;justify-content:flex-end
}
.sig-item .sig-actions .btn{
    flex:1 0 48%;height:20px;line-height:20px;font-size:14px;
    padding:0 8px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px
}
.sig-item .sig-actions .btn.danger{flex-basis:100%;height:20px;line-height:20px}

/* === 호버 확대 (데스크톱) === */
.sig-item .sig-thumb .hover-zoom,
.sig-card .sig-thumb .hover-zoom{
    position:absolute;top:50%;left:calc(100% + 10px);
    transform:translateY(-50%) scale(.96);opacity:0;pointer-events:none;
    padding:6px;border:1px solid var(--border);border-radius:10px;background:#fff;
    box-shadow:0 8px 30px rgba(0,0,0,.2);z-index:9999
}
.sig-item .sig-thumb .hover-zoom img,
.sig-card .sig-thumb .hover-zoom img{display:block;max-width:520px;max-height:70vh;object-fit:contain}
.sig-item .sig-thumb:hover .hover-zoom,
.sig-card .sig-thumb:hover .hover-zoom{opacity:1;transform:translateY(-50%) scale(1)}

/* ===== 모바일/태블릿 ===== */
@media (max-width:900px){
    .sig-item .sig-actions{
        flex:0 0 150px;display:flex;flex-wrap:wrap;gap:5px;justify-content:flex-end
    }
    /* 카드 자체 여백 축소 */
    .sig-item{flex-direction:column;align-items:stretch;padding:10px 12px;gap:10px;min-height:unset;margin-bottom:10px}
    /* 썸네일은 가로꽉 / 충분히 큼 */
    .sig-item .sig-thumb{flex-basis:100%;width:100%;height:160px;margin-bottom:4px}
    /* 제목 더 큼 */
    .sig-item .sig-title h3{font-size:20px;margin-bottom:6px}
    /* 버튼은 한 줄씩, 높이 28px, gap 6px */
    .sig-item .sig-actions{width:100%;display:grid;grid-template-columns:1fr;gap:6px;justify-content:stretch; align-content: center;}
    .sig-item .sig-actions .btn{width:100%;height:28px;line-height:28px;font-size:15px;padding:0 10px}
    .sig-item .sig-actions .btn.danger{height:10px;line-height:28px}
    /* 확대 레이어는 모바일에서 숨김 */
    .sig-item .sig-thumb .hover-zoom,
    .sig-card .sig-thumb .hover-zoom{display:none !important}
}



/*upload css*/

/* ========== Upload form (restore/clean) ========== */
.narrow{
    width:100%;
    max-width:640px;           /* 업로드/사용량 카드 폭 제한 */
    margin:0 auto;
}
.hero{text-align:center;margin:6px 0 12px}

.drop{
    border:1px dashed var(--border);
    border-radius:12px;
    padding:20px;
    min-height:120px;
    display:grid;
    gap:8px;
    align-content:center;
    background:#fff;
}
.drop.drag{ outline:2px solid var(--brand); outline-offset:2px; }

.preview-inline{ display:grid; gap:8px; }
.preview-inline img{
    width:100%;
    max-height:260px;
    object-fit:contain;
    border:1px solid var(--border);
    border-radius:10px;
    background:#fff;
}
.preview-inline audio{ width:100%; }
.preview-inline .meta{ display:flex; justify-content:space-between; }

.sub-actions{
    display:flex;
    justify-content:center;
    gap:8px;
    margin:8px 0 4px;          /* 아래 여백 과하지 않게 */
}
.sub-actions .btn{ min-width:110px; }

/* ========== Dashboard list: mobile spacing & buttons ========== */
@media (max-width: 900px){
    .sig-item{
        padding:8px 10px !important;
        margin-bottom:8px !important;
        min-height:unset !important;
    }
    .sig-item .sig-actions{
        width:100%;
        display:grid;
        grid-template-columns:1fr;
        gap:5px !important;      /* 요청: 버튼 gap 5px */
        padding:4px 0 6px !important;
    }
    .sig-item .sig-actions .btn,
    .sig-item .sig-actions .btn.danger{
        height:28px !important;  /* 터치 타겟 확보 */
        line-height:28px !important;
        font-size:13px !important;
        padding:0 10px !important;
        width:100%;
    }
}

/* ========== Fix: danger height typo on any viewport ========== */
.sig-item .sig-actions .btn.danger{
    height:20px;               /* 데스크톱 기본 */
    line-height:20px;
}

/* ===== Upload form custom ===== */

/* 이름 입력폼 하단 여백 */
#up-name {
    margin-bottom: 14px; /* 입력창과 다음 요소 간격 */
}

/* 파일 선택 버튼 */
#imgPick, #audPick {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
#imgPick:hover, #audPick:hover {
    background: var(--brand-2);
    border-color: var(--brand-2);
}

/* 저장 버튼 */
#upForm .row-end .btn {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    width: 100%;        /* 요청: 꽉 차게 */
    font-size: 15px;
    font-weight: 600;
}
#upForm .row-end .btn:hover {
    background: var(--brand-2);
    border-color: var(--brand-2);
}
table th, table td { font-size: 14px; }
.grade {
    width: 80px;
    margin-right: 10px;
}

