/* =========================================================================
   StartDash design system — tokens (light / dark), base, components, layout
   ========================================================================= */
:root {
  color-scheme: light;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #f6f7f9;
  --bg-elev: #ffffff;
  --bg-sunken: #eef1f4;
  --bg-hover: #f1f4f7;
  --bg-active: #e7ecf1;
  --border: #e2e7ec;
  --border-strong: #cfd6de;
  --text: #0f1720;
  --text-2: #3d4a57;
  --text-3: #66727f;
  --text-inv: #ffffff;

  --brand: #0b7a68;
  --brand-hover: #09665a;
  --brand-soft: #e3f4f0;
  --brand-text: #0a6b5c;
  --ink: #0d1b2a;

  --success: #12804a; --success-soft: #e5f5ec;
  --warning: #a35f00; --warning-soft: #fdf2e0;
  --danger: #c2272d;  --danger-soft: #fdecec;
  --info: #1d5fbf;    --info-soft: #e8f0fc;
  --orange: #b4500b;  --orange-soft: #fdeee2;
  --purple: #6b3fc0;  --purple-soft: #f1ebfc;
  --neutral-strong: #3d4651; --neutral-soft: #e9ecef;

  --chart-1: #0b7a68; --chart-2: #3b5bdb; --chart-3: #d97706; --chart-4: #c2416b;
  --chart-5: #0e8ac2; --chart-6: #7c4dcf; --chart-7: #65a30d; --chart-8: #64748b;

  --radius-sm: 6px; --radius: 10px; --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
  --focus: 0 0 0 3px rgba(11, 122, 104, .28);
  --sidebar-w: 248px;
  --topbar-h: 60px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1016;
  --bg-elev: #121a23;
  --bg-sunken: #0e151c;
  --bg-hover: #18222d;
  --bg-active: #1e2a37;
  --border: #223040;
  --border-strong: #2e3e50;
  --text: #e8eef4;
  --text-2: #b7c3cf;
  --text-3: #8796a5;
  --text-inv: #0b1016;

  --brand: #2cc7a7;
  --brand-hover: #4dd6bb;
  --brand-soft: rgba(44, 199, 167, .14);
  --brand-text: #5fe0c4;
  --ink: #e8eef4;

  --success: #3fcf8e; --success-soft: rgba(63, 207, 142, .14);
  --warning: #f2b04a; --warning-soft: rgba(242, 176, 74, .14);
  --danger: #f2696e;  --danger-soft: rgba(242, 105, 110, .14);
  --info: #6aa4ff;    --info-soft: rgba(106, 164, 255, .14);
  --orange: #ff9f5a;  --orange-soft: rgba(255, 159, 90, .14);
  --purple: #b79bff;  --purple-soft: rgba(183, 155, 255, .16);
  --neutral-strong: #c4cbd3; --neutral-soft: rgba(196, 203, 211, .12);

  --chart-1: #2cc7a7; --chart-2: #7b93ff; --chart-3: #f2b04a; --chart-4: #f27aa0;
  --chart-5: #4cc3f2; --chart-6: #b08cff; --chart-7: #a3d65c; --chart-8: #94a3b8;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 3px rgba(0, 0, 0, .45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
  --focus: 0 0 0 3px rgba(44, 199, 167, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; color: var(--text); letter-spacing: -0.015em; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 600; }
h4 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
p { margin: 0 0 .75em; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--font-mono); font-size: 12.5px; }
.num, .tnum, td.num, th.num { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.text-2 { color: var(--text-2); }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.strong { font-weight: 600; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- layout primitives ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-sm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.span-2 { grid-column: span 2; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: 8px } .mb-2 { margin-bottom: 16px }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; } .hide-sm { display: none !important; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 550; font-size: 13.5px;
  cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  user-select: none;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #04231d; }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-secondary { background: var(--bg-elev); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.95); }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-block { width: 100%; }
.btn .spinner { width: 14px; height: 14px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 560; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea, input.form-control, select.form-control, textarea.form-control {
  width: 100%; height: 36px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg-elev); color: var(--text); font: inherit; font-size: 13.5px; transition: border-color .12s, box-shadow .12s;
}
.textarea, textarea.form-control { height: auto; min-height: 88px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus, .form-control:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.invalid, .input.invalid, .form-control.invalid, input.invalid, select.invalid, textarea.invalid { border-color: var(--danger) !important; }
.validation-message, .field-error { color: var(--danger); font-size: 12px; }
.validation-errors { color: var(--danger); font-size: 12.5px; margin: 0; padding-left: 18px; }
.input-group { position: relative; display: flex; align-items: stretch; }
.input-group .addon { display: inline-flex; align-items: center; padding: 0 10px; font-size: 12.5px; color: var(--text-3); background: var(--bg-sunken); border: 1px solid var(--border-strong); }
.input-group .addon:first-child { border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .addon:last-child { border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .input { border-radius: 0; }
.input-group .input:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .input:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-elev); font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-text); font-weight: 560; }

/* ---------- cards ---------- */
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-body { padding: 18px 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-header h2, .card-header h3 { font-size: 14.5px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); }
.card.flush .table-wrap { border: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@media (max-width: 640px) { .card-body { padding: 14px; } .card-header { padding: 12px 14px; } }

.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-height: 104px; }
.stat .stat-label { font-size: 12.5px; color: var(--text-3); font-weight: 520; display: flex; align-items: center; gap: 6px; }
.stat .stat-value { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.stat .stat-sub { font-size: 12.5px; color: var(--text-3); }
.stat .stat-empty { font-size: 12.5px; color: var(--text-3); line-height: 1.4; margin-top: 4px; }
@media (max-width: 640px) { .stat .stat-value { font-size: 20px; } }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--bg-sunken); color: var(--text-2); border: 1px solid var(--border); }
.badge-brand { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-demo { background: var(--warning-soft); color: var(--warning); border-color: transparent; letter-spacing: .04em; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- tables ---------- */
.table-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table-tools .input { max-width: 280px; height: 34px; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 620; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 16px; background: var(--bg-sunken); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-hover); }
.table td.num, .table th.num { text-align: right; }
.table tfoot td { font-weight: 650; background: var(--bg-sunken); border-top: 1px solid var(--border); }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table tr.is-muted td { color: var(--text-3); }
.table tr.is-struck td:not(.actions) { text-decoration: line-through; color: var(--text-3); }
@media (max-width: 720px) { .table th, .table td { padding: 9px 10px; } }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); flex-wrap: wrap; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { height: 40px; padding: 0 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-3); font: inherit; font-weight: 560; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--brand); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 9px; }
.segmented button { height: 28px; padding: 0 12px; border: 0; background: none; border-radius: 6px; font: inherit; font-size: 12.5px; font-weight: 560; color: var(--text-3); cursor: pointer; }
.segmented button.active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- alerts / empty / skeleton ---------- */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-elev); font-size: 13.5px; color: var(--text-2); }
.alert-info { background: var(--info-soft); border-color: transparent; color: var(--text); }
.alert-success { background: var(--success-soft); border-color: transparent; color: var(--text); }
.alert-warning { background: var(--warning-soft); border-color: transparent; color: var(--text); }
.alert-danger { background: var(--danger-soft); border-color: transparent; color: var(--text); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 40px 20px; color: var(--text-3); }
.empty .empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.empty h3 { color: var(--text); }
.empty p { max-width: 420px; margin: 0; }
.skeleton { background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--bg-hover) 50%, var(--bg-sunken) 75%); background-size: 200% 100%; animation: sk 1.3s infinite linear; border-radius: 6px; }
@keyframes sk { from { background-position: 200% 0 } to { background-position: -200% 0 } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { transition: none !important; } }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- progress ---------- */
.progress { height: 8px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.progress.lg { height: 10px; }

/* ---------- overlay: modal / drawer / dropdown / tooltip ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8, 14, 20, .48); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto; animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal { width: 100%; max-width: 560px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: pop .14s ease-out; }
.modal.lg { max-width: 780px; }
.modal.sm { max-width: 420px; }
@keyframes pop { from { transform: translateY(6px) scale(.99); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(8, 14, 20, .45); z-index: 60; animation: fade .12s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--bg-elev); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 61; display: flex; flex-direction: column; animation: slide .16s ease-out; }
@keyframes slide { from { transform: translateX(16px); opacity: 0 } to { transform: none; opacity: 1 } }
.drawer .modal-body { flex: 1; overflow-y: auto; }
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.dropdown-menu.left { left: 0; right: auto; }
.dropdown-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 7px; border: 0; background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; text-decoration: none !important; }
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.active { background: var(--brand-soft); color: var(--brand-text); }
.dropdown-sep { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown-label { padding: 6px 10px 4px; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg-elev);
  font-size: 12px; font-weight: 500; line-height: 1.35; padding: 6px 8px; border-radius: 6px; white-space: normal; width: max-content; max-width: 260px; z-index: 80; pointer-events: none; text-transform: none; letter-spacing: 0;
}
.info-tip { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--border-strong); font-size: 10px; color: var(--text-3); cursor: help; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 16px; right: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: pop .15s ease-out; }
.toast .bar { width: 3px; align-self: stretch; border-radius: 3px; flex: none; }
.toast.success .bar { background: var(--success); } .toast.error .bar { background: var(--danger); } .toast.info .bar { background: var(--info); } .toast.warning .bar { background: var(--warning); }

/* ---------- avatar ---------- */
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); display: inline-grid; place-items: center; font-weight: 650; font-size: 12px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.logo-box { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elev); display: grid; place-items: center; overflow: hidden; flex: none; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; }

/* ======================= APP SHELL ======================= */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg-elev); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 40; }
.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--border); flex: none; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; color: var(--text); }
.nav { padding: 12px 10px 20px; display: flex; flex-direction: column; gap: 2px; }
.nav-section { margin-top: 14px; padding: 0 10px 6px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.nav-link { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--text-2); font-weight: 520; font-size: 13.5px; text-decoration: none !important; }
.nav-link svg { width: 17px; height: 17px; flex: none; color: var(--text-3); }
.nav-link:hover { background: var(--bg-hover); color: var(--text); }
.nav-link.active { background: var(--brand-soft); color: var(--brand-text); }
.nav-link.active svg { color: var(--brand-text); }
.nav-sub { display: flex; flex-direction: column; gap: 1px; padding-left: 27px; margin: 2px 0 4px; }
.nav-sub .nav-link { height: 30px; font-size: 13px; }
.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.search-trigger { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; min-width: 260px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-3); font: inherit; font-size: 13px; cursor: pointer; }
.search-trigger kbd { margin-left: auto; }
kbd { font-family: var(--font-sans); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); background: var(--bg-sunken); color: var(--text-3); }
.content { padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header .subtitle { color: var(--text-3); margin-top: 4px; font-size: 13.5px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-3); }
.menu-toggle { display: none; }
.org-switch { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; max-width: 260px; }
.org-switch:hover { background: var(--bg-hover); border-color: var(--border); }
.notif-dot { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.sidebar-backdrop { display: none; }
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .18s ease-out; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(8, 14, 20, .45); z-index: 35; }
  .menu-toggle { display: inline-flex; }
  .search-trigger { min-width: 0; width: 36px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .content { padding: 16px; }
  .topbar { padding: 0 12px; }
}

/* ---------- command palette ---------- */
.cmdk { width: 100%; max-width: 620px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.cmdk-input { width: 100%; height: 52px; border: 0; border-bottom: 1px solid var(--border); padding: 0 18px; font: inherit; font-size: 15px; background: transparent; color: var(--text); }
.cmdk-input:focus { outline: none; }
.cmdk-list { max-height: 56vh; overflow-y: auto; padding: 6px; }
.cmdk-group { padding: 8px 10px 4px; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--text); text-decoration: none !important; }
.cmdk-item.sel, .cmdk-item:hover { background: var(--bg-hover); }
.cmdk-item .sub { margin-left: auto; color: var(--text-3); font-size: 12px; }

/* ---------- charts ---------- */
.chart { width: 100%; display: block; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font-sans); }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis { stroke: var(--border-strong); }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-item .val { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.donut-wrap { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; align-items: center; }
@media (max-width: 520px) { .donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; } .donut-wrap .legend { width: 100%; } }

/* ---------- checklist ---------- */
.checklist { display: flex; flex-direction: column; gap: 2px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none !important; }
.check-row:hover { background: var(--bg-hover); }
.check-icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1.5px solid var(--border-strong); color: transparent; }
.check-row.done .check-icon { background: var(--success); border-color: var(--success); color: #fff; }
.check-row.fail .check-icon { border-color: var(--danger); color: var(--danger); }
.check-row.done span { color: var(--text-3); }
.score-ring { width: 120px; height: 120px; }

/* ---------- timeline / list ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
a.list-item { color: inherit; text-decoration: none !important; }
a.list-item:hover { background: var(--bg-hover); }
.icon-box { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-sunken); color: var(--text-2); flex: none; }
.icon-box.brand { background: var(--brand-soft); color: var(--brand-text); }
.icon-box svg { width: 16px; height: 16px; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kanban-col { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.kanban-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; box-shadow: var(--shadow-sm); font-size: 13px; }

/* ---------- auth / public ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-aside { background: var(--ink); color: #dfe7ee; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
:root[data-theme="dark"] .auth-aside { background: #0f1923; }
.auth-aside h2 { color: #fff; font-size: 28px; line-height: 1.2; max-width: 440px; }
.auth-aside p { color: #a9b8c6; max-width: 440px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
@media (max-width: 900px) { .auth-page { grid-template-columns: minmax(0, 1fr); } .auth-aside { display: none; } }

.public-nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 max(20px, calc((100vw - 1160px) / 2)); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.public-nav .links { display: flex; gap: 22px; margin-left: 24px; }
.public-nav .links a { color: var(--text-2); font-weight: 520; font-size: 13.5px; }
@media (max-width: 860px) { .public-nav .links { display: none; } }
.landing section { padding: 84px 20px; }
.landing .wrap { max-width: 1160px; margin: 0 auto; }
.hero { padding-top: 72px !important; padding-bottom: 56px !important; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--brand-text); background: var(--brand-soft); padding: 5px 11px; border-radius: 999px; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.05; letter-spacing: -0.035em; margin: 18px 0 8px; font-weight: 720; }
.hero h2 { font-size: clamp(18px, 2.2vw, 22px); font-weight: 520; color: var(--text-2); letter-spacing: -0.01em; margin-bottom: 16px; }
.hero p.lead { font-size: 16.5px; color: var(--text-2); max-width: 540px; line-height: 1.6; }
.journey { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 20px 0 0; font-size: 12px; font-weight: 650; letter-spacing: .06em; color: var(--text-3); }
.journey b { color: var(--brand-text); }
.section-title { max-width: 680px; margin-bottom: 36px; }
.section-title h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.03em; margin: 10px 0 10px; font-weight: 700; }
.section-title p { color: var(--text-2); font-size: 16px; }
.feature { padding: 22px; }
.feature h3 { margin: 12px 0 6px; font-size: 16px; }
.feature p { color: var(--text-2); margin: 0; }
.feature ul { margin: 10px 0 0; padding-left: 18px; color: var(--text-2); }
.band { background: var(--bg-elev); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.price { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.price .amount { font-size: 30px; font-weight: 720; letter-spacing: -0.03em; }
.price.featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.price ul { padding-left: 18px; margin: 4px 0 8px; color: var(--text-2); }
.faq details { border-bottom: 1px solid var(--border); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--text-3); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; color: var(--text-2); }
.public-footer { padding: 32px 20px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; }
.mock { padding: 16px; border-radius: 18px; background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.cta-band { background: var(--ink); color: #dfe7ee; border-radius: 22px; padding: 48px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
:root[data-theme="dark"] .cta-band { background: #0f1923; border: 1px solid var(--border); }
.cta-band h2 { color: #fff; font-size: 28px; letter-spacing: -0.02em; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } .landing section { padding: 56px 20px; } .cta-band { padding: 28px; } }

/* ---------- print (reports) ---------- */
@media print {
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
}

/* ---------------------------------------------------------------- impersonation / platform access banners */
.banner { display: flex; align-items: center; gap: 10px; padding: 8px 20px; font-size: 13.5px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.banner-danger { background: var(--danger-soft); color: var(--text); }
.banner-warning { background: var(--warning-soft); color: var(--text); }
.banner > span { flex: 1 1 240px; }
.banner-action { margin-left: auto; }
.plain-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Admin Console (distinct visual identity: indigo accent, dark sidebar) ---------- */
.admin-shell { --brand: #4f46e5; --brand-hover: #4338ca; --brand-soft: #eef0ff; --brand-text: #4338ca; }
:root[data-theme="dark"] .admin-shell { --brand: #8b8cf6; --brand-hover: #a5a6fa; --brand-soft: rgba(139, 140, 246, .16); --brand-text: #b4b5ff; }
.admin-shell .sidebar { background: #111827; border-right-color: #1f2937; }
.admin-shell .sidebar-brand { border-bottom-color: #1f2937; }
.admin-shell .sidebar .brand-name { color: #f9fafb; }
.admin-shell .sidebar .nav-section { color: #9ca3af; }
.admin-shell .sidebar .nav-link { color: #d1d5db; }
.admin-shell .sidebar .nav-link svg { color: #9ca3af; }
.admin-shell .sidebar .nav-link:hover { background: #1f2937; color: #fff; }
.admin-shell .sidebar .nav-link.active { background: rgba(129, 140, 248, .18); color: #c7d2fe; }
.admin-shell .sidebar .nav-link.active svg { color: #c7d2fe; }
.admin-shell .sidebar-footer { border-top-color: #1f2937; }
.admin-tag { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #c7d2fe; background: rgba(129, 140, 248, .2); border: 1px solid rgba(129, 140, 248, .35); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.admin-search { display: flex; align-items: center; gap: 6px; position: relative; flex: 1 1 320px; max-width: 420px; }
.admin-search svg { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.admin-search .input { padding-left: 30px; height: 34px; }
.admin-env { flex: none; }
.stat-link { text-decoration: none !important; color: inherit; display: block; }
.stat-link:hover .stat, .stat-link:hover .card { border-color: var(--border-strong); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--bg-hover); }
.text-danger { color: var(--danger, #c0392b) !important; }
.input-sm { height: 30px; padding: 0 8px; font-size: 13px; }
.table-tools.wrap { flex-wrap: wrap; }
.code-block { background: var(--bg-sunken, var(--bg-hover)); border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-family: var(--font-mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; margin: 4px 0 0; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.perm-group .check { align-items: flex-start; margin-bottom: 6px; }
.perm-group code { font-size: 11px; display: block; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + span { opacity: .55; }
@media (max-width: 720px) { .admin-search { max-width: none; } .admin-env { display: none; } }

/* ---- Platform administration entry (user app) ---- */
.nav-link.nav-admin { margin: 2px 0 10px; border: 1px solid color-mix(in srgb, #6366f1 45%, transparent); background: color-mix(in srgb, #6366f1 12%, transparent); color: var(--text); font-weight: 620; }
.nav-link.nav-admin svg { color: #6366f1; }
.nav-link.nav-admin:hover { background: color-mix(in srgb, #6366f1 20%, transparent); }
.error-code { font-size: 56px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--brand-text); opacity: .85; }
.admin-section-title { font-size: 15px; font-weight: 650; margin: 6px 0 10px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
a.alert-link { text-decoration: none !important; color: var(--text); }
a.alert-link:hover { filter: brightness(.97); }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 14px; background: var(--brand-soft); border-bottom: 1px solid var(--border); }


/* ---------------------------------------------------------------- investments, payments and billing */
.badge-orange { background: var(--orange-soft); color: var(--orange); border-color: transparent; }
.badge-purple { background: var(--purple-soft); color: var(--purple); border-color: transparent; }
.badge-dark { background: var(--neutral-soft); color: var(--neutral-strong); border-color: transparent; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: middle; }
.text-warning { color: var(--warning) !important; }
.text-success { color: var(--success) !important; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 18px; }
.kv-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv-grid > div strong, .kv-grid > div code { overflow-wrap: anywhere; }
.kv-grid.compact { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px 12px; }
.secret-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; padding: 2px 6px; border-radius: 6px; background: var(--surface-2, rgba(127,127,127,.1)); overflow-wrap: anywhere; }
.wrap-anywhere { overflow-wrap: anywhere; }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.recovery-codes code { font-family: ui-monospace, Menlo, monospace; padding: 4px 6px; border-radius: 6px; background: var(--surface-2, rgba(127,127,127,.1)); text-align: center; }
.avatar-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; border: 1px solid var(--border); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand, #0f8a6c); border: 2px solid var(--surface, #fff); }
.timeline-when { display: block; font-size: 12px; color: var(--muted, #6b7785); }
.timeline-what { font-weight: 600; margin-right: 6px; }
.choice-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface, #fff); color: inherit; text-align: left; cursor: pointer; font: inherit; }
.choice-card:hover { border-color: var(--brand, #0f8a6c); }
.choice-card.active { border-color: var(--brand, #0f8a6c); background: var(--brand-soft); }
.proof-file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--border-strong, #c6ccd3); border-radius: 10px; }
.show-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .show-touch { display: inline-flex; } }
.mini-stat { display: inline-flex; flex-direction: column; gap: 2px; padding: 4px 14px 4px 0; text-decoration: none; color: inherit; min-width: 90px; }
.mini-stat strong { font-size: 20px; }
a.mini-stat:hover strong { color: var(--brand, #0f8a6c); }
.card-link { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.card-link:hover { border-color: var(--brand, #0f8a6c); transform: translateY(-1px); }
.plan-card.current { border-color: var(--brand, #0f8a6c); box-shadow: 0 0 0 1px var(--brand, #0f8a6c) inset; }
.plan-price { font-size: 22px; font-weight: 700; }
.pay-box { padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2, rgba(127,127,127,.05)); }
.legal-page { min-height: 100vh; display: flex; justify-content: center; padding: 32px 16px; }
.legal-card { width: 100%; max-width: 760px; }
.legal-card h2 { font-size: 17px; margin-top: 8px; }
@media (max-width: 640px) {
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-stat { min-width: 70px; padding-right: 10px; }
}

/* Pix QR code (BR Code) */
.pix-qr { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.pix-qr-image { width: 176px; max-width: 100%; background: #fff; border-radius: 8px; padding: 6px; border: 1px solid var(--border); flex-shrink: 0; }
.pix-qr-image svg { width: 100%; height: auto; display: block; }

/* ---------------------------------------------------------------- files & documents */
.link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.link-button:hover .strong, .link-button.strong:hover { color: var(--brand-text, var(--brand)); }
.th-sort { font-weight: inherit; color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.dropzone { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg-elev); transition: border-color .15s, background .15s; }
.dropzone.compact { padding: 10px 12px; }
.dropzone:hover, .dropzone:focus-within, .dropzone.dragging { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.disabled { opacity: .6; }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone.disabled input[type=file] { cursor: not-allowed; }
.upload-queue { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.upload-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); }
.upload-item.failed { border-color: var(--danger); }
.upload-item.completed { border-color: var(--success, var(--brand)); }
.upload-item .progress { margin: 4px 0 2px; height: 6px; }
.upload-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; }
.file-icon { position: relative; display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 8px; background: var(--bg-sunken); color: var(--text-3); }
.file-icon b { position: absolute; bottom: -3px; right: -4px; font-size: 8.5px; font-weight: 750; letter-spacing: .02em; padding: 1px 4px; border-radius: 4px; color: #fff; background: #64748b; line-height: 1.3; }
.file-icon.pdf b { background: #dc2626; } .file-icon.doc b { background: #2563eb; } .file-icon.xls b { background: #16a34a; }
.file-icon.ppt b { background: #ea580c; } .file-icon.img b { background: #7c3aed; } .file-icon.zip b { background: #475569; }
.files-layout { grid-template-columns: minmax(0, 250px) minmax(0, 1fr); }
@media (max-width: 900px) { .files-layout { grid-template-columns: minmax(0, 1fr); } }
.list-item.active { background: var(--brand-soft); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.file-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); cursor: pointer; text-align: left; font: inherit; color: inherit; min-width: 0; }
.file-card:hover, .file-card.selected { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.file-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 8px; background: var(--bg-sunken); overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-flag { position: absolute; top: 6px; right: 6px; background: var(--bg-elev); border-radius: 999px; padding: 3px; display: grid; }
.file-name { font-weight: 600; font-size: 13px; }
.table tr.selected td { background: var(--brand-soft); }
.file-frame { width: 100%; height: min(70vh, 720px); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-sunken); }
.file-image { display: grid; place-items: center; background: var(--bg-sunken); border-radius: var(--radius-sm); padding: 8px; }
.file-image img { max-width: 100%; max-height: 70vh; object-fit: contain; }
.file-text { max-height: 60vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--bg-elev); font-size: 13px; }
pre.file-text { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.file-text.doc p { margin: 0 0 8px; }
.file-text .slide { padding: 8px 0; border-bottom: 1px solid var(--border); }
.table.compact td { padding: 4px 8px; font-size: 12.5px; white-space: nowrap; }
.file-nopreview { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 32px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.file-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 13px; }
.file-meta dt { color: var(--text-3); }
.file-meta dd { margin: 0; }
.modal.xl { max-width: min(1100px, 96vw); }
.storage-usage.warn .progress > span { background: var(--warning, #d97706); }
.progress.danger > span { background: var(--danger); }
.org-logo { display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 10px; border: 1px solid var(--border); background: var(--brand-soft); color: var(--brand-text, var(--brand)); font-weight: 700; letter-spacing: .02em; }
.org-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.org-logo.circle { border-radius: 50%; }
.org-logo.circle img { object-fit: cover; }
.image-field { display: flex; gap: 14px; align-items: flex-start; }
.image-field.wide { flex-direction: column; }
.image-field.wide .image-field-preview { width: 100%; }
.cover-box { width: 100%; aspect-ratio: 4 / 1; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-sunken); display: grid; place-items: center; overflow: hidden; }
.cover-box img { width: 100%; height: 100%; object-fit: cover; }
.crop-frame { width: 100%; max-width: 560px; margin: 0 auto; border-radius: var(--radius-sm); border: 2px solid var(--brand); background-color: var(--bg-sunken); background-repeat: no-repeat; }
input[type=range] { width: 100%; accent-color: var(--brand); }
.company-hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--bg-elev); }
.company-cover { display: block; width: 100%; aspect-ratio: 5 / 1; object-fit: cover; }
.company-hero-id { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.company-hero:not(.no-cover) .company-hero-id { margin-top: -36px; }
.company-hero:not(.no-cover) .org-logo { box-shadow: 0 0 0 3px var(--bg-elev); }
.brand-logo { display: inline-flex; align-items: center; height: 30px; }
.brand-logo img { height: 30px; max-width: 170px; object-fit: contain; }
.brand-logo-dark { display: none; }
:root[data-theme="dark"] .brand-logo-light { display: none; }
:root[data-theme="dark"] .brand-logo-dark { display: inline; }
img.brand-mark { object-fit: contain; border-radius: 8px; }
.auth-aside.with-image { background-image: linear-gradient(rgba(10, 20, 30, .55), rgba(10, 20, 30, .78)), var(--auth-image); background-size: cover; background-position: center; }
.branding-previews { display: flex; gap: 10px; flex-wrap: wrap; }
.branding-preview { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); min-width: 140px; }
.branding-preview.light { background: #ffffff; }
.branding-preview.dark { background: #0f1923; }
.branding-preview img { max-height: 56px; max-width: 220px; object-fit: contain; }
@media (max-width: 640px) { .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .image-field { flex-direction: column; } .company-cover { aspect-ratio: 3 / 1; } }
