/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ══════════════════════════════════════════════════════════════
   CERTANO BRAND SYSTEM — Font declarations & design tokens
   Ready for use when Figma designs are implemented.
   See docs/BRAND_STANDARDS.md for full usage reference.
   ══════════════════════════════════════════════════════════════ */

/* ── Brand Fonts: Aeonik Pro (Primary — Display/Headlines) ──── */
@font-face { font-family: 'Aeonik Pro'; src: url('01_Primary Typeface/AeonikPro-Air.otf') format('opentype'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'Aeonik Pro'; src: url('01_Primary Typeface/AeonikPro-AirItalic.otf') format('opentype'); font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: 'Aeonik Pro'; src: url('01_Primary Typeface/AeonikPro-Thin.otf') format('opentype'); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: 'Aeonik Pro'; src: url('01_Primary Typeface/AeonikPro-ThinItalic.otf') format('opentype'); font-weight: 200; font-style: italic; font-display: swap; }
@font-face { font-family: 'Aeonik Pro'; src: url('01_Primary Typeface/AeonikPro-Light.otf') format('opentype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Aeonik Pro'; src: url('01_Primary Typeface/AeonikPro-LightItalic.otf') format('opentype'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Aeonik Pro'; src: url('01_Primary Typeface/AeonikPro-Regular.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Aeonik Pro'; src: url('01_Primary Typeface/AeonikPro-RegularItalic.otf') format('opentype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Aeonik Pro'; src: url('01_Primary Typeface/AeonikPro-Medium.otf') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Aeonik Pro'; src: url('01_Primary Typeface/AeonikPro-MediumItalic.otf') format('opentype'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Aeonik Pro'; src: url('01_Primary Typeface/AeonikPro-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Aeonik Pro'; src: url('01_Primary Typeface/AeonikPro-BoldItalic.otf') format('opentype'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Aeonik Pro'; src: url('01_Primary Typeface/AeonikPro-Black.otf') format('opentype'); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Aeonik Pro'; src: url('01_Primary Typeface/AeonikPro-BlackItalic.otf') format('opentype'); font-weight: 900; font-style: italic; font-display: swap; }

/* ── Brand Fonts: Inter (Secondary — Body/UI) ────────────────── */
@font-face { font-family: 'Inter'; src: url('02_Secondary Typeface/Inter_18pt-Thin.ttf') format('truetype'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('02_Secondary Typeface/Inter_18pt-ExtraLight.ttf') format('truetype'); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('02_Secondary Typeface/Inter_18pt-Light.ttf') format('truetype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('02_Secondary Typeface/Inter_18pt-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('02_Secondary Typeface/Inter_18pt-Italic.ttf') format('truetype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('02_Secondary Typeface/Inter_18pt-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('02_Secondary Typeface/Inter_18pt-SemiBold.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('02_Secondary Typeface/Inter_18pt-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('02_Secondary Typeface/Inter_18pt-ExtraBold.ttf') format('truetype'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('02_Secondary Typeface/Inter_18pt-Black.ttf') format('truetype'); font-weight: 900; font-style: normal; font-display: swap; }

/* ── Brand Fonts: Space Grotesk (Tertiary — Labels/CTAs) ─────── */
@font-face { font-family: 'Space Grotesk'; src: url('03_Tertiary Typeface/SpaceGrotesk-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('03_Tertiary Typeface/SpaceGrotesk-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }

/* ── Brand Design Tokens ─────────────────────────────────────── */
:root {
  /* Primary palette (from brand book p.14) */
  --c-cyan:       #07B6E5;
  --c-cyan-light: #7DD8F0;
  --c-cyan-dark:  #0590B8;
  --c-gold:       #FFB942;
  --c-gold-light: #FEDD99;
  --c-copper:     #AF7246;
  --c-silver:     #95A0A3;
  --c-parchment:  #DADDCC;
  --c-midnight:   #964800;
  --c-obsidian:   #1B242B;

  /* Functional tokens (for when Figma is applied) */
  --c-text:        #1B242B;
  --c-text-muted:  #6b7280;
  --c-bg:          #f7f8fa;
  --c-bg-card:     #ffffff;
  --c-border:      #E4E4E7;
  --c-link:        #07B6E5;
  --c-success:     #065f46;
  --c-success-bg:  #d1fae5;
  --c-danger:      #991b1b;
  --c-danger-bg:   #fee2e2;

  /* Font stacks (from brand book p.20-26) */
  --font-display:  'Aeonik Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-label:    'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;

  /* ── Themeable tokens (Light mode defaults) ──────────────────── */
  --t-bg:              #f7f8fa;
  --t-bg-card:         #ffffff;
  --t-bg-sidebar:      #ffffff;
  --t-bg-hover:        #F4F4F5;
  --t-bg-input:        #ffffff;
  --t-bg-alt:          #F9FAFB;
  --t-bg-badge-green:  #D1FAE5;
  --t-bg-badge-red:    #FEE2E2;
  --t-bg-badge-yellow: #FEF3C7;
  --t-bg-badge-blue:   #DBEAFE;
  --t-bg-badge-gray:   #F3F4F6;
  --t-text:            #18181B;
  --t-text-secondary:  #494949;
  --t-text-muted:      #71717A;
  --t-text-faint:      #9CA3AF;
  --t-border:          #E4E4E7;
  --t-border-light:    #F4F4F5;
  --t-border-sidebar:  #f0f0f0;
  --t-shadow:          rgba(0, 13, 18, 0.15);
  --t-shadow-card:     0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --t-overlay:         rgba(0, 0, 0, 0.5);
}

/* ── Dark Mode ─────────────────────────────────────────────── */
[data-theme="dark"] {
  --t-bg:              #0f1419;
  --t-bg-card:         #1B242B;
  --t-bg-sidebar:      #151d24;
  --t-bg-hover:        #253038;
  --t-bg-input:        #1B242B;
  --t-bg-alt:          #151d24;
  --t-bg-badge-green:  rgba(22, 163, 74, 0.2);
  --t-bg-badge-red:    rgba(220, 38, 38, 0.2);
  --t-bg-badge-yellow: rgba(217, 119, 6, 0.2);
  --t-bg-badge-blue:   rgba(30, 64, 175, 0.2);
  --t-bg-badge-gray:   rgba(113, 113, 122, 0.15);
  --t-text:            #E4E4E7;
  --t-text-secondary:  #A1A1AA;
  --t-text-muted:      #A1A1AA;
  --t-text-faint:      #71717A;
  --t-border:          #2d3a44;
  --t-border-light:    #253038;
  --t-border-sidebar:  #253038;
  --t-shadow:          rgba(0, 0, 0, 0.4);
  --t-shadow-card:     0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px -1px rgba(0, 0, 0, 0.2);
  --t-overlay:         rgba(0, 0, 0, 0.7);

  /* Override brand functional tokens for dark */
  --c-text:        #E4E4E7;
  --c-text-muted:  #A1A1AA;
  --c-bg:          #0f1419;
  --c-bg-card:     #1B242B;
  --c-border:      #2d3a44;
  --c-success:     #4ade80;
  --c-success-bg:  rgba(22, 163, 74, 0.2);
  --c-danger:      #f87171;
  --c-danger-bg:   rgba(220, 38, 38, 0.2);

  color-scheme: dark;
}

/* ══════════════════════════════════════════════════════════════ */

/* ── Reset & base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--t-text);
  background: var(--t-bg);
  line-height: 1.6;
  transition: background 0.25s, color 0.25s;
}

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

/* ── Layout ──────────────────────────────────────────────────── */
.site-header {
  background: var(--c-obsidian);
  color: #fff;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.site-header .brand { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--c-gold); letter-spacing: .04em; }
.site-header nav { display: flex; align-items: center; }
.site-header nav a { font-family: var(--font-label); color: #ccc; margin-left: 1.5rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.site-header nav a:hover { color: #fff; text-decoration: none; }
.site-header nav form { display: inline; margin-left: 1.5rem; }

.site-main {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* ── Flash ───────────────────────────────────────────────────── */
.flash { padding: .75rem 1.25rem; border-radius: 6px; margin-bottom: 1.25rem; font-size: .9rem; }
.flash.notice { background: var(--t-bg-badge-green); color: var(--c-success); border: 1px solid rgba(22,163,74,.25); }
.flash.alert  { background: var(--t-bg-badge-red); color: var(--c-danger); border: 1px solid rgba(220,38,38,.25); }
.kyc-alert-banner { padding: .75rem 1.25rem; border-radius: 6px; margin-bottom: 1.25rem; font-size: .9rem; background: var(--t-bg-badge-yellow); color: #d97706; border: 1px solid rgba(217,119,6,.25); }
.kyc-alert-banner a { color: #d97706; font-weight: 600; text-decoration: underline; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--t-bg-card);
  border-radius: 10px;
  box-shadow: var(--t-shadow-card);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.page-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--t-text); }
.section-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin-bottom: .75rem; color: var(--t-text-secondary); }

/* ── Tables ──────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .9rem; text-align: left; border-bottom: 1px solid var(--t-border); }
th { background: var(--t-bg-alt); font-weight: 600; font-size: .82rem; color: var(--t-text-muted); text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--t-bg-alt); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: .45rem 1rem;
  border-radius: 6px;
  font-family: var(--font-label);
  font-size: .82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity .15s;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary   { background: var(--c-cyan); color: #fff; }
.btn-secondary { background: var(--c-silver); color: #fff; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-gold      { background: var(--c-gold); color: var(--c-obsidian); font-weight: 700; }
.btn-sm        { padding: .3rem .7rem; font-size: .8rem; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: .3rem; font-size: .9rem; color: var(--t-text); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--t-border);
  border-radius: 6px;
  font-size: .95rem;
  outline: none;
  transition: border-color .15s;
  background: var(--t-bg-input);
  color: var(--t-text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--c-cyan); box-shadow: 0 0 0 3px rgba(7,182,229,.15); }
.form-hint { font-size: .8rem; color: var(--t-text-muted); margin-top: .25rem; }
.checkbox-group { display: flex; flex-direction: column; gap: .4rem; margin-top: .25rem; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 400; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; border-radius: 4px; cursor: pointer; }
.checkbox-label input[type="radio"] { width: 16px; height: 16px; cursor: pointer; }
.field_with_errors input { border-color: #dc2626; }
.error-message { color: #dc2626; font-size: .82rem; margin-top: .25rem; }

/* ── Auth forms ──────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, var(--c-obsidian) 0%, #0d1820 100%);
}
.auth-box {
  background: var(--t-bg-card);
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px var(--t-shadow);
}
.auth-logo { text-align: center; margin-bottom: 1.75rem; }
.auth-logo h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--t-text); letter-spacing: .06em; }
.auth-logo p { font-family: var(--font-body); color: var(--t-text-muted); font-size: .9rem; margin-top: .25rem; }
.auth-box .btn-primary { width: 100%; text-align: center; padding: .65rem; font-size: 1rem; margin-top: .25rem; font-family: var(--font-label); text-transform: uppercase; letter-spacing: .04em; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: .85rem; color: var(--t-text-muted); }

/* ── Products grid ───────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.product-card {
  background: var(--t-bg-card);
  border-radius: 10px;
  box-shadow: var(--t-shadow-card);
  padding: 1.25rem 1.5rem;
  border: 2px solid transparent;
  transition: border-color .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover { border-color: var(--c-gold); box-shadow: 0 4px 16px rgba(255,185,66,.2); text-decoration: none; }
.product-card h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; margin-bottom: .25rem; color: var(--t-text); }
.product-card .meta { font-size: .82rem; color: var(--t-text-muted); margin-bottom: .75rem; flex: 1; }
.product-card .card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.badge-green  { background: var(--t-bg-badge-green); color: var(--c-success); }
.badge-red    { background: var(--t-bg-badge-red); color: var(--c-danger); }
.badge-yellow { background: var(--t-bg-badge-yellow); color: #d97706; }
.badge-blue   { background: var(--t-bg-badge-blue); color: #3b82f6; }
.badge-gray   { background: var(--t-bg-badge-gray); color: var(--t-text-muted); }
.badge-gold   { background: var(--t-bg-badge-yellow); color: #d97706; }

/* ── Admin sidebar layout (legacy — kept for non-admin-body pages) ── */
.admin-content { flex: 1; padding: 2rem; overflow-x: auto; }

/* ── Stat cards ──────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--t-bg-card); border-radius: 10px; padding: 1.25rem 1.5rem; box-shadow: var(--t-shadow-card); }
.stat-card .stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--t-text); }
.stat-card .stat-label { font-size: .8rem; color: var(--t-text-muted); margin-top: .1rem; }

/* ── Utilities ───────────────────────────────────────────────── */
.text-muted { color: var(--t-text-muted); }
.text-sm    { font-size: .85rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-sm { gap: .5rem; display: flex; }
.empty-state { text-align: center; padding: 3rem 1rem; color: #9ca3af; }
.empty-state p { font-size: 1rem; }
dl.detail-list dt { font-size: .8rem; color: var(--t-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 1rem; }
dl.detail-list dd { font-size: 1rem; color: var(--t-text); }

/* ── Hamburger toggle ────────────────────────────────────────── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: .2rem .4rem;
  line-height: 1;
  margin-left: auto;
}

/* ── Responsive — tablet/mobile ──────────────────────────────── */
@media (max-width: 768px) {
  .site-header {
    flex-wrap: wrap;
    height: auto;
    padding: .75rem 1rem;
  }

  .nav-toggle { display: block; }

  .site-header nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: .5rem 0 .75rem;
    border-top: 1px solid rgba(255,255,255,.12);
    margin-top: .5rem;
    gap: 0;
  }
  .site-header nav.open { display: flex; }

  .site-header nav a {
    margin-left: 0;
    padding: .45rem 0;
    font-size: 1rem;
    width: 100%;
  }

  .site-header nav form {
    display: block;
    margin-left: 0;
    width: 100%;
  }
  .site-header nav form button {
    font-size: 1rem !important;
    padding: .45rem 0 !important;
    color: #ccc !important;
    text-align: left;
    width: 100%;
  }

  .site-main { margin: 1rem auto; padding: 0 1rem; }

  .products-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }


  /* Tables scroll on small screens */
  .card { overflow-x: auto; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .auth-wrapper { padding: 0.75rem; }
  .auth-box { padding: 1.75rem 1.25rem; border-radius: 8px; }
  .auth-logo h1 { font-size: 1.6rem; }
  .product-card { padding: 1rem; }
  .page-title { font-size: 1.3rem; }
}

/* ══════════════════════════════════════════════════════════════
   ADMIN UI — Redesigned dashboard matching Certano mockups
   ══════════════════════════════════════════════════════════════ */

.admin-body { background: var(--t-bg); }

/* ── Admin Layout ────────────────────────────────────────────── */
.admin-body .admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-body .admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--t-bg-sidebar);
  border-right: none;
  box-shadow: 8px 0 29.5px 0 var(--t-shadow);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar-brand {
  padding: 16.5px 1.5rem;
  border-bottom: 1px solid var(--t-border-sidebar);
  text-align: center;
}

.admin-brand-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--c-obsidian);
  letter-spacing: -0.02em;
  line-height: 32.93px;
  display: inline-block;
}

.admin-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.admin-nav-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.5rem;
  color: var(--t-text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  margin: 2px 0.75rem;
  width: calc(100% - 1.5rem);
  transition: all 0.15s;
  cursor: pointer;
  background: none;
  text-align: left;
}

.admin-nav-item:hover {
  color: var(--t-text);
  background: var(--t-bg-hover);
  text-decoration: none;
}

.admin-nav-item.active {
  color: var(--t-text);
  background: var(--t-bg-hover);
  font-weight: 600;
}

.admin-nav-item svg.admin-nav-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.admin-external-icon {
  width: 10px;
  height: 10px;
  margin-left: -4px;
  opacity: 0.5;
}

.admin-nav-button {
  border: none;
}

.admin-sidebar-footer {
  border-top: 1px solid var(--t-border-sidebar);
  padding: 0.5rem 0;
  margin-top: auto;
}

.admin-version {
  padding: 0.5rem 1.5rem;
  font-size: 0.72rem;
  color: var(--t-text-faint);
}

.admin-main {
  flex: 1;
  padding: 2rem 2.5rem;
  overflow-x: auto;
  min-width: 0;
}

/* ── Sidebar Toggle (hidden on desktop) ─────────────────────── */
.admin-sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  background: var(--t-bg-card);
  color: var(--t-text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-bottom: 1rem;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.admin-sidebar-overlay {
  display: none;
}

/* ── Admin Page Header ───────────────────────────────────────── */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.admin-page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--t-text);
  line-height: 30px;
  letter-spacing: -0.025em;
}

/* ── Time Filter ─────────────────────────────────────────────── */
.admin-time-filter select {
  padding: 0.45rem 2rem 0.45rem 0.85rem;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--t-text-secondary);
  background: var(--t-bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  appearance: none;
  cursor: pointer;
  font-weight: 500;
}

/* ── Stat Cards Row ──────────────────────────────────────────── */
.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stat-card {
  background: var(--t-bg-card);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  border: none;
  box-shadow: var(--t-shadow-card);
}

.admin-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.admin-stat-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--t-text);
  line-height: 23px;
  letter-spacing: 0;
}

.admin-stat-icon {
  color: var(--t-text-faint);
}

.admin-stat-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.admin-stat-value {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--t-text);
  line-height: 34px;
  letter-spacing: -0.025em;
}

.admin-stat-change {
  font-size: 12px;
  font-weight: 400;
  color: var(--t-text-muted);
  line-height: 16px;
  letter-spacing: 0;
  margin-top: 0.25rem;
}

.admin-stat-change.negative {
  color: #dc2626;
}

/* ── Dashboard Grid ──────────────────────────────────────────── */
.admin-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-dashboard-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.admin-dashboard-grid > .admin-card,
.admin-dashboard-grid-3 > .admin-card {
  min-width: 0;
  overflow: hidden;
}

/* ── Admin Cards ─────────────────────────────────────────────── */
.admin-card {
  background: var(--t-bg-card);
  border-radius: 12px;
  border: 1px solid var(--t-border);
  padding: 1.5rem;
  box-shadow: var(--t-shadow-card);
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.admin-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--t-text);
  line-height: 16px;
  letter-spacing: -0.025em;
}

/* ── Admin Tables ────────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.admin-table th {
  padding: 0 8px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: var(--t-text-muted);
  line-height: 22px;
  letter-spacing: 0;
  text-transform: none;
  border: none;
  border-bottom: 1px solid var(--t-border);
  background: transparent !important;
  height: 40px;
  white-space: nowrap;
}

.admin-table td {
  padding: 0 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--t-text);
  line-height: 22px;
  letter-spacing: 0;
  border: none;
  border-bottom: 1px solid var(--t-border);
  background: transparent;
  height: 44px;
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: var(--t-bg-hover);
}

.admin-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table-scroll .admin-table {
  min-width: 1000px;
}

.admin-table-scroll .admin-table td,
.admin-table-scroll .admin-table th {
  white-space: nowrap;
}

.admin-card-table {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--t-border);
}

/* ── Chart Time Range Tabs ───────────────────────────────────── */
.admin-chart-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--t-bg-hover);
  border-radius: 6px;
  padding: 2px;
}

.admin-chart-tab {
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--t-text-muted);
  border-radius: 5px;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.15s;
}

.admin-chart-tab:hover {
  color: var(--t-text-secondary);
}

.admin-chart-tab.active {
  background: var(--t-bg-card);
  color: var(--t-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ── Tokens Card Layout ───────────────────────────────────────── */
.admin-tokens-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1rem;
  padding: 1.5rem;
}

.admin-tokens-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
}

.admin-tokens-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-donut-chart {
  width: 160px;
  height: 160px;
  position: relative;
}

.admin-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.admin-donut-center-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--t-text);
  line-height: 1.2;
}

.admin-donut-center-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--t-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: auto;
}

.admin-donut-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 14px;
  font-weight: 400;
  color: var(--t-text);
  line-height: 22px;
}

.admin-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Search & Filter Bar ─────────────────────────────────────── */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--t-bg-card);
  border: 1px solid var(--t-border);
  border-radius: 6px;
  padding: 0 0.75rem;
  height: 42px;
  flex: 1;
  min-width: 200px;
}

.admin-search svg {
  width: 16px;
  height: 16px;
  color: var(--t-text-faint);
  flex-shrink: 0;
}

.admin-search input {
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--t-text);
  width: 100%;
  background: transparent;
  line-height: 22px;
}

.admin-search input::placeholder {
  color: var(--t-text-muted);
}

.admin-toolbar-filters {
  display: flex;
  gap: 10px;
}

.admin-filter-select {
  height: 40px;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid var(--t-border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--t-text);
  background: var(--t-bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  appearance: none;
  cursor: pointer;
  font-weight: 400;
  line-height: 22px;
  min-width: 120px;
  flex: 1;
}

/* ── Bulk Actions Bar ────────────────────────────────────────── */
.admin-bulk-bar {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}

.admin-bulk-bar.visible {
  display: flex;
}

.admin-bulk-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--t-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
}

.admin-bulk-action:hover {
  color: var(--t-text);
}

.admin-bulk-action svg {
  width: 14px;
  height: 14px;
}

/* ── Checkbox ────────────────────────────────────────────────── */
.admin-table-checkbox {
  width: 32px;
  padding-left: 1rem !important;
  padding-right: 0.5rem !important;
}

.admin-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--c-cyan);
}

/* ── Status Badge ────────────────────────────────────────────── */
.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  height: 22px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 22px;
  letter-spacing: 0;
  white-space: nowrap;
}

.admin-badge-active {
  background: var(--t-bg-badge-green);
  color: #16A34A;
}

.admin-badge-suspended {
  background: var(--t-bg-badge-gray);
  color: var(--t-text-muted);
}

.admin-badge-closed {
  background: var(--t-bg-badge-red);
  color: #DC2626;
}

.admin-badge-registered,
.admin-badge-email_verified,
.admin-badge-salesforce_synced {
  background: var(--t-bg-badge-yellow);
  color: #D97706;
}

/* ── Action Icons ────────────────────────────────────────────── */
.admin-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--t-text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.admin-action-btn:hover {
  background: var(--t-bg-hover);
  color: var(--t-text);
  text-decoration: none;
}

.admin-action-btn.danger {
  color: #DC2626;
}

.admin-action-btn.danger:hover {
  background: #FEE2E2;
  color: #DC2626;
}

.admin-action-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Inventory Stats ─────────────────────────────────────────── */
.admin-inventory-wrapper {
  margin-bottom: 1.5rem;
}

.admin-inventory-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 1rem;
}

.admin-inventory-card {
  background: var(--t-bg-card);
  border-radius: 12px;
  border: 1px solid var(--t-border);
  padding: 1.25rem 1.5rem;
  min-height: 129px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.admin-inventory-card .label {
  font-size: 14px;
  color: var(--t-text);
  font-weight: 500;
  line-height: 23px;
  margin-bottom: 0.25rem;
}

.admin-inventory-card .value {
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--t-text);
  line-height: 34px;
  letter-spacing: -0.025em;
}

.admin-inventory-card .subtitle {
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: var(--t-text-muted);
  margin-top: 0.25rem;
}

.admin-inventory-alert {
  background: var(--t-bg-badge-green);
  border: 1px solid rgba(22,163,74,.25);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: 130px;
}

.admin-inventory-alert-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  line-height: 0;
}

.admin-inventory-alert-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--t-text);
  line-height: 23px;
}

/* ── Chart Legend ─────────────────────────────────────────────── */
.admin-chart-legend {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.admin-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-chart-legend-color {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

.admin-chart-legend-label {
  font-size: 0.75rem;
  color: var(--t-text-faint);
}

.admin-chart-legend-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--t-text);
  margin-left: auto;
}

/* ── Products Page: Create Product Button ────────────────────── */
.admin-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  background: transparent;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--t-text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.admin-create-btn:hover {
  background: var(--t-bg-hover);
  border-color: var(--t-border);
  text-decoration: none;
}

.admin-create-btn svg {
  width: 14px;
  height: 14px;
}

/* ── Products Table Card ─────────────────────────────────────── */
.admin-products-table-card {
  padding: 0;
  overflow: hidden;
}

.admin-products-table-card .admin-card-header {
  padding: 1.25rem 1.5rem;
}

.admin-products-table .col-category {
  width: 30%;
  padding-left: 1.5rem !important;
}

.admin-products-table .col-unit { width: 8%; }
.admin-products-table .col-weight { width: 12%; }
.admin-products-table .col-type { width: 14%; }

.admin-products-table .col-number {
  text-align: right;
  width: 12%;
}

.admin-products-table .col-number:last-child {
  padding-right: 1.5rem !important;
}

.admin-products-table th,
.admin-products-table td {
  height: 52px;
  padding: 0 16px !important;
}

/* ── Chart Wrapper ───────────────────────────────────────────── */
.admin-chart-area {
  position: relative;
  height: 250px;
  width: 100%;
}

.admin-chart-area canvas {
  max-width: 100%;
}

.admin-chart-with-legend {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 1rem;
}

/* ── Responsive: Tablet (≤1024px) ────────────────────────────── */
@media (max-width: 1024px) {
  .admin-stats-row { grid-template-columns: repeat(2, 1fr); }
  .admin-dashboard-grid { grid-template-columns: 1fr; }
  .admin-dashboard-grid-3 { grid-template-columns: 1fr; }
  .admin-inventory-row { grid-template-columns: 1fr 1fr; }
  .admin-chart-with-legend { grid-template-columns: 1fr; }
  .admin-main { padding: 1.5rem; }

  .admin-tokens-card {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
  .admin-tokens-left { align-items: center; text-align: center; }
  .admin-donut-legend { align-items: center; }

  .admin-table { font-size: 13px; }
  .admin-table th,
  .admin-table td { padding: 10px 6px; }

  .admin-card-header { flex-wrap: wrap; gap: 0.5rem; }
}

/* ── Responsive: Mobile (≤768px) ─────────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar-toggle {
    display: flex;
  }

  .admin-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--t-overlay);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .admin-sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
  }

  .admin-body .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 8px 0 29.5px 0 var(--t-shadow);
  }

  .admin-body .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    padding: 1rem;
  }
  .admin-page-title { font-size: 1.25rem; }
  .admin-stats-row { grid-template-columns: 1fr; gap: 0.75rem; }
  .admin-stat-value { font-size: 1.5rem; }
  .admin-inventory-row { grid-template-columns: 1fr; }

  .admin-donut-chart { width: 130px; height: 130px; }
  .admin-donut-center-value { font-size: 1rem; }
  .admin-chart-area { height: 200px; }

  .admin-chart-tabs { flex-wrap: wrap; }
  .admin-chart-tab { font-size: 0.65rem; padding: 0.25rem 0.5rem; }

  .admin-toolbar {
    flex-direction: column;
    gap: 0.5rem;
  }
  .admin-search { width: 100%; max-width: none; }
  .admin-filter-select { width: 100%; }
  .admin-toolbar-filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    width: 100%;
  }
}

/* ── Responsive: Small Mobile (≤480px) ───────────────────────── */
@media (max-width: 480px) {
  .admin-main { padding: 0.75rem; }
  .admin-card { padding: 1rem; border-radius: 8px; }
  .admin-stat-card { padding: 1rem; border-radius: 8px; }
  .admin-stat-value { font-size: 1.25rem; line-height: 28px; }
  .admin-stat-label { font-size: 12px; }

  .admin-tokens-card { padding: 1rem; }
  .admin-donut-chart { width: 110px; height: 110px; }
  .admin-donut-center-value { font-size: 0.9rem; }
  .admin-donut-center-label { font-size: 0.5rem; }

  .admin-inventory-card .value { font-size: 1.35rem; }
  .admin-chart-area { height: 160px; }
}

/* ═══════════════════════════════════════════════════════════════
   USER DASHBOARD STYLES
   ═══════════════════════════════════════════════════════════════ */

.dashboard-body { background: var(--t-bg); }

/* ── Dashboard Layout ───────────────────────────────────────── */
.dashboard-body .dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.dashboard-body .dashboard-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--t-bg-sidebar);
  border-right: none;
  box-shadow: 8px 0 29.5px 0 var(--t-shadow);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.dashboard-sidebar-brand {
  padding: 16.5px 1.5rem;
  border-bottom: 1px solid var(--t-border-sidebar);
  text-align: center;
}

.dashboard-brand-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--c-obsidian);
  letter-spacing: -0.02em;
  line-height: 32.93px;
  display: inline-block;
}

.dashboard-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.dashboard-nav-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.5rem;
  color: var(--t-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  margin: 2px 0.75rem;
  width: calc(100% - 1.5rem);
  transition: all 0.15s;
  cursor: pointer;
  background: none;
  text-align: left;
  font-family: inherit;
}

.dashboard-nav-item:hover {
  color: var(--t-text);
  background: var(--t-bg-hover);
  text-decoration: none;
}

.dashboard-nav-item.active {
  color: var(--t-text);
  background: var(--t-bg-hover);
  font-weight: 600;
}

.dashboard-nav-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.dashboard-external-icon {
  width: 10px;
  height: 10px;
  margin-left: -4px;
  opacity: 0.5;
}

.dashboard-nav-button { border: none; }

.dashboard-sidebar-footer {
  border-top: 1px solid var(--t-border-sidebar);
  padding: 0.5rem 0;
  margin-top: auto;
}

.dashboard-version {
  padding: 0.5rem 1.5rem;
  font-size: 0.72rem;
  color: var(--t-text-faint);
}

.dashboard-main {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-x: auto;
  min-width: 0;
}

/* ── Dashboard Sidebar Toggle ───────────────────────────────── */
.dashboard-sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  background: var(--t-bg-card);
  color: var(--t-text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-bottom: 1rem;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

/* ── Dashboard Page Elements ────────────────────────────────── */
.dash-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.dash-page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--t-text);
  line-height: 30px;
  letter-spacing: -0.025em;
}

.dash-card {
  background: var(--t-bg-card);
  border-radius: 8px;
  border: 1px solid var(--t-border);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--t-shadow-card);
}

.dash-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--t-text);
  line-height: 16px;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-card-table {
  padding-left: 0;
  padding-right: 0;
}

.dash-card-table .dash-card-title {
  padding: 0 1.5rem;
}

.dash-card-table .dash-table td:first-child,
.dash-card-table .dash-table th:first-child {
  padding-left: 1.5rem;
}

.dash-card-table .dash-table td:last-child,
.dash-card-table .dash-table th:last-child {
  padding-right: 1.5rem;
}

/* ── Top Bar (Portfolio Summary) ────────────────────────────── */
.dash-top-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.dash-top-bar-stats {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.dash-top-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-top-stat-label {
  font-size: 12px;
  color: var(--t-text-muted);
}

.dash-top-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--t-text);
}

.dash-trade-btn {
  background: var(--c-cyan);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.5rem;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background 0.15s;
}

.dash-trade-btn:hover:not(:disabled) {
  background: var(--c-cyan-dark);
}

.dash-trade-btn:disabled {
  background: #9CA3AF;
  cursor: not-allowed;
  opacity: 0.7;
}

/* ── Time Filter ────────────────────────────────────────────── */
.dash-time-filter {
  margin-bottom: 1.25rem;
}

.dash-filter-select {
  height: 40px;
  border: 1px solid var(--t-border);
  border-radius: 6px;
  padding: 0 2rem 0 0.75rem;
  font-size: 14px;
  color: var(--t-text);
  background: var(--t-bg-hover) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%2371717A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  appearance: none;
  min-width: 140px;
}

/* ── Dashboard Tables ───────────────────────────────────────── */
.dash-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.dash-table th {
  padding: 0 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--t-text-muted);
  background: transparent;
  height: 40px;
  white-space: nowrap;
  text-transform: none;
  border: none;
  border-bottom: 1px solid var(--t-border);
}

.dash-table td {
  padding: 0 12px;
  font-size: 14px;
  font-weight: 400;
  color: var(--t-text);
  border: none;
  border-bottom: 1px solid var(--t-border);
  background: transparent;
  height: 48px;
  vertical-align: middle;
}

.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: var(--t-bg-hover); }

.dash-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-table-compact th {
  padding: 0 8px;
  height: 27px;
  font-size: 12px;
  border-bottom: 1px solid var(--t-border);
}

.dash-table-compact td {
  padding: 0 8px;
  height: 36px;
  font-size: 13px;
  border-bottom: 1px solid var(--t-border);
}

.dash-table-dense th {
  height: 28px;
  font-size: 12px;
  padding: 0 8px;
}

.dash-table-dense td {
  height: 32px;
  font-size: 13px;
  padding: 0 8px;
}

.dash-table-dense tbody tr:nth-child(even) td {
  background: var(--t-bg-alt);
}

/* ── Home Page Grid ─────────────────────────────────────────── */
.dash-home-grid {
  display: grid;
  grid-template-columns: 1fr 405px;
  gap: 1rem;
}

.dash-home-left,
.dash-home-right {
  min-width: 0;
}

.dash-home-right {
  min-width: 282px;
}

/* ── News ────────────────────────────────────────────────────── */
.dash-news-image {
  margin-bottom: 0.75rem;
}

.dash-news-placeholder {
  width: 100%;
  height: 289px;
  background: linear-gradient(to right, var(--c-obsidian), var(--c-cyan));
  border-radius: 8px;
}

.dash-news-list {
  display: flex;
  flex-direction: column;
}

.dash-news-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid var(--t-border-light);
  gap: 1rem;
}

.dash-news-item:nth-child(even) {
  background: var(--t-bg-alt);
}

.dash-news-item:last-child { border-bottom: none; }

.dash-news-title {
  font-size: 13px;
  color: var(--t-text);
  flex: 1;
  min-width: 0;
}

.dash-news-title a {
  color: var(--t-text);
  text-decoration: none;
}

.dash-news-title a:hover { text-decoration: underline; }

.dash-news-date {
  font-size: 12px;
  color: var(--t-text-faint);
  white-space: nowrap;
}

/* ── Price Table Colors ─────────────────────────────────────── */
.dash-price-currency {
  font-weight: 600;
  font-size: 13px;
  color: var(--t-text);
}

.dash-price-up { color: #22C55E; }
.dash-price-down { color: #DC2626; }
.dash-price-time { font-size: 12px; color: var(--t-text-faint); }

.dash-price-highlight {
  background: #DC2626;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.dash-cell-red {
  background: #DC2626;
  color: #fff;
  padding: 2px 8px;
  border-radius: 2px;
  font-weight: 500;
}

.dash-cell-red-deep {
  background: #991B1B;
  color: #fff;
  padding: 2px 8px;
  border-radius: 2px;
  font-weight: 500;
}

.dash-icon-cell {
  padding: 0 4px !important;
  width: 24px;
}

/* ── Chart ───────────────────────────────────────────────────── */
.dash-chart-area {
  position: relative;
  height: 250px;
  width: 100%;
}

.dash-chart-area canvas { max-width: 100%; }

.dash-chart-source {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--t-text-faint);
  margin-top: 0.5rem;
}

/* ── Overview Page ──────────────────────────────────────────── */
.dash-overview-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: stretch;
}

.dash-total-assets-card {
  grid-column: 1;
  padding: 1.5rem;
  gap: 16px;
}

.dash-commodity-card {
  background: var(--t-bg-card);
  border: 1px solid var(--t-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dash-commodity-name {
  font-size: 14px;
  color: var(--t-text-muted);
  margin-bottom: 0.25rem;
  text-align: center;
}

.dash-commodity-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--t-text);
  text-align: center;
}

.dash-commodity-change {
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.dash-commodity-sparkline {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
}

.dash-overview-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* ── Stat Elements ──────────────────────────────────────────── */
.dash-stat-label {
  font-size: 14px;
  color: var(--t-text-secondary);
  font-weight: 400;
  line-height: 22px;
}

.dash-stat-hero {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.25rem 0;
}

.dash-stat-hero-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--t-text);
  letter-spacing: -0.025em;
  line-height: 34px;
}

.dash-stat-secondary {
  font-size: 14px;
  color: var(--t-text);
  font-weight: 500;
  line-height: 23px;
}

.dash-stat-sub {
  font-size: 13px;
  color: var(--t-text-muted);
  margin-top: 0.25rem;
}

.dash-total-assets-details {
  display: flex;
  gap: 2rem;
  margin-top: 0.75rem;
}

.dash-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dash-detail-label {
  font-size: 12px;
  color: var(--t-text-muted);
}

.dash-detail-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--t-text);
  line-height: 23px;
}

/* ── Badges ──────────────────────────────────────────────────── */
.dash-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 23px;
}

.dash-badge-green { background: #A1FF6E; color: #56AC00; }
.dash-badge-orange { background: #FEF3C7; color: #D97706; }
.dash-badge-red { background: #FEE2E2; color: #E23636; }

.dash-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
}

.dash-text-green { color: #56AC00; }
.dash-text-red { color: #E23636; }

/* ── Donut Card ─────────────────────────────────────────────── */
.dash-donut-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.dash-donut-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

.dash-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.dash-donut-center-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--t-text);
  letter-spacing: -0.025em;
}

.dash-donut-center-sub {
  font-size: 11px;
  color: var(--t-text-muted);
  text-transform: uppercase;
}

.dash-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-donut-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  color: var(--t-text);
}

.dash-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Wallet ─────────────────────────────────────────────────── */
.dash-wallet-summary {
  margin-bottom: 1rem;
}

.dash-wallet-label {
  font-size: 14px;
  color: var(--t-text-secondary);
}

.dash-wallet-total {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--t-text);
  letter-spacing: -0.025em;
  line-height: 34px;
}

.dash-wallet-oz {
  font-size: 13px;
  color: var(--t-text-muted);
}

.dash-wallet-actions {
  display: flex;
  gap: 0.5rem;
}

/* ── Profile ───────────────────────────────────────────────── */
.dash-profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.dash-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--c-obsidian);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  flex-shrink: 0;
}

.dash-profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dash-profile-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--t-text);
  letter-spacing: -0.025em;
}

.dash-profile-role {
  font-size: 14px;
  color: var(--t-text-secondary);
}

.dash-profile-status {
  align-self: flex-start;
}

.dash-profile-form {
  margin-top: 0.5rem;
}

.dash-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.dash-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dash-form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--t-text-secondary);
}

.dash-form-input {
  height: 40px;
  border: 1px solid var(--t-border);
  border-radius: 6px;
  padding: 0 0.75rem;
  font-size: 14px;
  color: var(--t-text);
  background: var(--t-bg-input);
  font-family: inherit;
  transition: border-color 0.15s;
}

.dash-form-input:focus {
  outline: none;
  border-color: var(--c-cyan);
  box-shadow: 0 0 0 1px var(--c-cyan);
}

.dash-form-actions {
  margin-top: 1.25rem;
}

.dash-detail-grid {
  display: flex;
  flex-direction: column;
}

.dash-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--t-border-light);
}

.dash-detail-row:last-child {
  border-bottom: none;
}

/* ── Buttons ────────────────────────────────────────────────── */
.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0.4rem 0.85rem;
  text-decoration: none;
  font-family: inherit;
}

.dash-btn-primary {
  background: var(--c-cyan);
  color: #fff;
}

.dash-btn-primary:hover { background: var(--c-cyan-dark); }

.dash-btn-outline {
  background: var(--t-bg-card);
  color: var(--t-text);
  border: 1px solid var(--t-border);
}

.dash-btn-outline:hover { background: var(--t-bg-hover); }

.dash-btn-warning {
  background: #F97316;
  color: #fff;
}

.dash-btn-warning:hover { background: #EA580C; }

.dash-btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 12px;
}

/* ── Side Badges (Reports) ──────────────────────────────────── */
.dash-side-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.dash-side-buy { color: #16A34A; }
.dash-side-sell { color: #DC2626; }

.dash-status-working { color: #F97316; font-weight: 500; }
.dash-status-settled { color: #56AC00; font-weight: 500; }
.dash-status-cancelled { color: #E23636; font-weight: 500; }
.dash-status-draft { color: #71717A; font-weight: 500; }

/* ── Filter Dropdown ────────────────────────────────────────── */
.dash-report-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.dash-filter-dropdown {
  position: relative;
}

.dash-filter-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--t-bg-card);
  border: 1px solid var(--t-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--t-shadow);
  padding: 0.5rem;
  z-index: 50;
  min-width: 140px;
}

.dash-filter-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  font-size: 13px;
  color: var(--t-text);
  cursor: pointer;
  border-radius: 4px;
}

.dash-filter-check:hover { background: var(--t-bg-hover); }

.dash-filter-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--c-cyan);
}

/* ── Pagination ─────────────────────────────────────────────── */
.dash-pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--t-border);
}

.dash-pagination-arrow {
  font-size: 18px;
  color: var(--t-text-muted);
  text-decoration: none;
  padding: 0 0.25rem;
}

.dash-pagination-info {
  font-size: 13px;
  color: var(--t-text-muted);
}

/* ── Trade Loader Overlay ───────────────────────────────────── */
.trade-loader {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--t-bg-card);
  font-size: 13px;
  color: var(--t-text-muted);
}

.trade-loader-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--t-border);
  border-top-color: var(--c-cyan);
  border-radius: 50%;
  animation: trade-spin 0.7s linear infinite;
}

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

/* ── Trade Market Closed Banner ─────────────────────────────── */
.trade-market-closed {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #f87171;
  font-size: 13px;
  line-height: 1.4;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* ── Trade Modal ────────────────────────────────────────────── */
.trade-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--t-overlay);
  z-index: 2000;
  justify-content: flex-end;
}

.trade-modal-overlay.visible {
  display: flex;
}

.trade-modal {
  width: 420px;
  max-width: 100%;
  height: 100vh;
  background: var(--t-bg-card);
  overflow-y: auto;
  box-shadow: -4px 0 24px var(--t-shadow);
  display: flex;
  flex-direction: column;
}

.trade-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--t-border);
}

.trade-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--t-text);
}

.trade-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--t-text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.trade-modal-back {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 13px;
  color: var(--t-text-muted);
  cursor: pointer;
}

.trade-modal-body {
  flex: 1;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  position: relative;
}

/* ── Trade Ticket ───────────────────────────────────────────── */
.trade-ticket { position: relative; }

.trade-position-info {
  background: var(--t-bg-hover);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 13px;
  color: var(--t-text-muted);
  margin-bottom: 1rem;
}

.trade-field {
  margin-bottom: 1rem;
}

.trade-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--t-text);
  margin-bottom: 0.35rem;
}

.trade-select,
.trade-input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  padding: 0 0.75rem;
  font-size: 14px;
  color: var(--t-text);
  background: var(--t-bg-input);
  font-family: inherit;
}

.trade-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%2371717A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.trade-side-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  overflow: hidden;
}

.trade-side-btn {
  flex: 1;
  padding: 0.5rem;
  border: none;
  background: var(--t-bg-input);
  font-size: 14px;
  font-weight: 500;
  color: var(--t-text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.trade-side-btn.active {
  background: var(--c-obsidian);
  color: #fff;
}

.trade-side-btn[data-side="buy"].active { background: var(--c-cyan); color: #fff; }
.trade-side-btn[data-side="sell"].active { background: #DC2626; color: #fff; }

/* ── Trade Chart ────────────────────────────────────────────── */
.trade-chart-section {
  margin-bottom: 1rem;
}

.trade-chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--t-text);
  margin-bottom: 0.5rem;
}

.trade-chart-area {
  height: 200px;
  position: relative;
  background: var(--c-obsidian);
  border-radius: 8px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
}

.trade-chart-area canvas {
  width: 100% !important;
  height: 100% !important;
}

.trade-chart-timeframes {
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--t-border);
  width: fit-content;
}

.trade-tf-btn {
  padding: 0.35rem 0.75rem;
  border: none;
  background: var(--t-bg-input);
  font-size: 12px;
  font-weight: 500;
  color: var(--t-text-muted);
  cursor: pointer;
  font-family: inherit;
}

.trade-tf-btn.active {
  background: #22C55E;
  color: #fff;
}

.trade-radio-group {
  display: flex;
  gap: 1rem;
}

.trade-radio {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 14px;
  color: var(--t-text);
  cursor: pointer;
}

.trade-radio input { accent-color: var(--c-cyan); }

/* ── Trade Summary ──────────────────────────────────────────── */
.trade-summary {
  margin: 1rem 0;
}

.trade-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 14px;
  color: var(--t-text-muted);
}

.trade-summary-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--t-text);
  border-top: 1px solid var(--t-border);
  margin-top: 0.25rem;
  padding-top: 0.75rem;
}

.trade-submit-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--c-cyan);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  margin-bottom: 0.5rem;
  transition: background 0.15s;
}

.trade-submit-btn:hover { background: var(--c-cyan-dark); }

.trade-cancel-btn {
  width: 100%;
  padding: 0.65rem;
  background: transparent;
  color: var(--t-text-muted);
  border: 1px solid var(--t-border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

/* ── Trade Confirmation ─────────────────────────────────────── */
.trade-confirm-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--t-text);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--t-border);
}

.trade-confirm-row {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0;
  font-size: 14px;
  color: var(--t-text);
  border-bottom: 1px solid var(--t-border-light);
}

.trade-confirm-total {
  font-weight: 700;
  border-bottom: none;
  margin-bottom: 1.5rem;
}

/* ── Trade Input Mode Toggle (Principal/Notional) ────────────── */
.trade-input-mode-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  overflow: hidden;
}

.trade-mode-btn {
  flex: 1;
  padding: 0.45rem 0.5rem;
  border: none;
  background: var(--t-bg-input);
  font-size: 13px;
  font-weight: 500;
  color: var(--t-text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.trade-mode-btn.active {
  background: var(--c-obsidian);
  color: #fff;
}

/* ── Trade Errors ────────────────────────────────────────────── */
.trade-errors {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  font-size: 13px;
  color: #991B1B;
}

.trade-errors div + div {
  margin-top: 0.25rem;
}

/* ── Trade Success ───────────────────────────────────────────── */
.trade-success-content {
  text-align: center;
  padding: 2rem 0;
}

.trade-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: #D1FAE5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #065F46;
}

.trade-success-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--t-text);
  margin-bottom: 0.5rem;
}

.trade-success-content p {
  font-size: 14px;
  color: var(--t-text-muted);
  margin-bottom: 1.5rem;
}

/* ── P/L color helpers ───────────────────────────────────────── */
.dash-text-green { color: #16A34A; }
.dash-text-red { color: #DC2626; }

.dash-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}
.dash-badge-green { background: #D1FAE5; color: #065F46; }
.dash-badge-red { background: #FEE2E2; color: #991B1B; }

/* ── Toast ───────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--t-bg-card);
  border: 1px solid var(--t-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--t-shadow);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon-success {
  width: 24px;
  height: 24px;
  background: #22C55E;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

.toast-content { flex: 1; }

.toast-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--t-text);
}

.toast-details {
  font-size: 12px;
  color: var(--t-text-muted);
}

.toast-link {
  font-size: 13px;
  color: var(--c-cyan);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

/* ── Dashboard Responsive: Tablet ───────────────────────────── */
@media (max-width: 1024px) {
  .dash-home-grid { grid-template-columns: 1fr; }
  .dash-overview-row { grid-template-columns: 1fr 1fr; }
  .dash-overview-row-2 { grid-template-columns: 1fr; }
  .dash-total-assets-details { flex-wrap: wrap; gap: 1rem; }
  .dash-top-bar { flex-wrap: wrap; justify-content: flex-end; }
  .dashboard-main { padding: 1.25rem; }
}

/* ── Dashboard Responsive: Mobile ───────────────────────────── */
@media (max-width: 768px) {
  .dashboard-sidebar-toggle { display: flex; }

  .dashboard-body .dashboard-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 16px rgba(0,0,0,0.1);
  }

  .dashboard-body .dashboard-sidebar.open {
    transform: translateX(0);
  }

  .dashboard-main { padding: 1rem; }
  .dash-page-title { font-size: 1.25rem; }
  .dash-overview-row { grid-template-columns: 1fr; }
  .dash-top-bar { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .dash-top-bar-stats { flex-wrap: wrap; gap: 0.75rem; }

  .trade-modal { width: 100%; }
}

@media (max-width: 480px) {
  .dashboard-main { padding: 0.75rem; }
  .dash-card { padding: 1rem; border-radius: 8px; }
  .dash-stat-hero-value { font-size: 1.5rem; }
  .dash-wallet-total { font-size: 1.5rem; }
}

/* ═══════════════════════════════════════════════════════════════
   THEME TOGGLE — Light/Dark mode switcher
   ═══════════════════════════════════════════════════════════════ */

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  width: calc(100% - 1.5rem);
  margin: 2px 0.75rem;
  border-radius: 8px;
  transition: all 0.15s;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--t-text-muted);
  text-align: left;
}

.theme-toggle:hover {
  color: var(--t-text);
  background: var(--t-bg-hover);
}

.theme-toggle-track {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--t-border);
  position: relative;
  transition: background 0.25s;
  flex-shrink: 0;
}

[data-theme="dark"] .theme-toggle-track {
  background: var(--c-cyan);
}

.theme-toggle-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(18px);
}

.theme-toggle-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Logo swap for dark mode ──────────────────────────────── */
.logo-light { display: block; }
.logo-dark  { display: none; }

[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark  { display: block; }

/* ── Site header theme toggle ────────────────────────────── */
.site-header .theme-toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 1.5rem;
  color: #ccc;
  font-size: 0.82rem;
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: .05em;
  transition: color 0.15s;
}

.site-header .theme-toggle-inline:hover {
  color: #fff;
}

.site-header .theme-toggle-inline svg {
  width: 16px;
  height: 16px;
}

/* ── Dark mode: Auth wrapper adjustment ───────────────────── */
[data-theme="dark"] .auth-wrapper {
  background: linear-gradient(135deg, #0a0f14 0%, #0f1419 100%);
}

/* ── Empty state in dark mode ─────────────────────────────── */
.empty-state { color: var(--t-text-faint); }

/* ── Custom confirmation dialog ──────────────────────────── */
.confirm-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--t-overlay);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.confirm-dialog-overlay.visible { opacity: 1; }

.confirm-dialog {
  background: var(--t-bg-card);
  border: 1px solid var(--t-border);
  border-radius: 12px;
  padding: 2rem;
  width: 400px;
  max-width: 92vw;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transform: scale(0.95) translateY(8px);
  transition: transform 0.2s ease;
}
.confirm-dialog-overlay.visible .confirm-dialog {
  transform: scale(1) translateY(0);
}

.confirm-dialog-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.confirm-dialog-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--t-text);
  margin: 0 0 0.5rem;
}

.confirm-dialog-message {
  font-size: 0.9rem;
  color: var(--t-text-muted);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.confirm-dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.confirm-dialog-btn {
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.confirm-dialog-btn:hover { opacity: 0.85; }

.confirm-dialog-btn--cancel {
  background: var(--t-border);
  color: var(--t-text);
}

.confirm-dialog-btn--confirm {
  background: #DC2626;
  color: #fff;
}

.confirm-dialog-btn--positive {
  background: #16A34A;
  color: #fff;
}
