/* ============================================================
   행머스마 자료실 라이트 테마 오버라이드 (2026-09-18 개편)
   - pds.php 인라인 CSS(리컬러됨) 위에 덮어씀. 배경 밝게 · 포인트 블루 · 여백 최소
   ============================================================ */
:root { --pad: 22px; }
body { background: var(--bg-primary); }
.main { padding: var(--pad) 26px 60px; max-width: 1480px; }
.page-dashboard { max-width: 1240px; margin: 0 auto; }
@media (max-width: 900px) { .main { padding: 14px 14px 90px; } }

/* 사이드바 */
.sidebar { background: #fff; border-right: 1px solid var(--border); box-shadow: 1px 0 0 rgba(15,23,42,.02); backdrop-filter: none; }
.sidebar-brand-icon { background: linear-gradient(135deg, #2f6bff, #6d5dfc); box-shadow: 0 6px 16px rgba(47,107,255,.28); }
.sidebar-brand-name { letter-spacing: -.2px; font-size: 14px; }
.pds-nav .nav-item { color: #475569; font-weight: 600; }
.pds-nav .nav-item:hover { background: #f1f5ff; color: #0f172a; }
.pds-nav .nav-item.active { background: #e9efff; color: #2f6bff; box-shadow: inset 3px 0 0 #2f6bff; }
.sidebar-logout { border-color: var(--border); background: #fff; }
.sidebar-logout:hover { background: #fff5f6; }
.tree-node:hover { background: #f1f5ff; }
.tree-node.active { background: #e9efff; border-color: transparent; }
.tree-node.is-main .tree-name { color: #b45309; }

/* 카드·패널 공통 */
.dash-panel, .dash-card, .file-search, .shr-row, .empty { box-shadow: var(--shadow-sm); }
.file-card { background: #fff; border-color: var(--border); box-shadow: var(--shadow-sm); }
.file-card:hover { background: #fff; border-color: rgba(47,107,255,.45); box-shadow: 0 6px 18px rgba(47,107,255,.10); }
.file-card.selected { background: #eef3ff; box-shadow: 0 0 0 2px #2f6bff; }
.file-grid.icons .file-card .check { background: rgba(255,255,255,.9); border-color: rgba(15,23,42,.35); }
.file-card .icon.thumb { background: #eef1f6; }
.file-card .icon { background: #eef3ff; }
.files-toolbar { background: transparent; border-bottom: 0; backdrop-filter: none; position: static; flex-direction: column; align-items: stretch; gap: 10px; padding: 0 0 12px; margin-bottom: 8px; }
.files-toolbar .breadcrumb { flex: none; }
.bulk-panel { background: var(--bg-primary); }
.modal-overlay { background: rgba(15,23,42,.45); }
.modal { box-shadow: 0 24px 70px rgba(15,23,42,.22); }
.toast { box-shadow: 0 12px 40px rgba(15,23,42,.18); background: #0f172a; color: #fff; border-color: #0f172a; }
.toast.success { border-color: #16a34a; } .toast.error { border-color: #e11d48; }
#shareModal { background: rgba(15,23,42,.45) !important; }
#shareModal input[type=text], #shareModal input[type=date] { color: #0f172a !important; background: #fff !important; }
.sel-urls { background: #f8fafc; }
.select-all-box { background: #fff; }
.file-card .check { background: #fff; }
.upload-target-btn { background: #fff; }
.pds-pager .pg-sz.on { background: #2f6bff; box-shadow: none; }
#dateFilterBar .df-chip, #kindFilterBar .df-chip { background: #e9efff; border-color: rgba(47,107,255,.35); color: #1d4ed8; box-shadow: none; display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-radius: 999px; font-size: 12.5px; border: 1px solid; }
#dateFilterBar .df-chip b, #kindFilterBar .df-chip b { color: #0f172a; }
#kindFilterBar .df-chip button { width: 20px; height: 20px; border-radius: 50%; border: 0; cursor: pointer; font-size: 11px; background: rgba(15,23,42,.08); color: #0f172a; line-height: 1; }
#kindFilterBar .df-chip button:hover { background: #e11d48; color: #fff; }
#tagFilterBar { box-shadow: var(--shadow-sm) !important; background: #fff !important; }
#tagFilterBar .tfc { background: #fff !important; }
.files-side #categoryBar { box-shadow: var(--shadow-sm); }
.tt-btn.primary, #tagToolsModal .tt-btn.primary { background: #e9fbf1; }
.dash-buckets .dash-bucket { background: #fff; }
.tree-chevron { background: #fff; }
.login-shell::before { opacity: .5; }

/* ===== 자료실 업로드 패널 (눈에 띄게) ===== */
.files-toolbar .dropzone.up-panel {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; width: 100%;
    padding: 16px 20px; border-radius: 16px;
    border: 2px dashed rgba(47,107,255,.45);
    background: linear-gradient(135deg, #eef3ff 0%, #f6f8ff 60%, #fff 100%);
    box-shadow: var(--shadow-sm); text-align: left; overflow: visible; cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.files-toolbar .dropzone.up-panel:hover { border-color: #2f6bff; background: linear-gradient(135deg, #e6edff, #f2f5ff); }
.files-toolbar .dropzone.up-panel.dragover { border-color: #2f6bff; border-style: solid; background: #e6edff; box-shadow: 0 0 0 4px rgba(47,107,255,.18); transform: none; }
.up-panel .up-icon { width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg, #2f6bff, #6d5dfc); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px rgba(47,107,255,.3); flex-shrink: 0; }
.up-panel .up-icon svg { width: 22px; height: 22px; }
.up-panel .up-text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.up-panel .up-text b { font-size: 15.5px; font-weight: 800; color: #0f172a; letter-spacing: -.2px; }
.up-panel .up-text .dropzone-hint { font-size: 12.5px; color: #64748b; white-space: normal; }
.up-panel .upload-target-btn { height: 40px; padding: 0 12px; border-radius: 10px; font-size: 13px; max-width: 240px; }
.up-panel .browse-btn { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 20px; border-radius: 11px; font-size: 14.5px; font-weight: 800; background: linear-gradient(135deg, #2f6bff, #4f8cff); box-shadow: 0 8px 20px rgba(47,107,255,.32); }
.up-panel .browse-btn svg { width: 16px; height: 16px; }
.up-panel .browse-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(47,107,255,.4); }
@media (max-width: 600px) {
    .files-toolbar .dropzone.up-panel { padding: 14px; gap: 10px; }
    .up-panel .up-text { flex-basis: 100%; }
    .up-panel .up-text .dropzone-hint { display: block; }
    .up-panel .upload-target-btn { flex: 1 1 auto; max-width: none; }
    .up-panel .browse-btn { flex: 1 1 auto; justify-content: center; }
}
.uploads { margin-top: 10px; }

/* 태그 레일 모바일 토글 */
.side-toggle { display: none; }
@media (max-width: 1100px) {
    .side-toggle { display: inline-flex; align-items: center; gap: 8px; width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border); background: #fff; color: #334155; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; box-shadow: var(--shadow-sm); }
    .side-toggle svg { width: 16px; height: 16px; color: #2f6bff; }
    .side-toggle i { margin-left: auto; font-style: normal; transition: transform .15s; }
    .side-toggle.on i { transform: rotate(180deg); }
    .files-side { display: none; }
    .files-side.open { display: flex; }
    .files-layout { gap: 12px; }
}
.files-content { min-width: 0; overflow-x: clip; }
.bulk-panel { flex-wrap: wrap; }
.bulk-bar { flex-wrap: wrap; }
@media (max-width: 600px) {
    .section-header-actions { flex-wrap: wrap; }
    .file-search input { width: 120px; }
    .pds-pager { padding: 8px 10px; }
}

/* 업로드 FAB */
.upload-fab { position: fixed; right: 20px; bottom: 22px; z-index: 900; display: inline-flex; align-items: center; gap: 7px; height: 50px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: linear-gradient(135deg, #2f6bff, #6d5dfc); color: #fff; font: inherit; font-weight: 800; font-size: 14.5px; cursor: pointer; box-shadow: 0 12px 30px rgba(47,107,255,.4); }
.upload-fab svg { width: 20px; height: 20px; }
.upload-fab[hidden] { display: none; }

/* ===== 대시보드 ===== */
.dash { padding: 0; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-head h1 { font-size: 24px; font-weight: 900; letter-spacing: -.4px; color: #0f172a; margin: 0 0 4px; }
.dash-head .sub { color: #64748b; font-size: 13.5px; }
.dash-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dbtn { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 18px; border-radius: 11px; border: 1px solid var(--border-strong); background: #fff; color: #0f172a; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s; white-space: nowrap; }
.dbtn svg { width: 17px; height: 17px; }
.dbtn:hover { background: #f8fafc; }
.dbtn.primary { background: linear-gradient(135deg, #2f6bff, #4f8cff); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(47,107,255,.32); }
.dbtn.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(47,107,255,.4); background: linear-gradient(135deg, #2359e6, #4f8cff); }
.dbtn.ghost { color: #2f6bff; border-color: rgba(47,107,255,.35); background: #fff; }
.dbtn.ghost:hover { background: #eef3ff; }

.dash-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding: 22px 24px; border-radius: 18px; border: 2px dashed rgba(47,107,255,.45); background: linear-gradient(135deg, #eaf0ff 0%, #f5f7ff 55%, #fff 100%); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; box-shadow: var(--shadow-sm); }
.dash-drop:hover { border-color: #2f6bff; }
.dash-drop.dragover { border-style: solid; border-color: #2f6bff; background: #e3ebff; box-shadow: 0 0 0 5px rgba(47,107,255,.18); }
.dash-drop .dd-icon { width: 58px; height: 58px; border-radius: 16px; background: linear-gradient(135deg, #2f6bff, #6d5dfc); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 22px rgba(47,107,255,.32); flex-shrink: 0; }
.dash-drop .dd-icon svg { width: 27px; height: 27px; }
.dash-drop .dd-text { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dash-drop .dd-text b { font-size: 18px; font-weight: 900; letter-spacing: -.3px; color: #0f172a; }
.dash-drop .dd-text span { font-size: 13px; color: #64748b; }
.dash-drop .dd-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dd-folder { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 10px 0 12px; border-radius: 11px; border: 1px solid var(--border-strong); background: #fff; color: #0f172a; font-size: 13px; font-weight: 600; max-width: 260px; }
.dd-folder svg { width: 16px; height: 16px; color: #2f6bff; flex-shrink: 0; }
.dd-folder select { border: 0; background: transparent; font: inherit; font-weight: 700; color: #0f172a; outline: none; max-width: 200px; text-overflow: ellipsis; cursor: pointer; }
.dash-uploads { margin: 0; }
.dash-uploads.on { margin: 10px 0 0; }
.dash-uploads .uploads { margin-top: 0; }

.dash-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
@media (max-width: 1100px) { .dash-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 15px 12px; border-radius: 14px; border: 1px solid var(--border); background: #fff; text-align: left; font: inherit; color: #0f172a; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s, border-color .12s; min-width: 0; }
.tile:hover { transform: translateY(-2px); border-color: rgba(47,107,255,.45); box-shadow: 0 10px 24px rgba(47,107,255,.12); }
.tile.disk { cursor: default; }
.tile.disk:hover { transform: none; border-color: var(--border); box-shadow: var(--shadow-sm); }
.tile .tl { font-size: 12px; color: #64748b; font-weight: 700; }
.tile .tv { font-size: 26px; font-weight: 900; letter-spacing: -.6px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile .tv small { font-size: 12px; font-weight: 700; color: #64748b; margin-left: 3px; letter-spacing: 0; }
.tile .ts { font-size: 11.5px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tile.accent { background: linear-gradient(135deg, #2f6bff, #5b7cff); border-color: transparent; color: #fff; }
.tile.accent .tl, .tile.accent .ts { color: rgba(255,255,255,.85); }
.tile.warn .tv { color: #d97706; }
.tile .bar { display: block; width: 100%; height: 6px; border-radius: 999px; background: #eef1f6; overflow: hidden; margin: 6px 0 4px; }
.tile .bar i { display: block; height: 100%; background: linear-gradient(90deg, #2f6bff, #4f8cff); border-radius: 999px; }
.tile .bar i.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.tile .bar i.bad { background: linear-gradient(90deg, #e11d48, #fb7185); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 12px; margin-bottom: 12px; }
.dash-grid2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 12px; }
@media (max-width: 960px) { .dash-grid, .dash-grid2 { grid-template-columns: 1fr; } }
.dash-side { display: flex; flex-direction: column; gap: 12px; }
.dash-panel { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.dash-panel .ph { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.dash-panel .pt { font-size: 14px; font-weight: 800; color: #0f172a; }
.dash-panel .pm { font-size: 12px; color: #94a3b8; }
.dash-panel .plink { margin-left: auto; font-size: 12.5px; font-weight: 700; color: #2f6bff; text-decoration: none; }
.dash-panel .plink:hover { text-decoration: underline; }
.dash-empty { padding: 26px 12px; text-align: center; color: #94a3b8; font-size: 13px; border: 1px dashed var(--border-strong); border-radius: 12px; }
.dash-empty.small { padding: 14px 10px; font-size: 12.5px; }

.recent-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1240px) { .recent-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 700px) { .recent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rc { position: relative; display: block; aspect-ratio: 1 / 1; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #eef1f6; cursor: pointer; }
.rc img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.rc:hover img { transform: scale(1.04); }
.rc .fi { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 100%; color: #2f6bff; }
.rc .fi svg { width: 30px; height: 30px; }
.rc .fi em { font-style: normal; font-size: 11px; font-weight: 800; color: #64748b; letter-spacing: .5px; }
.rc .rn { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; font-size: 11px; color: #fff; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: linear-gradient(180deg, transparent, rgba(15,23,42,.72)); opacity: 0; transition: opacity .15s; }
.rc:hover .rn { opacity: 1; }

.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chips .chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: #fff; color: #334155; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: all .12s; }
.tag-chips .chip span { color: #94a3b8; font-weight: 600; }
.tag-chips .chip i { color: #f59e0b; font-style: normal; font-size: 11px; }
.tag-chips .chip:hover { border-color: #2f6bff; color: #2f6bff; background: #eef3ff; }
.tag-chips .chip.main { background: #fff8e6; border-color: rgba(217,119,6,.35); }
.dash-buckets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 0; }
@media (max-width: 560px) { .dash-buckets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dash-buckets .bk { padding: 10px 4px 8px; border-radius: 11px; border: 1px solid var(--border); background: #f8fafc; font: inherit; cursor: pointer; text-align: center; transition: all .12s; min-width: 0; }
.dash-buckets .bk b { display: block; font-size: 17px; font-weight: 900; color: #0f172a; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.dash-buckets .bk span { display: block; font-size: 11px; color: #64748b; margin-top: 2px; }
.dash-buckets .bk:hover { background: #eef3ff; border-color: rgba(47,107,255,.45); }
.pf-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pfc { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; cursor: pointer; text-align: left; font: inherit; transition: box-shadow .12s, transform .12s; }
.pfc:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(47,107,255,.12); }
.pfc img, .pfc .nocover, .pfc .plus { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: flex; align-items: center; justify-content: center; background: #eef1f6; color: #94a3b8; font-size: 12px; }
.pfc .plus { font-size: 30px; color: #2f6bff; background: #eef3ff; }
.pfc .pft { padding: 8px 10px 10px; min-width: 0; }
.pfc .pft b { display: block; font-size: 13px; font-weight: 800; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfc .pft small { display: block; font-size: 11px; color: #94a3b8; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfc.new { border-style: dashed; border-color: rgba(47,107,255,.45); }
.chart-wrap { position: relative; height: 150px; }

/* 자료실 헤더 간격·버튼 줄바꿈 */
.page-files .section { margin-top: 8px; }
.danger-btn, .refresh-btn, .bulk-btn, .select-all { white-space: nowrap; }
.section-header { margin-bottom: 12px; gap: 10px; }
.section-title { font-size: 18px; letter-spacing: -.2px; }
.danger-btn { background: #fff; border-color: rgba(225,29,72,.35); color: #be123c; }
.danger-btn:hover { background: #fff1f2; color: #be123c; border-color: #e11d48; }
.page-dashboard [hidden], .dbtn[hidden], .sbtn[hidden] { display: none !important; }
