/* Webhard — 깔끔한 파일 브라우저 UI (Pretendard/Apple SD Gothic Neo) */
:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-dim: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --accent: #2563eb;
  --ok: #16a34a;
  --bad: #dc2626;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--ink);
              font-family: 'Pretendard', 'Apple SD Gothic Neo', system-ui, sans-serif; font-size: 15px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select { font: inherit; color: inherit; }

.topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 24px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 18px; color: var(--ink); }
.topbar-spacer { flex: 1; }
#userBox { color: var(--ink-dim); font-size: 14px; }
#userBox .logout { margin-left: 10px; color: var(--accent); cursor: pointer; }

.layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 53px); }

.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 16px; }
.sidebar h3 { margin: 0 0 10px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.drive-list { list-style: none; padding: 0; margin: 0 0 12px; }
.drive-list li {
  padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px;
  font-size: 14px;
}
.drive-list li:hover { background: #f1f5f9; }
.drive-list li.active { background: #dbeafe; color: var(--accent); font-weight: 600; }
.drive-list li .icon { font-size: 16px; }

.main { padding: 18px 24px; min-width: 0; }

.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }

.breadcrumb { font-size: 14px; color: var(--ink-dim); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--ink-dim); }
.breadcrumb .sep { color: var(--muted); }
.breadcrumb .cur { color: var(--ink); font-weight: 600; }

.quota { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.quota .bar { display: inline-block; width: 200px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; vertical-align: middle; margin: 0 8px; }
.quota .bar > span { display: block; height: 100%; background: var(--accent); }

.file-table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.file-table th, .file-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.file-table th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; background: #fafbfc; }
.file-table tbody tr:hover { background: #f8fafc; }
.file-table .name { display: flex; align-items: center; gap: 8px; }
.file-table .name .icon { font-size: 18px; }
.file-table .name a { color: var(--ink); cursor: pointer; }
.file-table .name a:hover { color: var(--accent); }
.file-table .actions { white-space: nowrap; text-align: right; }
.file-table .actions button { margin-left: 6px; }
.col-name { width: 55%; }

.btn {
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.btn:hover { background: #f1f5f9; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn.primary:hover { background: #1d4ed8; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-dim); }
.btn.danger { color: var(--bad); }

.msg { margin-top: 12px; }
.msg .ok { color: var(--ok); padding: 8px 12px; background: #ecfdf5; border-radius: 6px; }
.msg .err { color: var(--bad); padding: 8px 12px; background: #fef2f2; border-radius: 6px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }

/* Auth (로그인/가입) */
.auth-wrap { display: flex; justify-content: center; padding: 60px 20px; }
.auth-wrap .card { background: var(--panel); padding: 28px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.06); width: 100%; max-width: 380px; }
.auth-wrap h2 { margin: 0 0 16px; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; padding: 8px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-dim); }
.auth-form input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.auth-form input:focus { outline: none; border-color: var(--accent); }
.auth-form .btn { margin-top: 4px; }

@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .col-name { width: auto; }
}

/* 모달 */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal {
  background: var(--panel); color: var(--ink); border-radius: 12px;
  padding: 22px; max-width: 480px; width: 100%; max-height: 90vh; overflow: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.modal h3 { margin: 0 0 12px; }
.modal label { margin-bottom: 10px; }
.modal select, .modal input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; width: 100%; }
.modal .input[readonly] { background: #f1f5f9; font-family: monospace; font-size: 13px; }
.modal .ok { background: #ecfdf5; color: #166534; padding: 10px 12px; border-radius: 6px; }
.modal .err { background: #fef2f2; color: #b91c1c; padding: 10px 12px; border-radius: 6px; }
.chip { display: inline-block; padding: 2px 8px; background: #e2e8f0; border-radius: 4px; font-size: 12px; }
.chip-emp { background: #dcfce7; color: #166534; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.chip-guest { background: #fef3c7; color: #92400e; border: 0; cursor: pointer; padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.chip-guest:hover { background: #fde68a; }
