/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef0f6;
  --border: #e6e8f0;
  --border-strong: #d5d9e4;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-ring: rgba(79, 70, 229, .22);
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .05);
  --shadow: 0 1px 3px rgba(17, 24, 39, .06), 0 8px 24px -8px rgba(17, 24, 39, .08);
  --shadow-lg: 0 24px 64px -16px rgba(17, 24, 39, .28);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar: 248px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0f17;
    --surface: #141824;
    --surface-2: #191e2c;
    --surface-3: #212738;
    --border: #262c3d;
    --border-strong: #333a4f;
    --text: #eef0f6;
    --text-2: #c9cede;
    --muted: #8b93a8;
    --accent: #7c74ff;
    --accent-2: #a78bfa;
    --accent-hover: #918aff;
    --accent-soft: #1f1d3d;
    --accent-ring: rgba(124, 116, 255, .3);
    --danger: #f87171;
    --danger-soft: #2c1517;
    --ok: #34d399;
    --ok-soft: #10261f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .4);
    --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.015em; }
p { margin: 0; }
.muted { color: var(--muted); }
small { font-size: .8rem; }

button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 1px; border-radius: 6px; }

.icon { display: inline-flex; width: 18px; height: 18px; flex: none; }
.icon svg { width: 100%; height: 100%; display: block; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  height: 38px; padding: 0 .9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: .9rem; font-weight: 550;
  cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: var(--muted); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .icon { width: 17px; height: 17px; }

.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent));
  border-color: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, .3), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger.solid:hover:not(:disabled) { filter: brightness(1.08); background: var(--danger); color: #fff; }
.btn.small { height: 30px; padding: 0 .6rem; font-size: .82rem; }
.btn.icon-only { width: 38px; padding: 0; }
.btn.small.icon-only { width: 32px; height: 32px; }
.btn.block { width: 100%; }
.btn.lg { height: 46px; font-size: 1rem; }

.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-align: left; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ==========================================================================
   Form fields
   ========================================================================== */
.field { display: block; margin: 0 0 1.1rem; }
.field > span { display: block; font-size: .85rem; font-weight: 600; color: var(--text-2); margin-bottom: .4rem; }
.field small { display: block; margin-top: .35rem; color: var(--muted); }
input[type=text], input[type=password], input[type=search], input:not([type]) {
  width: 100%; height: 42px; padding: 0 .85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted); opacity: .8; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.input-row { display: flex; gap: .5rem; }
.check-field { display: flex; align-items: center; gap: .6rem; margin: .25rem 0 .5rem; cursor: pointer; color: var(--text-2); }
input[type=checkbox] { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }

.alert {
  margin-top: 1rem; padding: .7rem .9rem;
  border-radius: var(--radius-sm);
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
  font-size: .9rem;
}
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }

/* ==========================================================================
   Brand
   ========================================================================== */
.brand-mark {
  display: inline-block; flex: none;
  width: 34px; height: 34px; border-radius: 10px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M4 7.5A2 2 0 0 1 6 5.5h3.7l1.9 1.9H18a2 2 0 0 1 2 2v7.1a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center / 62% no-repeat,
    linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 12px -2px rgba(79, 70, 229, .45);
}
.brand-mark.large { width: 56px; height: 56px; border-radius: 16px; background-color: rgba(255,255,255,.15); }

/* ==========================================================================
   Login
   ========================================================================== */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-art {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 3rem;
  background: linear-gradient(140deg, #312e81 0%, #4f46e5 45%, #7c3aed 100%);
  color: #fff;
}
.login-art-inner { position: relative; z-index: 1; max-width: 420px; }
.login-art h2 { font-size: 2.3rem; margin: 1.75rem 0 1.5rem; letter-spacing: -.03em; }
.login-art .brand-mark.large {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M4 7.5A2 2 0 0 1 6 5.5h3.7l1.9 1.9H18a2 2 0 0 1 2 2v7.1a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center / 58% no-repeat,
    rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .25);
  box-shadow: none;
  backdrop-filter: blur(6px);
}
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; font-size: 1.02rem; color: rgba(255, 255, 255, .88); }
.feature-list li { display: flex; align-items: center; gap: .75rem; }
.feature-list .dot {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, .18)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 62% no-repeat;
}
.blob { position: absolute; border-radius: 50%; filter: blur(10px); opacity: .5; }
.blob.b1 { width: 420px; height: 420px; right: -140px; top: -120px; background: radial-gradient(circle, rgba(167,139,250,.9), transparent 70%); }
.blob.b2 { width: 380px; height: 380px; left: -120px; bottom: -140px; background: radial-gradient(circle, rgba(56,189,248,.55), transparent 70%); }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 16px; background: var(--surface); }
.login-box { width: 100%; max-width: 380px; }
.login-box h1 { font-size: 1.9rem; letter-spacing: -.03em; }
.login-box > p.muted { margin: .4rem 0 2rem; }
.login-box .btn { margin-top: .5rem; }
.login-hint { display: flex; gap: .55rem; align-items: flex-start; margin-top: 1.75rem; font-size: .82rem; color: var(--muted); }
.lock-icon {
  width: 16px; height: 16px; flex: none; margin-top: 2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1zm2 0h6V7a3 3 0 0 0-6 0z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1zm2 0h6V7a3 3 0 0 0-6 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.mobile-only { display: none; }

/* ==========================================================================
   Shell: sidebar + content
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1.25rem .9rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.side-brand { display: flex; align-items: center; gap: .7rem; padding: 0 .5rem; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: .75rem;
  height: 40px; padding: 0 .75rem;
  border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--muted);
  font-weight: 550; font-size: .93rem; text-align: left;
  cursor: pointer; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item .icon { width: 19px; height: 19px; }

.side-user {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
}
.side-user-text { flex: 1; min-width: 0; line-height: 1.25; }
.side-user-text strong { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: .85rem; text-transform: uppercase;
}
.avatar.sm { width: 32px; height: 32px; font-size: .78rem; }

.content { padding: 2rem 2.25rem 6rem; max-width: 1180px; width: 100%; }

/* Page header */
.page-head > div:first-child { min-width: 0; }
.crumb { max-width: 260px; }
.crumb > span:last-child, .crumb:not(:has(span)) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.6rem; letter-spacing: -.025em; }
.page-head p { margin-top: .35rem; color: var(--muted); }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Breadcrumb */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem; margin-top: .55rem; font-size: .9rem; }
.crumb {
  display: inline-flex; align-items: center; gap: .35rem;
  height: 28px; padding: 0 .5rem; border: 0; border-radius: 7px;
  background: none; color: var(--muted); font-weight: 500; cursor: pointer;
}
.crumb:hover { background: var(--surface-3); color: var(--text); }
.crumb.current { color: var(--text); font-weight: 600; cursor: default; background: none; }
.crumb .icon { width: 15px; height: 15px; }
.crumb-sep { color: var(--border-strong); }

/* ==========================================================================
   Cards & file list
   ========================================================================== */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 1.5rem; }
.card.narrow { max-width: 480px; }

.card-bar {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.card-bar .spacer { flex: 1; }
.search { position: relative; flex: 1 1 220px; max-width: 320px; }
.search .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.search input { height: 38px; padding-left: 2.2rem; background: var(--surface-2); }
.count-chip { font-size: .82rem; color: var(--muted); white-space: nowrap; }

.selbar {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem 1rem;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
  font-size: .9rem; font-weight: 600; color: var(--accent);
}
.selbar .spacer { flex: 1; }

.note {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .75rem 1rem; font-size: .86rem; color: var(--text-2);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.note .icon { color: var(--accent); width: 17px; height: 17px; margin-top: 1px; }

.rows { list-style: none; margin: 0; padding: .35rem; }
.row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 90px 140px 190px;
  align-items: center; gap: .75rem;
  min-height: 56px; padding: .4rem .65rem;
  border-radius: 10px;
  cursor: default;
  transition: background .12s;
}
.row + .row { margin-top: 1px; }
.row:hover { background: var(--surface-2); }
.row.selected { background: var(--accent-soft); }
.row.head { min-height: 36px; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--muted); }
.row.head:hover { background: none; }
.row.head > span { font-size: inherit; color: inherit; }
.row.is-dir { cursor: pointer; }
.cell-size, .cell-date { font-size: .86rem; color: var(--muted); white-space: nowrap; }
.cell-size { text-align: right; }
.cell-actions { display: flex; align-items: center; gap: .2rem; justify-content: flex-end; }
.dl-btn { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); box-shadow: none; }
.dl-btn:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
.dl-btn .icon { width: 15px; height: 15px; }

.file { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.file-name { min-width: 0; }
.file-name .title { display: block; font-weight: 550; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.is-dir .file-name .title:hover { color: var(--accent); }
.file-name .meta { display: none; font-size: .78rem; color: var(--muted); }
.badge-icon {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 13%, transparent);
  color: var(--c);
  position: relative;
}
.badge-icon .icon { width: 20px; height: 20px; }
.badge-icon .ext {
  position: absolute; bottom: -3px; right: -5px;
  padding: 0 4px; border-radius: 4px;
  font-size: .55rem; font-weight: 800; line-height: 14px; letter-spacing: .02em;
  background: var(--c); color: #fff; text-transform: uppercase;
  max-width: 34px; overflow: hidden;
}

/* Empty state */
.empty { padding: 4rem 1.5rem; text-align: center; }
.empty-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.empty-icon .icon { width: 30px; height: 30px; }
.empty h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.empty p { color: var(--muted); font-size: .92rem; }
.empty .btn { margin-top: 1.25rem; }
.empty.error .empty-icon { background: var(--danger-soft); color: var(--danger); }

/* Drag & drop overlay */
.drop-overlay {
  position: absolute; inset: 0; z-index: 3;
  display: none; align-items: center; justify-content: center; flex-direction: column; gap: .6rem;
  border: 2px dashed var(--accent); border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent-soft) 88%, transparent);
  backdrop-filter: blur(2px);
  color: var(--accent); font-weight: 650; font-size: 1.05rem;
  pointer-events: none;
}
.drop-overlay .icon { width: 36px; height: 36px; }
.card.dragging .drop-overlay { display: flex; }

/* Clients */
.client-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 150px 340px; }
.client-row .cell-actions { opacity: 1; gap: .35rem; }
.client-name { display: flex; align-items: center; gap: .75rem; font-weight: 600; min-width: 0; }
.client-name span:last-child { overflow: hidden; text-overflow: ellipsis; }
.folder-pill {
  display: inline-flex; align-items: center; gap: .4rem; max-width: 100%;
  padding: .25rem .6rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-size: .84rem; font-weight: 500; cursor: pointer;
}
.folder-pill:hover { border-color: var(--accent); color: var(--accent); }
.folder-pill .icon { width: 15px; height: 15px; color: #f59e0b; }
.folder-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { padding: 1.1rem 1.25rem; display: flex; align-items: center; gap: .9rem; }
.stat .badge-icon { width: 42px; height: 42px; }
.stat strong { display: block; font-size: 1.35rem; letter-spacing: -.02em; }
.stat small { color: var(--muted); }

/* ==========================================================================
   Upload panel
   ========================================================================== */
.upload-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 20;
  width: min(400px, calc(100vw - 32px));
  max-height: 55vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise .2s ease-out;
}
.upload-panel.collapsed #upload-list { display: none; }
.upload-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .85rem 1rem .6rem; }
.upload-head strong { display: block; font-size: .92rem; }
.upload-head-actions { display: flex; gap: .15rem; }
.upload-panel > .progress { margin: 0 1rem .75rem; }
#upload-list { list-style: none; margin: 0; padding: 0 .5rem .5rem; overflow-y: auto; border-top: 1px solid var(--border); }
#upload-list li { display: flex; align-items: center; gap: .7rem; padding: .55rem .5rem; font-size: .84rem; border-radius: 8px; }
#upload-list li .badge-icon { width: 30px; height: 30px; border-radius: 8px; }
#upload-list li .badge-icon .icon { width: 16px; height: 16px; }
#upload-list li .badge-icon .ext { display: none; }
.job-body { flex: 1; min-width: 0; }
.job-top { display: flex; justify-content: space-between; gap: .75rem; margin-bottom: .3rem; }
.job-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.job-state { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
li.done .job-state { color: var(--ok); }
li.error .job-state { color: var(--danger); }
.progress { height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }
li.done .progress > div { background: var(--ok); }
li.error .progress > div { background: var(--danger); }

/* ==========================================================================
   Dialog & toast
   ========================================================================== */
dialog.modal {
  width: min(470px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  padding: 1.6rem;
  box-shadow: var(--shadow-lg);
}
dialog.modal[open] { animation: pop .18s ease-out; }
dialog.modal::backdrop { background: rgba(10, 12, 24, .5); backdrop-filter: blur(3px); }
dialog.modal h2 { font-size: 1.2rem; margin-bottom: .5rem; }
dialog.modal .modal-message { color: var(--muted); margin-bottom: 1.25rem; }
dialog.modal .modal-body { margin-top: 1.25rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.5rem; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 30;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: .6rem;
  max-width: calc(100vw - 32px);
  padding: .7rem 1.1rem;
  border-radius: 12px;
  background: #111827; color: #fff;
  font-size: .9rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: rise .2s ease-out;
}
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #34d399; flex: none; }
.toast.error::before { background: #f87171; }

@keyframes rise { from { opacity: 0; transform: translate(var(--tx, 0), 10px); } to { opacity: 1; transform: translate(var(--tx, 0), 0); } }
.toast { --tx: -50%; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }

.skeleton { padding: 1rem; display: grid; gap: .6rem; }
.skeleton div { height: 44px; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .mobile-only { display: inline-block; margin-bottom: 1.25rem; }
  .login-box .brand-mark { width: 48px; height: 48px; border-radius: 14px; }
  .row { grid-template-columns: 28px minmax(0, 1fr) 90px 190px; }
  .client-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 340px; }
  .cell-date { display: none; }
}

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar {
    position: sticky; top: 0; z-index: 10; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem;
    padding: .6rem 16px;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .side-brand { flex: 1; padding: 0; }
  .side-brand .brand-mark { width: 30px; height: 30px; }
  .side-user { padding: 0; background: none; border: 0; }
  .side-user .avatar, .side-user-text { display: none; }
  .nav { order: 3; flex-basis: 100%; flex-direction: row; overflow-x: auto; gap: .25rem; margin: 0 -4px; padding: 0 4px; scrollbar-width: none; }
  .nav-item { flex: none; height: 36px; padding: 0 .75rem; gap: .5rem; font-size: .88rem; }
  .content { padding: 1.25rem 16px 6rem; }
  .page-head h1 { font-size: 1.35rem; }
  .card-bar .btn .label { display: none; }
  .card-bar .btn:not(.icon-only) { width: 38px; padding: 0; }
  .search { max-width: none; flex-basis: 0; }
  .card-bar { flex-wrap: nowrap; padding: .7rem .75rem; }
  .card-bar .count-chip, .card-bar .spacer { display: none; }
  .row { grid-template-columns: 24px minmax(0, 1fr) auto; gap: .6rem; padding: .4rem .5rem; }
  .row.head { display: none; }
  .cell-size { display: none; }
  .file-name .meta { display: block; }
  .dl-btn { width: 32px; padding: 0; }
  .dl-btn .label { display: none; }
  .badge-icon { width: 36px; height: 36px; }
  .client-row { grid-template-columns: minmax(0, 1fr); gap: .5rem; padding: .85rem .65rem; }
  .client-row + .client-row { border-top: 1px solid var(--border); border-radius: 0; }
  .client-row .cell-date { display: none; }
  .client-row .cell-actions { justify-content: flex-start; flex-wrap: wrap; }
  .upload-panel { right: 16px; bottom: 16px; }
}
