/* ============================================================
   THE BLUEPRINT — Studio Twelve UK
   Palette: Purple Corallite #5B4F8C · Flamingo Pink #F990B8
            Blue Curacao #1ECBD8 · Porcelain Rose #F07070
            Midnight Navy #2E3A4F (dominant)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── TOLV Design Tokens ──────────────────────────────────── */
:root {
  /* ── Core palette ── */
  --purple-corallite:  #5B4F8C;
  --flamingo-pink:     #F990B8;
  --blue-curacao:      #1ECBD8;
  --porcelain-rose:    #F07070;
  --midnight:          #2E3A4F;   /* dominant */

  /* ── Primary (dominant = Midnight Navy) ── */
  --tolv-teal:      #2E3A4F;
  --tolv-teal-dark: #1A2435;
  --tolv-teal-tint: #E8ECF2;
  --tolv-teal-glow: #F2F4F7;

  /* ── Ink / text scale ── */
  --tolv-ink:       #0F1B2D;
  --tolv-ink-soft:  #3B4A60;
  --tolv-mute:      #7A8597;

  /* ── Surfaces ── */
  --tolv-surface:   #FFFFFF;
  --tolv-paper:     #FFFFFF;
  --tolv-raised:    #FFFFFF;
  --tolv-subtle:    #F5F7FA;
  --tolv-line:      #E6E9EE;

  /* ── Error / destructive (neutral red — not vibrant) ── */
  --tolv-error:     #C0392B;
  --tolv-error-bg:  #FDECEA;
  --tolv-error-on:  #7B2519;

  /* ── Success (desaturated) ── */
  --tolv-ok:        #2D7A5F;
  --tolv-ok-bg:     #D4F0E7;

  /* ── Elevation shadows (ambient, no hard borders) ── */
  --shadow-1: 0px 10px 30px rgba(15,27,45,0.05);
  --shadow-2: 0px 20px 40px rgba(15,27,45,0.09);
  --shadow-3: 0px 24px 48px rgba(15,27,45,0.14);

  /* ── Typography ── */
  --font-display: 'Bricolage Grotesque', 'Inter', system-ui, -apple-system, sans-serif;
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace, monospace;

  /* ── Radius ── */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* ── Spacing ── */
  --unit:          4px;
  --gutter:        24px;
  --margin:        32px;
  --container-max: 1280px;

  /* ── Transitions ── */
  --transition: 0.18s ease;

  /* ── Layout ── */
  --nav-height:    52px;
  --topnav-h:      58px;
  --sb-width:      256px;
  --sidebar-width: 256px;
  --content-max:   var(--container-max);

  /* ── Legacy aliases (backward compat with JS) ── */
  --surface:                  var(--tolv-surface);
  --surface-container-lowest: var(--tolv-paper);
  --surface-container-low:    var(--tolv-subtle);
  --surface-container:        var(--tolv-line);
  --surface-container-high:   #DDE1E8;
  --on-surface:               var(--tolv-ink);
  --on-surface-variant:       var(--tolv-ink-soft);
  --outline:                  var(--tolv-mute);
  --outline-variant:          var(--tolv-line);
  --primary:                  var(--tolv-teal);
  --on-primary:               #FFFFFF;
  --primary-container:        var(--tolv-teal-tint);
  --on-primary-container:     var(--tolv-ink);
  --inverse-surface:          var(--tolv-ink);
  --inverse-on-surface:       var(--tolv-paper);
  --error:                    var(--tolv-error);
  --on-error:                 #FFFFFF;
  --error-container:          var(--tolv-error-bg);
  --on-error-container:       var(--tolv-error-on);
  --background:               var(--tolv-surface);
  --on-background:            var(--tolv-ink);
  --color-bg:                 var(--tolv-paper);
  --color-bg-secondary:       var(--tolv-subtle);
  --color-accent:             var(--tolv-teal);
  --color-accent-hover:       var(--tolv-teal-dark);
  --color-text-primary:       var(--tolv-ink);
  --color-text-secondary:     var(--tolv-ink-soft);
  --color-text-tertiary:      var(--tolv-mute);
  --color-border:             rgba(15,27,45,0.08);
  --color-border-light:       rgba(15,27,45,0.05);
  --color-danger:             var(--tolv-error);
  --color-nav-bg:             rgba(255,255,255,0.92);

  /* ── Category tokens — unified teal (no per-category colour) ── */
  --cat-onb:    var(--tolv-teal-dark);  --cat-onb-bg: var(--tolv-teal-glow);
  --cat-ops:    var(--tolv-teal-dark);  --cat-ops-bg: var(--tolv-teal-glow);
  --cat-web:    var(--tolv-teal-dark);  --cat-web-bg: var(--tolv-teal-glow);
  --cat-seo:    var(--tolv-teal-dark);  --cat-seo-bg: var(--tolv-teal-glow);
  --cat-com:    var(--tolv-teal-dark);  --cat-com-bg: var(--tolv-teal-glow);
  --cat-wix:    var(--tolv-teal-dark);  --cat-wix-bg: var(--tolv-teal-glow);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font);
  background: var(--tolv-surface);
  color: var(--tolv-ink);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--tolv-teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────────────────────
   APP SHELL — topnav + main
   ───────────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top Navigation ───────────────────────────────────────── */
.app-topnav {
  height: var(--topnav-h);
  background: #2E3A4F;
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 500;
  width: 100%;
  flex-shrink: 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 20px;
  gap: 0;
  width: 100%;
  position: relative;
}

/* Brand */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex: 1;
  flex-shrink: 0;
}
.nav-brand:hover { text-decoration: none; }

.nav-brand-mark { display: none; }

.nav-brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Search — hidden */
.nav-search-wrap {
  display: none;
}
.nav-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tolv-mute);
  pointer-events: none;
}
.nav-search-input {
  width: 100%;
  box-sizing: border-box;
  height: 34px;
  padding: 0 12px 0 32px;
  border: 1.5px solid var(--tolv-line);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--tolv-ink);
  background: var(--tolv-surface);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.nav-search-input:focus {
  border-color: var(--tolv-teal);
  background: var(--tolv-paper);
  box-shadow: 0 0 0 3px rgba(46,58,79,0.20);
}
.nav-search-input::placeholder { color: var(--tolv-mute); }

/* Nav links row — centred absolutely so brand+user can both be flex:1 */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  line-height: 1;
}
.nav-link:hover { background: rgba(255,255,255,0.10); color: #FFFFFF; text-decoration: none; }
.nav-link.active {
  color: #0D1520;
  font-weight: 600;
  background: #1ECBD8;
}

/* ── Nav notification badge ──────────────────────────────── */
.nav-link { position: relative; }
.nav-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  border-radius: 99px;
  background: #F990B8;
  border: 2px solid #2E3A4F;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
  line-height: 1;
}

/* ── What's New feed ─────────────────────────────────────── */
.whats-new-feed { display: flex; flex-direction: column; }
.whats-new-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--tolv-line);
  cursor: pointer;
  transition: background 0.13s;
  text-decoration: none;
  color: inherit;
}
.whats-new-item:last-child { border-bottom: none; }
.whats-new-item:hover { background: rgba(91,79,140,0.04); text-decoration: none; color: inherit; }

.wn-type-pill {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 99px;
}
.wn-type-article { background: #EDE9F7; color: #5B4F8C; }
.wn-type-check   { background: #E0F9FB; color: #0A8F9B; }

.wn-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--tolv-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wn-new-tag {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #F990B8;
  color: #fff;
  padding: 2px 7px;
  border-radius: 99px;
}
.wn-date {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--tolv-mute);
  white-space: nowrap;
}
.wn-arrow {
  flex-shrink: 0;
  color: var(--tolv-mute);
  font-size: 14px;
}

/* Dropdown wrapper */
.nav-dd-wrap { position: relative; }

.nav-dd-btn svg { transition: transform 0.18s; }
.nav-dd-wrap.open .nav-dd-btn svg { transform: rotate(180deg); }
.nav-dd-btn.active { color: var(--tolv-teal); font-weight: 600; background: var(--tolv-teal-glow); }

.nav-dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--tolv-paper);
  border: 1px solid var(--tolv-line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow-2);
  min-width: 178px;
  z-index: 600;
}
.nav-dd-wrap.open .nav-dd-menu { display: block; }

.nav-dd-item {
  display: block;
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--tolv-ink-soft);
  text-decoration: none;
  border-radius: 7px;
  transition: background var(--transition), color var(--transition);
}
.nav-dd-item:hover { background: var(--tolv-surface); color: var(--tolv-ink); text-decoration: none; }
.nav-dd-item.active { color: var(--tolv-teal); background: var(--tolv-teal-glow); font-weight: 600; }

/* Right section: user + sign-out */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* User block inside topnav */
.nav-right .sb-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border-bottom: none;
  margin: 0;
}
.nav-right .sb-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 11px;
  background: rgba(255,255,255,0.18);
  color: #FFFFFF;
}
.nav-right .sb-user-name  { font-size: 13px; color: rgba(255,255,255,0.80); }
.nav-right .sb-user-role  { font-size: 11px; display: none; }

.nav-signout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 7px;
  color: rgba(255,255,255,0.50);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.nav-signout-btn:hover { background: rgba(240,112,112,0.15); color: #F07070; }

/* ── App Main ─────────────────────────────────────────────── */
.app-main {
  flex: 1;
  margin-left: 0;
  min-height: calc(100vh - var(--topnav-h));
  background: var(--tolv-surface);
  min-width: 0;
}

/* ── Sidebar: Brand ───────────────────────────────────────── */
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 18px;
  flex-shrink: 0;
  text-decoration: none;
}
.sb-brand:hover { text-decoration: none; }

.sb-brand-mark {
  width: 34px;
  height: 34px;
  background: var(--tolv-teal);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.sb-brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--tolv-ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.sb-brand-sub {
  font-size: 11px;
  color: var(--tolv-mute);
  line-height: 1.3;
  font-weight: 400;
}

/* ── Sidebar: User Profile ────────────────────────────────── */
.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 14px;
  flex-shrink: 0;
}

.sb-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--tolv-teal-tint);
  color: var(--tolv-ink);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--tolv-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.sb-user-role {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tolv-mute);
  line-height: 1.3;
}
.sb-user-role.admin { color: var(--tolv-teal-dark); }

/* ── Sidebar: Search ──────────────────────────────────────── */
.sb-search-wrap {
  padding: 0 12px 12px;
  flex-shrink: 0;
  position: relative;
}

.sb-search-input {
  width: 100%;
  height: 34px;
  background: var(--tolv-subtle);
  border: none;
  border-radius: var(--radius-full);
  padding: 0 12px 0 30px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--tolv-ink);
  outline: none;
  transition: all var(--transition);
}
.sb-search-input::placeholder { color: var(--tolv-mute); }
.sb-search-input:focus {
  background: var(--tolv-paper);
  box-shadow: 0 0 0 2px var(--tolv-teal-tint);
}

/* ── Sidebar: Nav ─────────────────────────────────────────── */
.sb-nav {
  flex: 1;
  padding: 4px 0 8px;
  overflow-y: auto;
}

.sb-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tolv-mute);
  padding: 14px 20px 4px;
  line-height: 1;
}

.sb-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--tolv-ink-soft);
  text-decoration: none;
  transition: all var(--transition);
  border-radius: var(--radius-full);
  cursor: pointer;
  background: none;
  border: none;
  width: calc(100% - 16px);
  text-align: left;
  font-family: var(--font);
  line-height: 1.4;
  position: relative;
}
.sb-nav-item:hover {
  background: var(--tolv-subtle);
  color: var(--tolv-ink);
  text-decoration: none;
}

/* Active: teal-tint pill + 2px left rail in teal */
.sb-nav-item.active {
  background: var(--tolv-teal-tint);
  color: var(--tolv-ink);
  font-weight: 600;
}
.sb-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 2.5px;
  background: var(--tolv-teal);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}
.sb-nav-item.active .sb-nav-icon { color: var(--tolv-teal-dark); }
.sb-nav-item.active .sb-nav-pip  { background: var(--tolv-teal) !important; }

.sb-nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--tolv-mute);
}

.sb-nav-pip {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: inline-block;
}

.sb-nav-label { flex: 1; }

.sb-nav-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--tolv-error);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
  line-height: 1.6;
}

/* ── Sidebar: Footer ──────────────────────────────────────── */
.sb-footer {
  padding: 8px 0 12px;
  flex-shrink: 0;
  box-shadow: 0 -1px 0 var(--tolv-line);
}

/* ─────────────────────────────────────────────────────────────
   HOME PAGE
   ───────────────────────────────────────────────────────────── */
.home-header {
  padding: 40px 40px 0;
}

.home-greeting {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--tolv-ink);
  line-height: 1.2;
}

.home-subgreeting {
  font-size: 15px;
  color: var(--tolv-ink-soft);
  margin-top: 6px;
  font-weight: 400;
}

/* ── Stats Row ────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px 40px;
}

.stat-block {
  background: var(--tolv-paper);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-1);
}

.stat-block-value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--tolv-ink);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-block-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tolv-mute);
  line-height: 1;
}

.stat-block-sub {
  font-size: 12px;
  color: var(--tolv-mute);
  margin-top: 4px;
}

.stat-block.accent .stat-block-value  { color: var(--tolv-teal); }
.stat-block.success .stat-block-value { color: var(--tolv-ok); }
.stat-block.warn    .stat-block-value { color: var(--tolv-teal-dark); }
.stat-block.purple  .stat-block-value { color: var(--tolv-ink-soft); }

/* ── Category Cards Grid ──────────────────────────────────── */
.home-section {
  padding: 0 40px 40px;
}

.home-section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tolv-ink);
  margin-bottom: 16px;
}

.cat-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.cat-card {
  background: var(--tolv-paper);
  border-radius: var(--radius-lg);
  padding: 24px 24px 20px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  text-decoration: none;
}

/* Unified teal stripe for all categories */
.cat-card-stripe {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--tolv-teal);
}

.cat-card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 20px;
  background: var(--tolv-teal-glow);
  color: var(--tolv-teal-dark);
}

.cat-card-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--tolv-ink);
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}

.cat-card-count {
  font-size: 13px;
  color: var(--tolv-mute);
  font-weight: 400;
}

.cat-card-arrow {
  position: absolute;
  bottom: 20px;
  right: 20px;
  font-size: 14px;
  color: var(--tolv-line);
  transition: transform var(--transition);
}
.cat-card:hover .cat-card-arrow {
  transform: translateX(3px);
  color: var(--tolv-teal);
}

/* Category card colour variants — all teal now */
.cat-card.onb .cat-card-icon-wrap,
.cat-card.ops .cat-card-icon-wrap,
.cat-card.web .cat-card-icon-wrap,
.cat-card.seo .cat-card-icon-wrap,
.cat-card.com .cat-card-icon-wrap,
.cat-card.wix .cat-card-icon-wrap {
  background: var(--tolv-teal-glow);
  color: var(--tolv-teal-dark);
}

/* ── KB Article ID Badge ──────────────────────────────────── */
.kb-id-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  display: inline-block;
  background: var(--tolv-teal-glow);
  color: var(--tolv-teal-dark);
}
.kb-id-badge.onb,
.kb-id-badge.ops,
.kb-id-badge.web,
.kb-id-badge.seo,
.kb-id-badge.com,
.kb-id-badge.wix {
  background: var(--tolv-teal-glow);
  color: var(--tolv-teal-dark);
}

/* ── Recent Articles List ─────────────────────────────────── */
.recent-article-list { display: flex; flex-direction: column; }

.recent-article-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(15,27,45,0.05);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.recent-article-item:first-child { border-top: 1px solid rgba(15,27,45,0.05); }
.recent-article-item:hover .recent-article-title { color: var(--tolv-teal); }

.recent-article-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--tolv-ink);
  flex: 1;
  transition: color var(--transition);
}

.recent-article-cat {
  font-size: 12px;
  color: var(--tolv-mute);
  white-space: nowrap;
}

.recent-article-arrow {
  color: var(--tolv-line);
  font-size: 14px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────
   INNER PAGE LAYOUTS
   ───────────────────────────────────────────────────────────── */
.inner-page {
  padding: 40px 40px 80px;
  max-width: 900px;
}

.inner-page-full {
  padding: 40px 40px 80px;
}

.page-title-block {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(15,27,45,0.06);
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.page-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
}
.page-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--tolv-ink);
}

.page-desc {
  font-size: 14px;
  color: var(--tolv-ink-soft);
  line-height: 1.6;
  max-width: 600px;
  font-weight: 400;
}

/* Category page search row */
.cat-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  max-width: 600px;
}
.cat-search-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}
.cat-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tolv-mute);
  pointer-events: none;
}
.cat-search-input {
  width: 100%;
  box-sizing: border-box;
  height: 42px;
  padding: 0 14px 0 40px;
  border: 1.5px solid #2E3A4F;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--tolv-ink);
  background: #FFFFFF;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cat-search-input:focus {
  border-color: #1ECBD8;
  box-shadow: 0 0 0 3px rgba(30,203,216,0.18);
}
.cat-search-input::placeholder { color: var(--tolv-mute); }

/* ─────────────────────────────────────────────────────────────
   CATEGORY PAGE — dual sidebar
   ───────────────────────────────────────────────────────────── */
.cat-page-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--tolv-paper);
  box-shadow: 1px 0 0 var(--tolv-line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 28px 0 48px;
}

.cat-page-content {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
  max-width: 840px;
}

/* ── Category Page Sidebar Header ─────────────────────────── */
.sidebar-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(15,27,45,0.05);
}

.sidebar-category-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-category-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--tolv-ink);
  letter-spacing: -0.01em;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5B4F8C;
  padding: 14px 20px 6px;
}

/* Category sidebar article links */
.sidebar-link {
  display: flex;
  flex-direction: column;
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--tolv-ink-soft);
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
  gap: 1px;
  border-radius: 0;
}
.sidebar-link:hover {
  color: var(--tolv-ink);
  background: rgba(91,79,140,0.06);
  text-decoration: none;
}
.sidebar-link.active {
  color: #5B4F8C;
  background: rgba(91,79,140,0.08);
  font-weight: 600;
  border-left: 3px solid #5B4F8C;
  padding-left: 17px;
}

.sidebar-link-id {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--tolv-mute);
}

/* ─────────────────────────────────────────────────────────────
   KB ARTICLE LIST
   ───────────────────────────────────────────────────────────── */
.kb-list { display: flex; flex-direction: column; }

.kb-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(15,27,45,0.05);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.kb-item:first-child { border-top: 1px solid rgba(15,27,45,0.05); }
.kb-item:hover .kb-item-title { color: var(--tolv-teal); }

.kb-item-id {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--tolv-teal-dark);
  background: var(--tolv-teal-glow);
  padding: 3px 8px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.kb-item-body { flex: 1; min-width: 0; }

.kb-item-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--tolv-ink);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  transition: color var(--transition);
}

.kb-item-overview {
  font-size: 14px;
  color: var(--tolv-ink-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kb-item-arrow {
  color: var(--tolv-line);
  flex-shrink: 0;
  font-size: 18px;
  margin-top: 2px;
}

/* ─────────────────────────────────────────────────────────────
   MY HUB PAGE
   ───────────────────────────────────────────────────────────── */
.hub-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

/* ─────────────────────────────────────────────────────────────
   KNOWLEDGE CHECKS PAGE
   ───────────────────────────────────────────────────────────── */
.checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.check-card {
  background: var(--tolv-paper);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: transform var(--transition), box-shadow var(--transition);
  color: inherit;
}
.check-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  text-decoration: none;
}

.check-card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--tolv-ink);
  letter-spacing: -0.015em;
  margin-bottom: 6px;
  line-height: 1.35;
}

.check-card-meta {
  font-size: 12px;
  color: var(--tolv-mute);
  margin-bottom: 16px;
  font-weight: 400;
}

.check-card-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}
.check-card-status.passed  { background: var(--tolv-teal-tint); color: var(--tolv-teal-dark); }
.check-card-status.failed  { background: var(--tolv-error-bg); color: var(--tolv-error-on); }
.check-card-status.pending { background: var(--tolv-subtle); color: var(--tolv-mute); }

/* ─────────────────────────────────────────────────────────────
   TAKE CHECK PAGE
   ───────────────────────────────────────────────────────────── */
.check-shell { display: flex; flex-direction: column; min-height: 100vh; }

.check-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  background: var(--tolv-paper);
  box-shadow: 0 1px 0 var(--tolv-line);
  flex-shrink: 0;
}
.check-top-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--tolv-ink);
  flex: 1;
}

.check-body { flex: 1; }

.check-progress-bar {
  height: 4px;
  background: var(--tolv-teal-glow);
  border-radius: 0;
  margin: 0;
  overflow: hidden;
}
.check-progress-fill {
  height: 100%;
  background: var(--tolv-teal);
  transition: width 0.35s ease;
}

.check-question-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.check-question-num {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tolv-mute);
  margin-bottom: 12px;
}

.check-question-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tolv-ink);
  line-height: 1.35;
  margin-bottom: 28px;
}

.check-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }

.check-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--tolv-paper);
  box-shadow: var(--shadow-1);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  font-size: 15px;
  color: var(--tolv-ink);
  font-weight: 500;
  border: none;
}
.check-option:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.check-option.selected {
  background: var(--tolv-teal-tint);
  color: var(--tolv-ink);
  box-shadow: var(--shadow-1);
}
.check-option.correct { background: var(--tolv-teal-tint); color: var(--tolv-teal-dark); }
.check-option.wrong   { background: var(--tolv-error-bg); color: var(--tolv-error-on); }

.check-option-letter {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--tolv-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--tolv-mute);
  flex-shrink: 0;
}
.check-option.selected .check-option-letter {
  background: var(--tolv-teal);
  color: #FFFFFF;
}

.check-result-card {
  text-align: center;
  padding: 48px 24px;
  max-width: 560px;
  margin: 0 auto;
}

.check-score-circle {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  background: var(--tolv-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--tolv-ink);
  box-shadow: var(--shadow-2);
}
.check-score-circle.passed { background: var(--tolv-teal-tint); color: var(--tolv-teal-dark); }
.check-score-circle.failed { background: var(--tolv-error-bg); color: var(--tolv-error-on); }

/* ─────────────────────────────────────────────────────────────
   ADMIN PANEL
   ───────────────────────────────────────────────────────────── */
.admin-inner { padding: 36px 40px 80px; }

.admin-wrapper {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.admin-header {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(15,27,45,0.06);
}

.admin-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--tolv-ink);
}

.admin-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--tolv-teal-glow);
  color: var(--tolv-teal-dark);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-section { margin-bottom: 40px; }

.admin-section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tolv-ink);
  margin-bottom: 20px;
}

.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(15,27,45,0.08);
  margin-bottom: 36px;
}

.admin-tab-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--tolv-mute);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  white-space: nowrap;
}
.admin-tab-btn:hover { color: var(--tolv-ink); }
.admin-tab-btn.active {
  color: var(--tolv-teal);
  border-bottom-color: var(--tolv-teal);
  font-weight: 600;
}

.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

/* ── Admin Table ──────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tolv-mute);
  padding: 0 12px 10px;
  border-bottom: 1px solid rgba(15,27,45,0.08);
}
.admin-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(15,27,45,0.04);
  vertical-align: middle;
  color: var(--tolv-ink);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--tolv-subtle); }
.admin-table .col-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--tolv-teal-dark);
  white-space: nowrap;
}
.admin-table .col-title { font-weight: 500; }
.admin-table .col-cat   { color: var(--tolv-ink-soft); white-space: nowrap; }
.admin-table .col-actions { white-space: nowrap; text-align: right; }

/* ── Analytics Tables ─────────────────────────────────────── */
.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.analytics-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tolv-mute);
  padding: 0 12px 10px;
  border-bottom: 1px solid rgba(15,27,45,0.08);
}
.analytics-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(15,27,45,0.04);
  vertical-align: middle;
}
.analytics-table tr:last-child td { border-bottom: none; }
.analytics-table tr:hover td { background: var(--tolv-subtle); }

.bar-cell { display: flex; align-items: center; gap: 10px; }
.bar-track {
  flex: 1;
  height: 5px;
  background: var(--tolv-teal-glow);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--tolv-teal);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}
.bar-label {
  font-size: 12px;
  color: var(--tolv-mute);
  white-space: nowrap;
  min-width: 30px;
  text-align: right;
}

/* ─────────────────────────────────────────────────────────────
   MODAL — KB Article
   ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,27,45,0.45);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--tolv-paper);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-3);
  width: 100%;
  max-width: 700px;
  max-height: 82vh;
  overflow-y: auto;
  transform: scale(0.96) translateY(10px);
  transition: transform 0.22s ease;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  padding: 32px 36px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.modal-header-text { flex: 1; }

.modal-id {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--tolv-teal-dark);
  background: var(--tolv-teal-glow);
  padding: 3px 8px;
  border-radius: var(--radius-md);
  display: inline-block;
  margin-bottom: 10px;
  font-weight: 600;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tolv-ink);
  line-height: 1.25;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--tolv-subtle);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tolv-ink-soft);
  flex-shrink: 0;
  margin-top: 4px;
  transition: background var(--transition);
  font-size: 16px;
  line-height: 1;
}
.modal-close:hover { background: var(--tolv-line); }

.modal-body { padding: 20px 36px 36px; }

.modal-overview {
  font-size: 16px;
  color: var(--tolv-ink-soft);
  line-height: 1.65;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(15,27,45,0.06);
}

.modal-content {
  font-size: 15px;
  color: var(--tolv-ink);
  line-height: 1.75;
  white-space: pre-wrap;
}

/* ─────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: var(--tolv-teal);
  color: #FFFFFF;
}
.btn-primary:hover {
  background: var(--tolv-teal-dark);
  text-decoration: none;
  color: #FFFFFF;
  box-shadow: var(--shadow-1);
}

.btn-secondary {
  background: var(--tolv-paper);
  color: var(--tolv-ink);
  box-shadow: 0 0 0 1px rgba(15,27,45,0.10);
}
.btn-secondary:hover {
  background: var(--tolv-subtle);
  text-decoration: none;
  color: var(--tolv-ink);
}

.btn-danger {
  background: var(--tolv-error);
  color: #FFFFFF;
}
.btn-danger:hover { opacity: 0.88; text-decoration: none; color: #FFFFFF; }

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-full);
}

/* ─────────────────────────────────────────────────────────────
   FORMS
   ───────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--tolv-ink);
  margin-bottom: 7px;
  letter-spacing: -0.01em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--tolv-paper);
  border: none;
  box-shadow: 0 0 0 1px rgba(15,27,45,0.10);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--tolv-ink);
  outline: none;
  transition: box-shadow var(--transition);
  appearance: none;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--tolv-mute); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  box-shadow: 0 0 0 2px var(--tolv-teal);
}
.form-textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.6;
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237A8597' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.form-id-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--tolv-teal-glow);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--tolv-teal-dark);
  margin-bottom: 20px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
}

/* ─────────────────────────────────────────────────────────────
   SEARCH DROPDOWN
   ───────────────────────────────────────────────────────────── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--tolv-paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  z-index: 2000;
  display: none;
  text-align: left;
}
.search-dropdown.visible { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid rgba(15,27,45,0.04);
  text-decoration: none;
  color: inherit;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--tolv-subtle); }

.search-result-id {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--tolv-teal-dark);
  background: var(--tolv-teal-glow);
  padding: 2px 6px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 600;
}

.search-result-title {
  font-size: 14px;
  color: var(--tolv-ink);
  font-weight: 500;
  flex: 1;
}

.search-result-category {
  font-size: 12px;
  color: var(--tolv-mute);
  white-space: nowrap;
}

.search-no-results {
  padding: 20px 16px;
  font-size: 14px;
  color: var(--tolv-ink-soft);
  text-align: center;
}

/* ─────────────────────────────────────────────────────────────
   EMPTY STATES
   ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
}

.empty-state-icon {
  margin-bottom: 16px;
  color: var(--tolv-line);
  display: flex;
  justify-content: center;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--tolv-ink);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.empty-state-desc {
  font-size: 14px;
  color: var(--tolv-ink-soft);
}

/* ─────────────────────────────────────────────────────────────
   ACKNOWLEDGEMENT & BADGES
   ───────────────────────────────────────────────────────────── */
.todo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--tolv-error);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  line-height: 1;
  margin-left: 6px;
}

.ack-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(30,203,216,0.10);
  border: 1px solid rgba(30,203,216,0.28);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: #0A8F9B;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  white-space: nowrap;
}
.ack-btn:hover { background: rgba(30,203,216,0.18); color: #0A7A84; border-color: rgba(30,203,216,0.45); }
.ack-btn.acknowledged {
  background: rgba(30,203,216,0.18);
  color: #0A7A84;
  border-color: rgba(30,203,216,0.4);
  cursor: default;
}
.ack-btn.acknowledged:hover { background: rgba(30,203,216,0.18); }

/* ─────────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ───────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--tolv-ink);
  color: var(--tolv-paper);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  z-index: 9999;
  transform: translateY(16px);
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
  max-width: 320px;
}
.toast.show    { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--tolv-teal-dark); }
.toast.error   { background: var(--tolv-error); }

/* ─────────────────────────────────────────────────────────────
   LOGIN PAGE (standalone)
   ───────────────────────────────────────────────────────────── */
.gate-overlay {
  position: fixed;
  inset: 0;
  background: var(--tolv-surface);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gate-box {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.gate-icon {
  width: 64px;
  height: 64px;
  background: var(--tolv-teal-tint);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--tolv-teal-dark);
}

.gate-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--tolv-ink);
  margin-bottom: 8px;
}

.gate-desc {
  font-size: 15px;
  color: var(--tolv-ink-soft);
  margin-bottom: 28px;
  line-height: 1.5;
}

.gate-input {
  width: 100%;
  height: 48px;
  background: var(--tolv-paper);
  border: none;
  box-shadow: 0 0 0 1px rgba(15,27,45,0.10);
  border-radius: var(--radius-md);
  padding: 0 16px;
  font-family: var(--font);
  font-size: 17px;
  text-align: center;
  letter-spacing: 0.1em;
  color: var(--tolv-ink);
  outline: none;
  margin-bottom: 16px;
  transition: box-shadow var(--transition);
}
.gate-input:focus { box-shadow: 0 0 0 2px var(--tolv-teal); }

.gate-error {
  font-size: 14px;
  color: var(--tolv-error);
  margin-top: 10px;
  min-height: 20px;
}

/* Login form extras */
.login-container {
  width: 100%;
  max-width: 400px;
  background: var(--tolv-paper);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
  padding: 40px;
  text-align: center;
}

.login-brand-mark {
  width: 48px;
  height: 48px;
  background: var(--tolv-teal);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  margin: 0 auto 20px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--tolv-ink);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 14px;
  color: var(--tolv-ink-soft);
  margin-bottom: 28px;
}

.login-error {
  font-size: 13px;
  color: var(--tolv-error-on);
  background: var(--tolv-error-bg);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
  display: none;
}

/* ─────────────────────────────────────────────────────────────
   LEGACY / COMPAT — old nav + page styles
   ───────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 var(--tolv-line);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 20px;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--tolv-ink);
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand:hover { text-decoration: none; }
.nav-spacer { flex: 1; }

.page-wrapper { padding-top: var(--nav-height); }

.category-page-content {
  flex: 1;
  min-width: 0;
  padding: 52px 64px 80px;
  max-width: 820px;
}

.category-page-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 8px;
}

.category-page-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--tolv-ink);
}

.category-page-desc {
  font-size: 16px;
  color: var(--tolv-ink-soft);
  margin-bottom: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(15,27,45,0.06);
  line-height: 1.6;
  max-width: 600px;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--tolv-paper);
  box-shadow: 1px 0 0 var(--tolv-line);
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  padding: 28px 0 48px;
}
.sidebar.collapsed { width: 0; overflow: hidden; padding: 0; }

.layout-with-sidebar { display: flex; min-height: calc(100vh - var(--nav-height)); }

/* ─────────────────────────────────────────────────────────────
   REDUCED MOTION
   ───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-row      { grid-template-columns: repeat(2, 1fr); }
  .cat-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .hub-stats-row  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .app-sidebar    { transform: translateX(-100%); transition: transform var(--transition); }
  .app-sidebar.open { transform: translateX(0); }
  .app-main       { margin-left: 0; }
  .stats-row      { grid-template-columns: repeat(2, 1fr); padding: 16px 20px; }
  .home-header    { padding: 24px 20px 0; }
  .home-section   { padding: 0 20px 24px; }
  .cat-cards-grid { grid-template-columns: 1fr; }
  .inner-page, .inner-page-full { padding: 24px 20px 60px; }
  .cat-page-content { padding: 24px 20px 60px; }
  .admin-inner    { padding: 24px 20px 60px; }
}

@media (max-width: 480px) {
  .stats-row     { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hub-stats-row { grid-template-columns: 1fr 1fr; }
}

/* ============================================================

/* ============================================================
   DASHBOARD — Home Page
   ============================================================ */

.app-main {
  background: linear-gradient(145deg, #F5F6FA 0%, #F8F9FC 60%, #F4F7FB 100%);
}

.dash-wrap {
  max-width: 1300px;
  margin: 0 auto;
  padding: 36px 32px 72px;
}

/* ── Page header ─────────────────────────────────────────── */
.dash-page-hd {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

/* AI Search button */
.ai-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  height: 46px;
  background: #2E3A4F;
  border: none;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  color: #FFFFFF;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s;
}
.ai-search-btn:hover {
  background: #1A2435;
  box-shadow: 0 4px 16px rgba(46,58,79,0.25);
}
.ai-search-badge {
  background: #1ECBD8;
  color: #0D1520;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 20px;
}

.dash-page-title {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 800;
  color: var(--tolv-ink);
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin: 0 0 4px;
}

.dash-page-date { font-size: 13px; color: var(--tolv-mute); }

/* ── Root: 4-row grid ────────────────────────────────────────
   Left col:  t1 | t2 | t3 | t4   (one tile per row)
   Right col: charts spans rows 1-2, recent spans rows 3-4
   ─────────────────────────────────────────────────────────── */
.dash-root {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: repeat(4, 1fr);
  grid-template-areas:
    "t1 charts"
    "t2 charts"
    "t3 recent"
    "t4 recent";
  gap: 18px;
  min-height: 600px;
}

/* ── Stat tiles ──────────────────────────────────────────── */
.dash-tile {
  border-radius: 18px;
  padding: 22px 20px 20px;
  box-shadow: 0 2px 16px rgba(15,27,45,0.07);
  transition: transform 0.18s, box-shadow 0.18s;
  cursor: default;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dash-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(15,27,45,0.11);
}

.dash-tile-1 { grid-area: t1; }
.dash-tile-2 { grid-area: t2; }
.dash-tile-3 { grid-area: t3; }
.dash-tile-4 { grid-area: t4; }

/* Tile colours — pastel backgrounds + saturated left accent */
.tile-teal   { background: #D4CEF0; border-left: 4px solid #5B4F8C; }  /* Purple Corallite */
.tile-green  { background: #FDC9E1; border-left: 4px solid #E0609A; }  /* Flamingo Pink    */
.tile-amber  { background: #B2EFF4; border-left: 4px solid #1ECBD8; }  /* Blue Curacao     */
.tile-purple { background: #F9C4C4; border-left: 4px solid #F07070; }  /* Porcelain Rose   */

/* Tile layout: icon top, label + value bottom */
.dash-tile {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
}

/* Icon container */
.tile-icon-wrap {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.tile-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Bottom row: label + value side by side */
.tile-text {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
}

.tile-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  max-width: 55%;
}

.tile-value {
  font-family: var(--font-display);
  font-size: 62px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

/* Text colours — dark hue-matched tones for legibility on pastels */
.tile-teal  .tile-label { color: rgba(55,42,120,0.72); }
.tile-teal  .tile-value { color: #3D2F7A; }
.tile-green .tile-label { color: rgba(140,30,80,0.72); }
.tile-green .tile-value { color: #8B1F52; }
.tile-amber .tile-label { color: rgba(10,100,112,0.72); }
.tile-amber .tile-value { color: #0A6470; }
.tile-purple .tile-label { color: rgba(140,40,40,0.72); }
.tile-purple .tile-value { color: #8C2828; }

/* ── Charts area (spans rows 1-2 on right) ───────────────── */
.dash-right {
  grid-area: charts;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

/* ── Recent articles (spans rows 3-4 on right) ───────────── */
.dash-recent-card {
  grid-area: recent;
  background: #FFFFFF;
  border-radius: 20px;
  border: 1px solid rgba(230,233,238,0.8);
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(15,27,45,0.05);
  display: flex;
  flex-direction: column;
}

/* ── Chart cards ─────────────────────────────────────────── */
.dash-chart-card {
  background: #FFFFFF;
  border-radius: 20px;
  border: 1px solid rgba(230,233,238,0.8);
  padding: 22px 22px 16px;
  box-shadow: 0 2px 20px rgba(15,27,45,0.05);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chart-card-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.chart-card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--tolv-ink);
}

.chart-card-sub { font-size: 12px; color: var(--tolv-mute); margin-top: 2px; }

/* Category filter pills */
.cat-filter-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.cat-filter-btn {
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--tolv-ink-soft);
  background: var(--tolv-surface);
  border: 1.5px solid var(--tolv-line);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
  line-height: 1.4;
}

.cat-filter-btn:hover { border-color: var(--tolv-teal); color: var(--tolv-teal); }

.cat-filter-btn.active {
  background: var(--tolv-teal);
  border-color: var(--tolv-teal-dark);
  color: #FFFFFF;
  font-weight: 600;
}

/* Period filter tabs */
.chart-filter-tabs {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
  background: #F1F3F6;
  border-radius: 10px;
  padding: 3px;
}

.filter-tab {
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--tolv-mute);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font);
  white-space: nowrap;
}

.filter-tab:hover { color: var(--tolv-ink); }

.filter-tab.active {
  background: #fff;
  color: var(--tolv-ink);
  font-weight: 600;
  box-shadow: 0 1px 6px rgba(15,27,45,0.09);
}

/* Canvas wrapper fills remaining card space */
.chart-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 80px;
}

.chart-empty-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--tolv-mute);
}

/* Recent articles header */
.dash-recent-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px 14px;
  border-bottom: 1px solid var(--tolv-line);
  flex-shrink: 0;
}

.dash-recent-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--tolv-ink);
}

.dash-recent-card .recent-article-list {
  flex: 1;
  overflow-y: auto;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1080px) {
  .dash-root { grid-template-columns: 190px 1fr; }
}

@media (max-width: 820px) {
  .dash-root {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "t1 t2"
      "charts charts"
      "t3 t4"
      "recent recent";
    grid-template-rows: auto auto auto auto;
  }
  .dash-right { grid-template-columns: 1fr; }
  .dash-page-title { font-size: 30px; }
  .dash-wrap { padding: 20px 16px 56px; }
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE — Full optimisation pass
   ───────────────────────────────────────────────────────────── */

/* ── Tile font scale ────────────────────────────────────────── */
@media (max-width: 1100px) {
  .tile-value { font-size: 50px; }
}

/* ── Navigation — wrap to two rows on mid-size screens ──────── */
@media (max-width: 720px) {
  .app-topnav { height: auto; }

  .nav-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 16px 6px;
    gap: 0;
  }

  /* Brand stays left, user+signout right on row 1 */
  .nav-brand { flex: 1; }
  .nav-right  { flex: 0 0 auto; }

  /* Nav links become row 2: full width, horizontal scroll */
  .nav-links {
    position: static;
    transform: none;
    order: 3;
    width: 100%;
    padding: 4px 0 6px;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .nav-links::-webkit-scrollbar { display: none; }

  /* Recalculate main height with taller nav */
  .app-main { min-height: calc(100vh - 90px); }
}

@media (max-width: 480px) {
  .nav-brand-name        { font-size: 13px; }
  .nav-link              { padding: 5px 10px; font-size: 13px; }
  .nav-right .sb-user-name { display: none; }
}

/* ── Dashboard ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .dash-root {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "t1 t2"
      "t3 t4"
      "charts charts"
      "recent recent";
    grid-template-rows: auto;
  }
  .dash-right        { grid-template-columns: 1fr; }
  .tile-value        { font-size: 40px; }
  .tile-icon-wrap    { width: 48px; height: 48px; }
  .dash-page-title   { font-size: 24px; }
  .dash-wrap         { padding: 16px 12px 48px; }
  .dash-page-hd      { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 400px) {
  .tile-value     { font-size: 30px; }
  .tile-icon-wrap { width: 38px; height: 38px; }
}

/* ── Category pages — sidebar stacks above content ────────── */
.cat-layout {
  display: flex;
  min-height: 100vh;
}

@media (max-width: 768px) {
  .cat-layout {
    flex-direction: column;
  }
  .cat-page-sidebar {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: none;
    border-right: none;
    border-bottom: 1px solid var(--tolv-line);
    padding: 12px 0 16px;
  }
  .cat-page-content {
    padding: 24px 20px 60px;
    max-width: 100%;
  }
}

/* ── Admin panel ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-inner    { padding: 20px 16px 60px; }
  .admin-wrapper  { padding: 24px 0 60px; }
  .admin-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tab-btn { white-space: nowrap; padding: 10px 14px; font-size: 13px; }

  /* Make admin tables horizontally scrollable */
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .admin-table    { min-width: 540px; }
  .analytics-table { min-width: 400px; }

  /* Admin header wraps */
  .admin-header-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .admin-title { font-size: 22px; }
}

/* ── Modals — bottom sheet on mobile ─────────────────────── */
@media (max-width: 600px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  .modal-header { padding: 24px 20px 0; }
  .modal-body   { padding: 16px 20px 28px; }
  .modal-title  { font-size: 20px; }
}

/* ── Take-check page ─────────────────────────────────────── */
@media (max-width: 600px) {
  .check-top-bar        { padding: 12px 16px; }
  .check-question-wrap  { padding: 24px 16px 60px; }
  .check-question-text  { font-size: 18px; }
  .check-option         { padding: 12px 14px; font-size: 14px; gap: 10px; }
  .check-result-card    { padding: 32px 16px; }
}

/* ── Knowledge Checks grid ───────────────────────────────── */
@media (max-width: 480px) {
  .checks-grid { grid-template-columns: 1fr; }
}

/* ── Inner pages (category, KB) ─────────────────────────── */
@media (max-width: 480px) {
  .page-title     { font-size: 22px; }
  .page-icon-wrap { width: 44px; height: 44px; }

  /* Search row stacks vertically */
  .cat-search-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .cat-search-row .ai-search-btn {
    width: 100%;
    justify-content: center;
    border-radius: 999px;
  }
}

/* ── KB landing page search row ─────────────────────────── */
@media (max-width: 600px) {
  .kb-search-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .kb-search-row .ai-search-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Stats row fallback ──────────────────────────────────── */
@media (max-width: 400px) {
  .stats-row { grid-template-columns: 1fr; }
}

/* ── Login page ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-container { padding: 28px 20px; }
  .gate-box        { padding: 0 8px; }
}

/* ══════════════════════════════════════════════════════════
   NAV USER CHIP + DROPDOWN
   ══════════════════════════════════════════════════════════ */
.nav-user-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.nav-user-chip:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.25); }

.nav-chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.nav-chip-avatar-img,
.sb-user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.nav-chip-name {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}
.nav-chip-caret {
  color: rgba(255,255,255,0.5);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.nav-user-chip.open .nav-chip-caret { transform: rotate(180deg); }

/* Dropdown */
.nav-chip-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 3000;
  overflow: hidden;
  padding: 4px 0;
}
.nav-user-chip.open .nav-chip-dropdown { display: block; }

.nav-chip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text-primary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.12s;
  text-align: left;
}
.nav-chip-item:hover { background: var(--color-bg-secondary); }
.nav-chip-item svg   { color: var(--color-text-tertiary); flex-shrink: 0; }

.nav-chip-signout       { color: var(--color-danger) !important; }
.nav-chip-signout svg   { color: var(--color-danger) !important; }
.nav-chip-signout:hover { background: rgba(239,68,68,0.06) !important; }

.nav-chip-divider {
  height: 1px;
  background: var(--color-border-light);
  margin: 4px 0;
}

/* Hide old sign-out button when chip is present */
.nav-signout-btn { display: none !important; }

/* ══════════════════════════════════════════════════════════
   PROFILE PAGE
   ══════════════════════════════════════════════════════════ */
.profile-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.profile-header {
  margin-bottom: 32px;
}
.profile-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}
.profile-header p {
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* Avatar upload zone */
.profile-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  padding: 20px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}
.profile-avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-info { flex: 1; }
.profile-avatar-info strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}
.profile-avatar-info span {
  font-size: 12.5px;
  color: var(--color-text-tertiary);
}
.profile-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-primary);
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.12s, border-color 0.12s;
}
.profile-avatar-btn:hover { background: var(--color-bg-secondary); border-color: var(--color-accent); }

/* Readonly fields */
.profile-readonly-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.profile-readonly-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.profile-readonly-value {
  font-size: 14px;
  color: var(--color-text-primary);
  padding: 9px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
}

/* Card section */
.profile-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}
.profile-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-light);
}

@media (max-width: 480px) {
  .profile-readonly-row { grid-template-columns: 1fr; }
  .profile-wrap { padding: 24px 16px 60px; }
}
