:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101214;
  color: #eef1f4;
  --surface: #181b1f;
  --surface-2: #20242a;
  --border: #343a42;
  --muted: #9aa4af;
  --accent: #6aa9ff;
  --accent-strong: #3987ee;
  --danger: #ff8b8b;
  --danger-strong: #c93f3f;
  --success: #77d79c;
  --warning: #ffd36a;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #101214; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }

.shell { width: min(1120px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; padding: 32px 0 64px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.75rem, 3vw, 2.5rem); }
h2 { margin-bottom: 8px; font-size: 1.1rem; }
p { color: var(--muted); line-height: 1.55; }
.eyebrow { margin-bottom: 4px; color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); font-weight: 400; }

.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 22px; box-shadow: 0 18px 40px rgba(0,0,0,.18); }
.panel.narrow { width: min(480px, 100%); }
#login-panel { margin: clamp(32px, 12vh, 140px) auto 0; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-size: .9rem; font-weight: 650; }
input { width: 100%; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: inherit; padding: 11px 12px; outline: none; }
input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--accent-strong); }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(106,169,255,.16); }
button { position: relative; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid var(--accent-strong); border-radius: 9px; background: var(--accent-strong); color: white; padding: 10px 14px; font-weight: 700; white-space: nowrap; }
button.secondary { border-color: var(--border); background: transparent; color: inherit; }
button.danger { border-color: var(--danger-strong); background: transparent; color: var(--danger); }
button.small { padding: 7px 10px; font-size: .83rem; }
button.loading::before {
  content: "";
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
.inline-check { display: flex; align-items: center; gap: 9px; color: var(--muted); font-weight: 550; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.section-heading p { margin-bottom: 0; }
.table-wrap { overflow-x: hidden; margin: 12px -6px -6px; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { border-top: 1px solid var(--border); padding: 13px 10px; text-align: left; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
th:nth-child(1) { width: auto; }
th:nth-child(2) { width: 180px; }
th:nth-child(3) { width: 190px; }
th:nth-child(4) { width: 172px; }
td:last-child, th:last-child { text-align: right; }
.file-name-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modified-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.empty { color: var(--muted); text-align: center !important; padding: 28px; }
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 20; display: grid; gap: 10px; width: min(390px, calc(100vw - 36px)); }
.toast { border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 8px; background: rgba(24,27,31,.98); color: #eef1f4; padding: 12px 14px; box-shadow: 0 18px 35px rgba(0,0,0,.32); line-height: 1.35; }
.toast[data-kind="success"] { border-left-color: var(--success); }
.toast[data-kind="error"] { border-left-color: var(--danger); }
.toast[data-kind="warning"] { border-left-color: var(--warning); }
.toast-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.toast-actions button:disabled { cursor: not-allowed; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  .two-columns { grid-template-columns: 1fr; }
  .shell { width: min(100% - 20px, 1120px); padding-top: 20px; }
  .topbar { align-items: flex-start; }
  .panel { padding: 17px; }
  th:nth-child(2) { width: 128px; }
  th:nth-child(3) { width: 132px; }
  th:nth-child(4) { width: 92px; }
  .actions { flex-direction: column; align-items: flex-end; gap: 6px; }
  .actions button { width: 82px; }
}

@media (max-width: 560px) {
  th:nth-child(2),
  td:nth-child(2) { display: none; }
}

button[hidden] {
  display: none;
}
