/* ════════════════════════════════════════════════════════════════
   CloudVault Enterprise — SecureVault.ca Colors
   Sidebar : Deep navy #1A2B3C  Accent: Crimson #BD3030
   Surfaces: Warm paper #FAF8F4  Linen bg #F2EDE4
   Type    : Plus Jakarta Sans (display) · Inter (body) · JetBrains Mono
   ════════════════════════════════════════════════════════════════ */

:root {
  /* ── Signature red — one strong note, used with restraint ── */
  --red:        #BD3030;
  --red-dk:     #9B2020;
  --red-lt:     #D44040;
  --red-bg:     #FDF0F0;
  --red-bd:     #F5C6C6;
  --red-glow:   rgba(189,48,48,.14);

  /* ── Sidebar — near-black, cool undertone ────────────────── */
  --sb:         #1A2B3C;
  --sb-2:       #243448;
  --sb-hover:   rgba(255,255,255,.05);
  --sb-active:  rgba(189,48,48,.12);
  --sb-border:  rgba(255,255,255,.08);
  --sb-muted:   rgba(255,255,255,.25);
  --sb-dim:     rgba(255,255,255,.55);
  --sb-hi:      #FFFFFF;
  --sb-w:       252px;

  /* ── Content surfaces ────────────────────────────────────── */
  --bg:         #F2EDE4;
  --canvas:     #FAF8F4;
  --tray:       #F0EBE1;
  --well:       #EDE8DF;
  --inset:      #E5DFD4;

  /* ── Text hierarchy ──────────────────────────────────────── */
  --t1:         #0F1C28;
  --t2:         #2C4159;
  --t3:         #4A6070;
  --t4:         #6B8090;

  /* ── Borders ─────────────────────────────────────────────── */
  --bd:         rgba(26,43,60,.18);
  --bd-lt:      rgba(26,43,60,.10);
  --bd-dk:      rgba(26,43,60,.28);

  /* ── Status palette ──────────────────────────────────────── */
  --green:  #059669; --green-bg:  #ECFDF5; --green-bd:  #A7F3D0;
  --amber:  #D97706; --amber-bg:  #FFFBEB; --amber-bd:  #FDE68A;
  --blue:   #2563EB; --blue-bg:   #EFF6FF; --blue-bd:   #BFDBFE;
  --purple: #7C3AED; --purple-bg: #F5F3FF; --purple-bd: #DDD6FE;
  --teal:   #0891B2; --teal-bg:   #ECFEFF; --teal-bd:   #A5F3FC;

  /* ── Shadows ─────────────────────────────────────────────── */
  --sh-xs: 0 1px 3px rgba(15,28,40,.07);
  --sh-sm: 0 2px 8px rgba(15,28,40,.09), 0 1px 3px rgba(15,28,40,.06);
  --sh:    0 4px 16px rgba(15,28,40,.10), 0 1px 4px rgba(15,28,40,.06);
  --sh-lg: 0 8px 32px rgba(15,28,40,.12), 0 3px 10px rgba(15,28,40,.07);
  --sh-xl: 0 16px 56px rgba(15,28,40,.15), 0 6px 20px rgba(15,28,40,.09);

  /* ── Layout ──────────────────────────────────────────────── */
  --hh:   56px;
  --r:    10px;
  --r-md: 14px;
  --r-lg: 20px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--t1); line-height: 1.6; }
a { color: var(--t2); text-decoration: none; }
a:hover { color: var(--t1); }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
hr { border: none; border-top: 1px solid var(--bd); }

.mono     { font-family: 'JetBrains Mono', monospace; font-size: .82em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-muted   { color: var(--t3); }
.text-success { color: var(--green); }
.text-danger  { color: var(--red); }
.text-warning { color: var(--amber); }
.text-sm { font-size: .82rem; } .text-xs { font-size: .73rem; }
.mt-1{margin-top:.4rem} .mt-2{margin-top:.8rem} .mt-3{margin-top:1.25rem} .mt-4{margin-top:1.75rem}
.mb-1{margin-bottom:.4rem} .mb-2{margin-bottom:.8rem} .mb-3{margin-bottom:1.25rem} .mb-4{margin-bottom:1.75rem}

/* ══════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════ */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--hh); z-index: 200;
  background: var(--sb); border-bottom: 1px solid var(--sb-border);
  display: flex; align-items: center; padding: 0 1.25rem; gap: 1rem;
}

.header-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; text-decoration: none; }
.header-logo:hover { text-decoration: none; }
.logo-icon   { display: block; width: 28px; height: 28px; flex-shrink: 0; }
.logo-wordmark {
  font-family: 'Space Grotesk', sans-serif; font-size: .95rem; font-weight: 700;
  color: #FFFFFF; letter-spacing: -.02em; line-height: 1;
}
.logo-wordmark span { color: var(--red); }

.header-search { flex: 1; max-width: 400px; position: relative; margin-left: .5rem; }
.header-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,.25); pointer-events: none; width: 14px; height: 14px; }
.header-search-input {
  width: 100%; height: 33px; padding: 0 11px 0 33px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  color: #fff; font-size: .83rem; border-radius: var(--r);
  outline: none; transition: all .15s;
}
.header-search-input::placeholder { color: rgba(255,255,255,.22); }
.header-search-input:focus {
  background: rgba(255,255,255,.09); border-color: rgba(229,50,45,.45);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.header-right { display: flex; align-items: center; gap: 1px; margin-left: auto; }
.header-btn {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--r);
  color: rgba(255,255,255,.38); transition: all .14s; position: relative;
}
.header-btn svg { width: 17px; height: 17px; }
.header-btn:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.85); }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px;
  background: var(--red); border-radius: 50%; border: 1.5px solid var(--sb); }

.user-avatar-wrap { position: relative; margin-left: 8px; }
.user-avatar {
  width: 30px; height: 30px; border-radius: var(--r);
  background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-size: .6rem; font-weight: 700;
  letter-spacing: .03em; cursor: pointer;
  border: 1.5px solid rgba(229,50,45,.5); transition: border-color .15s;
}
.user-avatar:hover { border-color: var(--red-lt); }

.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 9px); min-width: 224px;
  background: var(--canvas); border: 1px solid var(--bd);
  box-shadow: var(--sh-xl); z-index: 300;
  border-radius: var(--r-md); overflow: hidden; display: none;
}
.user-dropdown.open { display: block; animation: _dd .14s ease; }
@keyframes _dd { from { opacity:0; transform:translateY(-5px); } to { opacity:1; transform:none; } }

.user-dropdown-header {
  padding: 12px 14px 11px; border-bottom: 1px solid var(--bd);
  background: var(--tray);
}
.user-dropdown-name  { font-size: .85rem; font-weight: 700; color: var(--t1); }
.user-dropdown-email { font-size: .71rem; color: var(--t3); margin-top: 1px; font-family: 'JetBrains Mono', monospace; }
.user-dropdown-plan  {
  display: inline-block; margin-top: 6px; font-family: 'JetBrains Mono', monospace;
  font-size: .6rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  background: var(--red-bg); color: var(--red-dk); padding: 2px 8px;
  border-radius: var(--r); border: 1px solid var(--red-bd);
}
.dropdown-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 14px;
  font-size: .83rem; font-weight: 500; color: var(--t2);
  border: none; background: none; width: 100%; text-align: left;
  text-decoration: none; transition: background .1s; cursor: pointer;
}
.dropdown-item svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--t4); }
.dropdown-item:hover { background: var(--tray); color: var(--t1); }
.dropdown-item:hover svg { color: var(--t3); }
.dropdown-item-danger { color: var(--red); }
.dropdown-item-danger svg { color: var(--red-bd); }
.dropdown-item-danger:hover { background: var(--red-bg); }
.dropdown-admin { color: var(--blue); }
.dropdown-admin svg { color: var(--blue-bd); }
.dropdown-admin:hover { background: var(--blue-bg); }
.dropdown-divider { border-top: 1px solid var(--bd-lt); }

/* ══════════════════════════════════════════════════════════════
   LAYOUT + SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.app-layout { display: grid; grid-template-columns: var(--sb-w) 1fr; min-height: 100vh; padding-top: var(--hh); }

.sidebar {
  background: var(--sb); border-right: 1px solid var(--sb-border);
  position: sticky; top: var(--hh); height: calc(100vh - var(--hh));
  overflow-y: auto; display: flex; flex-direction: column; padding: .75rem 0;
}
.sidebar::-webkit-scrollbar { width: 0; }

.sidebar-label {
  font-family: 'JetBrains Mono', monospace; font-size: .53rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--sb-muted); padding: .85rem .9rem .3rem; display: block;
}
.sidebar-divider { border-top: 1px solid var(--sb-border); margin: .5rem .9rem; }

.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 6.5px 9px; margin: 0 .6rem;
  font-size: .83rem; font-weight: 500; color: var(--sb-dim);
  text-decoration: none; border-radius: var(--r);
  transition: all .12s; border: none; background: none; width: calc(100% - 1.2rem); cursor: pointer;
}
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-item:hover { color: var(--sb-hi); background: var(--sb-hover); text-decoration: none; }
.nav-item.active { color: #FFFFFF; background: var(--sb-active); font-weight: 600; }
.nav-item.active svg { color: var(--red); }
.nav-item.active::before {
  content: none; /* Use background only — cleaner than bar */
}

/* Red left bar on active: insert via box-shadow so no layout shift */
.nav-item.active { box-shadow: inset 3px 0 0 var(--red); padding-left: 6px; }

.nav-badge {
  margin-left: auto; font-family: 'JetBrains Mono', monospace;
  font-size: .57rem; padding: 1px 6px; border-radius: 20px;
  background: rgba(255,255,255,.07); color: var(--sb-muted);
  border: 1px solid rgba(255,255,255,.06);
}
.nav-badge-red { background: var(--red); color: #fff; border-color: transparent; }

.upload-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: calc(100% - 1.8rem); margin: .5rem .9rem .15rem;
  padding: 8.5px; background: var(--red); color: #fff;
  border: none; border-radius: var(--r); font-size: .83rem; font-weight: 600;
  cursor: pointer; transition: all .14s; letter-spacing: .01em;
}
.upload-btn svg { width: 14px; height: 14px; }
.upload-btn:hover { background: var(--red-lt); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(229,50,45,.35); }

.sidebar-storage {
  margin: auto .9rem .9rem; padding: .85rem;
  background: rgba(255,255,255,.04); border: 1px solid var(--sb-border);
  border-radius: var(--r-md);
}
.storage-head  { display: flex; justify-content: space-between; margin-bottom: 6px; }
.storage-label { font-family: 'JetBrains Mono', monospace; font-size: .57rem; color: var(--sb-muted); }
.storage-val   { font-family: 'JetBrains Mono', monospace; font-size: .57rem; color: var(--sb-dim); }
.storage-bar   { height: 3px; background: rgba(255,255,255,.08); border-radius: 10px; overflow: hidden; }
.storage-fill  { height: 100%; background: var(--red); border-radius: 10px; transition: width .4s; }
.storage-fill.warn { background: var(--amber); }
.storage-text  { font-family: 'JetBrains Mono', monospace; font-size: .56rem; color: var(--sb-muted); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */
.main-content { min-width: 0; padding: 2rem 2.5rem; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 2rem; gap: 1rem; flex-wrap: wrap; }
.page-title {
  font-family: 'Space Grotesk', sans-serif; font-size: 1.6rem; font-weight: 700;
  color: var(--t1); letter-spacing: -.03em; line-height: 1.2;
}
.page-subtitle { font-size: .83rem; color: var(--t3); margin-top: 4px; }
.page-actions  { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--canvas); border: 1px solid var(--bd);
  border-radius: var(--r-md); box-shadow: var(--sh-xs);
}
.card-header {
  padding: .9rem 1.25rem; border-bottom: 1px solid var(--bd);
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.card-title { font-family: 'Space Grotesk', sans-serif; font-size: .88rem; font-weight: 600; color: var(--t1); }
.card-body   { padding: 1.25rem; }
.card-footer {
  padding: .85rem 1.25rem; border-top: 1px solid var(--bd);
  background: var(--tray); border-radius: 0 0 var(--r-md) var(--r-md);
}

/* ══════════════════════════════════════════════════════════════
   STATS
   ══════════════════════════════════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px,1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat-card {
  background: var(--canvas); border: 1px solid var(--bd); border-radius: var(--r-md);
  padding: 1.25rem 1.4rem; box-shadow: var(--sh-xs); position: relative; overflow: hidden;
  transition: box-shadow .18s, transform .15s;
}
.stat-card:hover { box-shadow: var(--sh-sm); transform: translateY(-1px); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.stat-card.red::before    { background: var(--red); }
.stat-card.green::before  { background: var(--green); }
.stat-card.amber::before  { background: var(--amber); }
.stat-card.blue::before   { background: var(--blue); }
.stat-card.purple::before { background: var(--purple); }
.stat-card.teal::before   { background: var(--teal); }
.stat-num {
  font-family: 'Space Grotesk', sans-serif; font-size: 2rem; font-weight: 700;
  color: var(--t1); line-height: 1.1; letter-spacing: -.04em;
}
.stat-label {
  font-family: 'JetBrains Mono', monospace; font-size: .58rem;
  text-transform: uppercase; letter-spacing: .1em; color: var(--t3); margin-top: 5px;
}
.stat-sub    { font-size: .75rem; color: var(--t3); margin-top: 4px; }
.stat-change { font-size: .73rem; margin-top: 4px; font-weight: 600; }
.stat-up     { color: var(--green); }
.stat-down   { color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 16px; height: 35px; font-size: .83rem; font-weight: 600;
  border-radius: var(--r); text-decoration: none; transition: all .14s;
  cursor: pointer; white-space: nowrap; border: none; letter-spacing: .01em;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--red); color: #fff;
  box-shadow: 0 1px 3px rgba(229,50,45,.3);
}
.btn-primary:hover { background: var(--red-lt); box-shadow: 0 3px 10px rgba(229,50,45,.35); }

.btn-dark    { background: var(--t1); color: #fff; }
.btn-dark:hover { background: #1f2937; }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { filter: brightness(.9); }

.btn-outline {
  background: var(--canvas); color: var(--t2);
  border: 1px solid var(--bd); box-shadow: var(--sh-xs);
}
.btn-outline:hover { background: var(--tray); border-color: var(--bd-dk); color: var(--t1); }

.btn-outline-danger { background: var(--canvas); color: var(--red); border: 1px solid var(--bd); }
.btn-outline-danger:hover { background: var(--red-bg); border-color: var(--red-bd); }

.btn-ghost { background: transparent; color: var(--t3); border: none; padding: 0 10px; height: 33px; }
.btn-ghost:hover { background: var(--well); color: var(--t1); }

.btn-sm  { height: 30px; padding: 0 12px; font-size: .79rem; }
.btn-xs  { height: 25px; padding: 0 9px;  font-size: .72rem; }
.btn-lg  { height: 40px; padding: 0 22px; font-size: .87rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon  { width: 35px; height: 35px; padding: 0; justify-content: center; }
.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn + .btn { border-left: none; }
.btn-group .btn:first-child { border-radius: var(--r) 0 0 var(--r); }
.btn-group .btn:last-child  { border-radius: 0 var(--r) var(--r) 0; border-left: 1px solid rgba(255,255,255,.15); }

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 1rem; }
.form-label { font-size: .78rem; font-weight: 600; color: var(--t2); }
.form-label-req { color: var(--red); }
.form-hint  { font-size: .73rem; color: var(--t4); }
.form-control {
  height: 37px; padding: 0 12px; border: 1px solid var(--bd);
  background: var(--canvas); color: var(--t1); font-size: .85rem;
  border-radius: var(--r); outline: none; transition: border-color .14s, box-shadow .14s; width: 100%;
}
textarea.form-control { height: auto; padding: 9px 12px; }
.form-control:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }
.form-control:disabled { background: var(--well); color: var(--t3); cursor: not-allowed; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px;
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-error  { font-size: .74rem; color: var(--red); font-weight: 600; }
.form-divider { position: relative; text-align: center; margin: 1.25rem 0; }
.form-divider::before { content:''; position:absolute; top:50%; left:0; right:0; height:1px; background:var(--bd); }
.form-divider span { position:relative; background:var(--canvas); padding:0 .75rem; font-size:.76rem; color:var(--t4); }

.toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.toggle input { display: none; }
.toggle-track {
  width: 34px; height: 18px; background: var(--bd-dk); border-radius: 20px;
  transition: background .18s; position: relative; flex-shrink: 0;
}
.toggle input:checked + .toggle-track { background: var(--red); }
.toggle-thumb {
  position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: var(--sh-xs);
}
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(16px); }
.toggle-label { font-size: .83rem; font-weight: 500; color: var(--t2); }

/* ══════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--bd); box-shadow: var(--sh-xs); }
.table { width: 100%; border-collapse: collapse; background: var(--canvas); }
.table th {
  font-family: 'JetBrains Mono', monospace; font-size: .66rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--t3);
  padding: 9px 14px; text-align: left; background: var(--tray);
  border-bottom: 1px solid var(--bd); white-space: nowrap;
}
.table td {
  padding: 10px 14px; font-size: .84rem; color: var(--t1);
  border-bottom: 1px solid var(--bd-lt); vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .08s; }
.table tbody tr:hover { background: var(--tray); }
.table-sm td, .table-sm th { padding: 7px 12px; font-size: .79rem; }
.col-actions { width: 1%; white-space: nowrap; }
.row-actions { display: flex; gap: 3px; justify-content: flex-end; }
.action-btn {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid transparent; border-radius: var(--r);
  cursor: pointer; color: var(--t4); transition: all .12s;
}
.action-btn svg { width: 13px; height: 13px; }
.action-btn:hover { background: var(--well); border-color: var(--bd); color: var(--t2); }
.action-btn-danger:hover { background: var(--red-bg); border-color: var(--red-bd); color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: .64rem; font-weight: 500;
  padding: 2px 8px; border-radius: var(--r); white-space: nowrap; line-height: 1.75;
}
.badge-red    { background: var(--red-bg);   color: var(--red-dk); border: 1px solid var(--red-bd); }
.badge-slate  { background: var(--well);     color: var(--t3);     border: 1px solid var(--bd); }
.badge-green  { background: var(--green-bg); color: var(--green);  border: 1px solid var(--green-bd); }
.badge-amber  { background: var(--amber-bg); color: var(--amber);  border: 1px solid var(--amber-bd); }
.badge-blue   { background: var(--blue-bg);  color: var(--blue);   border: 1px solid var(--blue-bd); }
.badge-purple { background: var(--purple-bg);color: var(--purple); border: 1px solid var(--purple-bd); }
.badge-teal   { background: var(--teal-bg);  color: var(--teal);   border: 1px solid var(--teal-bd); }
.badge-dark   { background: var(--t1);       color: #fff;          border: 1px solid var(--t2); }

/* ══════════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════════ */
.alert {
  display: flex; gap: 10px; align-items: flex-start; padding: .85rem 1rem;
  border: 1px solid; border-radius: var(--r); font-size: .84rem; line-height: 1.55;
}
.alert svg, .alert-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-bg); border-color: var(--green-bd); color: var(--green); }
.alert-error   { background: var(--red-bg);   border-color: var(--red-bd);   color: var(--red-dk); }
.alert-warning { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber); }
.alert-info    { background: var(--blue-bg);  border-color: var(--blue-bd);  color: var(--blue); }

/* ══════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
  z-index: 1000; align-items: center; justify-content: center; padding: 1.5rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--canvas); border-radius: var(--r-lg); border: 1px solid var(--bd);
  box-shadow: var(--sh-xl); width: 100%; max-width: 540px; max-height: 90vh;
  display: flex; flex-direction: column; animation: _mi .16s ease;
}
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 980px; }
@keyframes _mi { from { opacity:0; transform:translateY(10px) scale(.98); } to { opacity:1; transform:none; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--bd); flex-shrink: 0;
}
.modal-title  { font-family: 'Space Grotesk', sans-serif; font-size: .97rem; font-weight: 700; color: var(--t1); }
.modal-close  {
  width: 27px; height: 27px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--r); color: var(--t4); transition: all .12s;
}
.modal-close svg { width: 13px; height: 13px; }
.modal-close:hover { background: var(--well); color: var(--t1); }
.modal-body   { padding: 1.4rem; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: .9rem 1.4rem; border-top: 1px solid var(--bd);
  display: flex; justify-content: flex-end; gap: .55rem; flex-shrink: 0;
  background: var(--tray); border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ══════════════════════════════════════════════════════════════
   UPLOAD ZONE
   ══════════════════════════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--bd-dk); background: var(--tray);
  padding: 2.75rem 2rem; text-align: center; border-radius: var(--r-md);
  cursor: pointer; transition: all .16s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--red); background: var(--red-bg);
  box-shadow: 0 0 0 4px var(--red-glow);
}
.upload-zone-icon {
  width: 44px; height: 44px; margin: 0 auto .9rem;
  background: var(--well); border: 1px solid var(--bd);
  border-radius: var(--r-md); display: flex; align-items: center; justify-content: center;
}
.upload-zone-icon svg { width: 20px; height: 20px; color: var(--t3); }
.upload-zone h3 { font-family: 'Space Grotesk', sans-serif; font-size: .92rem; font-weight: 600; color: var(--t1); margin-bottom: 4px; }
.upload-zone p  { color: var(--t3); font-size: .82rem; }
.upload-hint    { font-family: 'JetBrains Mono', monospace; font-size: .6rem; color: var(--t4); margin-top: 6px; }
.upload-queue   { margin-top: 1rem; display: flex; flex-direction: column; gap: .35rem; }
.upload-item {
  background: var(--canvas); border: 1px solid var(--bd); border-radius: var(--r);
  padding: .75rem 1rem .9rem; display: flex; align-items: center; gap: .75rem; position: relative;
}
.upload-item-info  { flex: 1; min-width: 0; }
.upload-item-name  { font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-size  { font-family: monospace; font-size: .69rem; color: var(--t3); }
.upload-item-stat.done  { color: var(--green); font-weight: 600; }
.upload-item-stat.error { color: var(--red); font-weight: 600; }
.upload-bar      { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--bd); border-radius: 0 0 var(--r) var(--r); overflow: hidden; }
.upload-bar-fill { height: 100%; background: var(--red); transition: width .3s; }

/* ══════════════════════════════════════════════════════════════
   FILE MANAGER
   ══════════════════════════════════════════════════════════════ */
.file-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; background: var(--canvas);
  border: 1px solid var(--bd); border-radius: var(--r-md) var(--r-md) 0 0; gap: .75rem; flex-wrap: wrap;
}
.file-toolbar-left, .file-toolbar-right { display: flex; align-items: center; gap: .5rem; }
.breadcrumb { display: flex; align-items: center; gap: 3px; font-size: .82rem; }
.breadcrumb-item { color: var(--t3); font-weight: 500; }
.breadcrumb-item:hover { color: var(--t1); }
.breadcrumb-sep  { color: var(--t4); }
.breadcrumb-curr { color: var(--t1); font-weight: 600; }
.view-toggle { display: flex; gap: 2px; background: var(--well); border-radius: var(--r); padding: 2px; }
.view-toggle-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 4px; color: var(--t3); cursor: pointer; transition: all .1s; }
.view-toggle-btn svg { width: 13px; height: 13px; }
.view-toggle-btn.active { background: var(--canvas); color: var(--t1); box-shadow: var(--sh-xs); }
.file-table-wrap { border: 1px solid var(--bd); border-top: none; border-radius: 0 0 var(--r-md) var(--r-md); overflow: hidden; }
.file-name-cell { display: flex; align-items: center; gap: 9px; }
.file-icon-wrap { width: 31px; height: 31px; border-radius: var(--r); background: var(--well); border: 1px solid var(--bd);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-icon-wrap svg { width: 14px; height: 14px; color: var(--t3); }
.file-name { font-size: .84rem; font-weight: 600; color: var(--t1); }
.file-meta { font-size: .71rem; color: var(--t3); margin-top: 1px; }
.dlp-badge { font-family: 'JetBrains Mono', monospace; font-size: .56rem; padding: 1px 6px; border-radius: 3px; font-weight: 600; text-transform: uppercase; }
.dlp-clean       { background: var(--green-bg); color: var(--green); }
.dlp-warning     { background: var(--amber-bg); color: var(--amber); }
.dlp-quarantined { background: var(--red-bg);   color: var(--red-dk); }

/* ══════════════════════════════════════════════════════════════
   EMPTY STATES
   ══════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 4.5rem 2rem; background: var(--canvas);
  border: 1px solid var(--bd); border-top: none; border-radius: 0 0 var(--r-md) var(--r-md);
}
.empty-icon { width: 48px; height: 48px; margin: 0 auto 1rem; background: var(--well); border: 1px solid var(--bd);
  border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; }
.empty-icon svg { width: 22px; height: 22px; color: var(--t4); }
.empty-state h3 { font-family: 'Space Grotesk', sans-serif; font-size: 1rem; font-weight: 600; color: var(--t1); margin-bottom: .4rem; }
.empty-state p  { color: var(--t3); font-size: .83rem; margin-bottom: 1.25rem; }

/* ══════════════════════════════════════════════════════════════
   AUTH PAGES
   ══════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh; display: flex; background: var(--sb);
  background-image: radial-gradient(ellipse 70% 60% at 75% 50%, rgba(229,50,45,.07) 0%, transparent 60%);
}
.auth-panel {
  width: 440px; flex-shrink: 0; background: var(--canvas);
  display: flex; flex-direction: column; box-shadow: var(--sh-xl);
}
.auth-panel-header { padding: 2.25rem 2.5rem 2rem; border-bottom: 1px solid var(--bd); }
.auth-logo-wrap  { display: flex; align-items: center; gap: 11px; margin-bottom: 1.5rem; }
.auth-logo-icon  { flex-shrink: 0; }
.auth-logo-text  { font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; font-weight: 700; color: var(--t1); letter-spacing: -.02em; }
.auth-logo-text span { color: var(--red); }
.auth-tagline    { font-size: .84rem; color: var(--t3); line-height: 1.7; }
.auth-panel-body { padding: 2rem 2.5rem; flex: 1; overflow-y: auto; }
.auth-title      { font-family: 'Space Grotesk', sans-serif; font-size: 1.45rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--t1); letter-spacing: -.025em; }
.auth-subtitle   { font-size: .84rem; color: var(--t3); margin-top: -1.1rem; margin-bottom: 1.4rem; }
.auth-links      { display: flex; justify-content: space-between; margin-top: 1rem; flex-wrap: wrap; gap: .5rem; }
.auth-link       { font-size: .81rem; color: var(--t3); font-weight: 500; }
.auth-link:hover { color: var(--t1); }
.auth-panel-footer { padding: 1.25rem 2.5rem; border-top: 1px solid var(--bd); background: var(--tray); }
.auth-trust { display: flex; flex-wrap: wrap; gap: .4rem; }
.trust-item { font-family: 'JetBrains Mono', monospace; font-size: .56rem; letter-spacing: .06em;
  text-transform: uppercase; border: 1px solid var(--bd); color: var(--t4); padding: 2px 8px; border-radius: var(--r); }
.auth-splash { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 4rem 3.5rem; }
.auth-splash h2 {
  font-family: 'Space Grotesk', sans-serif; font-size: 2.3rem; font-weight: 700;
  color: #FFFFFF; line-height: 1.2; letter-spacing: -.04em; margin-bottom: .9rem;
}
.auth-splash h2 em { color: var(--red); font-style: normal; }
.auth-splash p { color: rgba(255,255,255,.33); font-size: .88rem; line-height: 1.85; max-width: 380px; }
.auth-features { display: flex; flex-direction: column; gap: 1.1rem; margin-top: 2.5rem; max-width: 380px; }
.auth-feature  { display: flex; gap: 13px; align-items: flex-start; }
.auth-feature-icon {
  width: 34px; height: 34px; flex-shrink: 0; border: 1px solid rgba(229,50,45,.2);
  border-radius: var(--r); display: flex; align-items: center; justify-content: center;
  background: rgba(229,50,45,.1);
}
.auth-feature-icon svg { width: 15px; height: 15px; color: var(--red); }
.auth-feature-text h4 { font-family: 'Space Grotesk', sans-serif; font-size: .82rem; font-weight: 600; color: #fff; margin-bottom: 2px; }
.auth-feature-text p  { font-size: .76rem; color: rgba(255,255,255,.3); line-height: 1.5; }

/* ══════════════════════════════════════════════════════════════
   PLANS
   ══════════════════════════════════════════════════════════════ */
.plans-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.1rem; }
.plan-card {
  border: 1px solid var(--bd); background: var(--canvas); border-radius: var(--r-md);
  padding: 1.75rem; position: relative; transition: box-shadow .18s, transform .15s;
}
.plan-card:hover { box-shadow: var(--sh); transform: translateY(-2px); }
.plan-card.featured { background: var(--sb); border-color: rgba(229,50,45,.25); box-shadow: var(--sh-lg); }
.plan-card.current { border: 2px solid var(--red); box-shadow: 0 0 0 3px var(--red-glow); }
.plan-featured-label {
  position: absolute; top: -1px; right: 1.3rem; background: var(--red); color: #fff;
  font-family: 'JetBrains Mono', monospace; font-size: .6rem; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase; padding: 3px 10px; border-radius: 0 0 var(--r) var(--r);
}
.plan-tier { font-family: 'JetBrains Mono', monospace; font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--t3); margin-bottom: 1rem; }
.plan-card.featured .plan-tier { color: rgba(255,255,255,.3); }
.plan-price { font-family: 'Space Grotesk', sans-serif; font-size: 2.75rem; font-weight: 700; line-height: 1; margin-bottom: .3rem; letter-spacing: -.04em; color: var(--t1); }
.plan-card.featured .plan-price { color: #fff; }
.plan-price-currency { font-size: 1.3rem; vertical-align: top; margin-top: 7px; display: inline-block; }
.plan-price-period { font-size: .9rem; font-weight: 500; color: var(--t3); }
.plan-card.featured .plan-price-period { color: rgba(255,255,255,.35); }
.plan-features { list-style: none; margin: 1.4rem 0; display: flex; flex-direction: column; gap: .6rem; }
.plan-features li { font-size: .83rem; color: var(--t2); display: flex; gap: 8px; align-items: flex-start; }
.plan-card.featured .plan-features li { color: rgba(255,255,255,.6); }
.plan-features li svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--green); margin-top: 1px; }
.plan-card.featured .plan-features li svg { color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   COMPLIANCE / ADMIN
   ══════════════════════════════════════════════════════════════ */
.compliance-tabs { display: flex; border-bottom: 1px solid var(--bd); margin-bottom: 1.5rem; }
.compliance-tab { padding: .7rem 1.2rem; font-size: .82rem; font-weight: 600; color: var(--t3);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .13s;
  background: none; border-top: none; border-left: none; border-right: none; }
.compliance-tab:hover { color: var(--t1); }
.compliance-tab.active { color: var(--red); border-bottom-color: var(--red); }
.compliance-panel { display: none; }
.compliance-panel.active { display: block; }
.compliance-check {
  display: flex; align-items: flex-start; gap: .9rem; padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bd-lt); transition: background .1s;
}
.compliance-check:last-child { border-bottom: none; }
.compliance-check:hover { background: var(--tray); }
.check-status-icon { width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.check-status-icon svg { width: 10px; height: 10px; }
.check-pass    { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-bd); }
.check-fail    { background: var(--red-bg);   color: var(--red-dk); border: 1px solid var(--red-bd); }
.check-warning { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-bd); }
.check-manual  { background: var(--well); color: var(--t3); border: 1px solid var(--bd); }
.check-name    { font-size: .84rem; font-weight: 600; color: var(--t1); }
.check-notes   { font-size: .77rem; color: var(--t3); margin-top: 2px; }
.compliance-score {
  display: flex; align-items: center; gap: 1.4rem; padding: 1.4rem;
  background: var(--sb); border-radius: var(--r-md); margin-bottom: 1.4rem;
  border: 1px solid rgba(229,50,45,.15);
}
.score-ring { width: 72px; height: 72px; flex-shrink: 0; }
.score-details h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.05rem; color: #fff; }
.score-details p  { font-size: .79rem; color: rgba(255,255,255,.35); margin-top: 3px; }
.sev-badge { font-family: 'JetBrains Mono', monospace; font-size: .58rem; text-transform: uppercase; padding: 2px 7px; border-radius: var(--r); font-weight: 600; }
.sev-info     { background: var(--blue-bg);  color: var(--blue);  border: 1px solid var(--blue-bd); }
.sev-warning  { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-bd); }
.sev-critical { background: var(--red-bg);   color: var(--red-dk);border: 1px solid var(--red-bd); }

/* ══════════════════════════════════════════════════════════════
   NOTIFICATIONS
   ══════════════════════════════════════════════════════════════ */
.notif-panel { position: fixed; right: 1rem; top: calc(var(--hh) + .5rem); width: 340px;
  background: var(--canvas); border: 1px solid var(--bd); border-radius: var(--r-md);
  box-shadow: var(--sh-xl); z-index: 400; display: none; max-height: 70vh; overflow-y: auto; }
.notif-panel.open { display: block; animation: _dd .14s ease; }
.notif-panel-header { padding: .8rem 1.1rem; border-bottom: 1px solid var(--bd);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--canvas); }
.notif-item { display: flex; gap: 10px; padding: .85rem 1.1rem; border-bottom: 1px solid var(--bd-lt); cursor: pointer; transition: background .1s; }
.notif-item:hover  { background: var(--tray); }
.notif-item.unread { background: var(--red-bg); }
.notif-dot-item { width: 6px; height: 6px; border-radius: 50%; background: var(--red); flex-shrink: 0; margin-top: 6px; }
.notif-dot-item.read { background: transparent; border: 1.5px solid var(--bd-dk); }
.notif-content { flex: 1; min-width: 0; }
.notif-title   { font-size: .83rem; font-weight: 600; color: var(--t1); }
.notif-msg     { font-size: .75rem; color: var(--t3); margin-top: 2px; }
.notif-time    { font-family: 'JetBrains Mono', monospace; font-size: .62rem; color: var(--t4); margin-top: 3px; }

/* ══════════════════════════════════════════════════════════════
   ADMIN SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.admin-sidebar { width: var(--sb-w); background: var(--sb); border-right: 1px solid var(--sb-border);
  position: sticky; top: var(--hh); height: calc(100vh - var(--hh));
  overflow-y: auto; display: flex; flex-direction: column; padding: .75rem 0; }
.admin-sidebar::-webkit-scrollbar { width: 0; }
.admin-sidebar-label { font-family: 'JetBrains Mono', monospace; font-size: .53rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--sb-muted); padding: .85rem .9rem .3rem; display: block; }
.admin-sidebar-link { display: flex; align-items: center; gap: 9px; padding: 6.5px 9px; margin: 0 .6rem;
  font-size: .83rem; font-weight: 500; color: var(--sb-dim);
  text-decoration: none; border-radius: var(--r); transition: all .12s; }
.admin-sidebar-link svg { width: 15px; height: 15px; flex-shrink: 0; }
.admin-sidebar-link:hover { color: var(--sb-hi); background: var(--sb-hover); text-decoration: none; }
.admin-sidebar-link.active { color: #fff; background: var(--sb-active); font-weight: 600; box-shadow: inset 3px 0 0 var(--red); padding-left: 6px; }
.admin-sidebar-link.active svg { color: var(--red); }
.admin-sidebar-divider { border-top: 1px solid var(--sb-border); margin: .5rem .9rem; }
.admin-header-bar { background: var(--red-bg); border-bottom: 1px solid var(--red-bd);
  padding: 5px 2rem; font-family: 'JetBrains Mono', monospace; font-size: .58rem;
  letter-spacing: .08em; color: var(--red-dk); text-transform: uppercase;
  display: flex; align-items: center; gap: 6px; }
.admin-header-bar svg { width: 11px; height: 11px; }

/* ── Search bar ──────────────────────────────────────────────── */
.search-bar { position: relative; display: flex; align-items: center; }
.search-bar svg { position: absolute; left: 9px; width: 14px; height: 14px; color: var(--t3); pointer-events: none; }
.search-bar input { height: 35px; padding: 0 11px 0 31px; border: 1px solid var(--bd);
  background: var(--canvas); color: var(--t1); font-size: .83rem;
  border-radius: var(--r); outline: none; transition: all .14s; width: 100%; }
.search-bar input:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .plans-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  :root { --sb-w: 0px; }
  .sidebar, .admin-sidebar { display: none; }
  .main-content { padding: 1.25rem; }
  .plans-grid { grid-template-columns: 1fr; max-width: 380px; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .auth-page { flex-direction: column; }
  .auth-panel { width: 100%; }
  .auth-splash { display: none; }
  .header-search { max-width: 180px; }
}

/* ══════════════════════════════════════════════════════════════
   DASHBOARD — file manager specific classes
   ══════════════════════════════════════════════════════════════ */

/* Layout aliases */
.app-shell { display: grid; grid-template-columns: var(--sb-w) 1fr; min-height: 100vh; padding-top: var(--hh); }
.main-area { min-width: 0; display: flex; flex-direction: column; }

/* Flash bar */
.flash-bar { border-radius: 0; border-left: none; border-right: none; border-top: none; margin: 0; }

/* Toolbar */
.content-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1.5rem; background: var(--canvas);
  border-bottom: 1px solid var(--bd); gap: .75rem; flex-wrap: wrap; flex-shrink: 0;
}
.toolbar-breadcrumbs { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.toolbar-actions     { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }

.crumb {
  font-size: .83rem; font-weight: 500; color: var(--t3);
  text-decoration: none; white-space: nowrap;
  transition: color .12s;
}
.crumb:hover { color: var(--t1); }
.crumb.active { color: var(--t1); font-weight: 600; }
.crumb-sep   { color: var(--t4); font-size: .8rem; }

.tb-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 31px; padding: 0 13px; font-size: .8rem; font-weight: 600;
  background: var(--canvas); color: var(--t2);
  border: 1px solid var(--bd); border-radius: var(--r);
  cursor: pointer; transition: all .12s; white-space: nowrap;
}
.tb-btn:hover { background: var(--tray); border-color: var(--bd-dk); color: var(--t1); }
.tb-btn svg  { width: 13px; height: 13px; flex-shrink: 0; }

.vt-btn {
  width: 29px; height: 29px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 6px; color: var(--t3);
  cursor: pointer; transition: all .1s;
}
.vt-btn svg { width: 14px; height: 14px; }
.vt-btn.active { background: var(--canvas); color: var(--t1); box-shadow: var(--sh-xs); }

/* File area */
.file-area { flex: 1; padding: 1.25rem 1.5rem; overflow-y: auto; }
.file-section-label {
  font-family: 'JetBrains Mono', monospace; font-size: .6rem;
  text-transform: uppercase; letter-spacing: .1em; color: var(--t4);
  margin-bottom: .6rem; margin-top: .5rem; display: block;
}

/* Grid layout */
.frow2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; margin-bottom: 1rem; }

/* Folder card */
.folder-card {
  display: flex; flex-direction: column; align-items: flex-start;
  background: var(--canvas); border: 1px solid var(--bd); border-radius: var(--r-md);
  padding: 1rem 1.1rem; cursor: pointer; transition: all .13s;
  text-decoration: none; color: var(--t1);
}
.folder-card:hover { border-color: var(--bd-dk); box-shadow: var(--sh-sm); transform: translateY(-1px); text-decoration: none; color: var(--t1); }
.folder-icon { width: 36px; height: 36px; border-radius: var(--r); background: var(--red-bg); border: 1px solid var(--red-bd);
  display: flex; align-items: center; justify-content: center; margin-bottom: .7rem; flex-shrink: 0; }
.folder-icon svg { width: 18px; height: 18px; color: var(--red); }

/* File card (grid view) */
.file-card {
  background: var(--canvas); border: 1px solid var(--bd); border-radius: var(--r-md);
  padding: .9rem 1rem; cursor: pointer; position: relative;
  transition: all .13s; display: flex; flex-direction: column; gap: .5rem;
}
.file-card:hover { border-color: var(--bd-dk); box-shadow: var(--sh-sm); transform: translateY(-1px); }
.fc-icon { width: 34px; height: 34px; border-radius: var(--r); background: var(--well); border: 1px solid var(--bd);
  display: flex; align-items: center; justify-content: center; }
.fc-icon svg { width: 16px; height: 16px; color: var(--t3); }
.fc-name { font-size: .83rem; font-weight: 600; color: var(--t1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-meta { font-size: .71rem; color: var(--t3); display: flex; gap: .4rem; flex-wrap: wrap; }
.fc-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fc-actions { display: flex; align-items: center; gap: 3px; margin-left: auto; flex-shrink: 0; }
.fc-select { position: absolute; top: .6rem; left: .6rem; }
.file-select-cb { width: 14px; height: 14px; accent-color: var(--red); cursor: pointer; }

/* List row */
.fg { display: flex; align-items: center; padding: 8px 1rem; border-bottom: 1px solid var(--bd-lt);
  background: var(--canvas); gap: .75rem; transition: background .08s; cursor: pointer; }
.fg:hover { background: var(--tray); }
.fg:last-child { border-bottom: none; }
.fg-check { flex-shrink: 0; }
.fa-btn { width: 27px; height: 27px; display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid transparent; border-radius: var(--r);
  cursor: pointer; color: var(--t4); transition: all .1s; flex-shrink: 0; }
.fa-btn svg { width: 13px; height: 13px; }
.fa-btn:hover { background: var(--well); border-color: var(--bd); color: var(--t2); }
.fa-more { }
.fa-star { }
.fa-star.starred svg { color: var(--red); }
.shared-badge { font-family: 'JetBrains Mono', monospace; font-size: .59rem; color: var(--t4); }

/* Context menu */
.ctx-menu {
  position: fixed; background: var(--canvas); border: 1px solid var(--bd);
  border-radius: var(--r-md); box-shadow: var(--sh-xl); z-index: 500;
  min-width: 180px; padding: 4px; display: none;
}
.ctx-menu.open { display: block; animation: _dd .12s ease; }
.ctx-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px;
  font-size: .82rem; font-weight: 500; color: var(--t2);
  border-radius: var(--r); cursor: pointer; transition: background .08s;
  border: none; background: none; width: 100%; text-align: left;
}
.ctx-item svg { width: 13px; height: 13px; color: var(--t4); flex-shrink: 0; }
.ctx-item:hover { background: var(--tray); color: var(--t1); }
.ctx-danger { color: var(--red); }
.ctx-danger svg { color: var(--red-bd); }
.ctx-danger:hover { background: var(--red-bg); color: var(--red); }
.ctx-sep { border-top: 1px solid var(--bd-lt); margin: 4px 0; }

/* Modal variants */
.modal-box { background: var(--canvas); border-radius: var(--r-lg); border: 1px solid var(--bd);
  box-shadow: var(--sh-xl); width: 100%; max-width: 540px; max-height: 90vh;
  display: flex; flex-direction: column; animation: _mi .16s ease; }
.modal-sm  { max-width: 400px; }
.modal-md  { max-width: 540px; }
.modal-hdr { display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.3rem; border-bottom: 1px solid var(--bd); flex-shrink: 0; }
.modal-hdr .modal-title { font-family: 'Space Grotesk', sans-serif; font-size: .95rem; font-weight: 700; color: var(--t1); }
.modal-sub  { font-size: .8rem; color: var(--t3); margin-top: 2px; }
.modal-x    { width: 27px; height: 27px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--r); color: var(--t4); cursor: pointer; transition: all .12s; }
.modal-x svg { width: 13px; height: 13px; }
.modal-x:hover { background: var(--well); color: var(--t1); }

/* Share */
.share-tabs { display: flex; border-bottom: 1px solid var(--bd); margin-bottom: 1rem; }
.stab { padding: .6rem 1rem; font-size: .82rem; font-weight: 600; color: var(--t3);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .13s; background: none; border-top: none; border-left: none; border-right: none; }
.stab:hover { color: var(--t1); }
.stab.active { color: var(--red); border-bottom-color: var(--red); }

.share-link-row { display: flex; gap: .5rem; }
.share-result-box { background: var(--tray); border: 1px solid var(--bd); border-radius: var(--r);
  padding: .7rem .9rem; font-family: 'JetBrains Mono', monospace; font-size: .73rem;
  color: var(--t1); word-break: break-all; }
.share-result-actions { display: flex; gap: .5rem; margin-top: .6rem; }
.upload-link { color: var(--red); font-weight: 600; cursor: pointer; font-size: .83rem; }

/* Preview */
.preview-area { flex: 1; overflow: auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--well); border-radius: 0 0 var(--r-md) var(--r-md); }

/* Empty state (dashboard variant) */
.es-icon { width: 52px; height: 52px; margin: 0 auto 1rem; background: var(--well); border: 1px solid var(--bd);
  border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; }
.es-icon svg { width: 24px; height: 24px; color: var(--t4); }
