/* =====================================================================
   WORLD CAPITAL — Member Portal design system
   Pearl ivory · Metallic gold · Champagne borders · Glossy black
   Sections: 1 Tokens · 2 Base · 3 Shell · 4 Sidebar · 5 Topbar · 6 Page head
             7 Components · 8 Page modules · 9 Auth · 10 Motion · 11 Responsive
   ===================================================================== */

/* 1 ─ Tokens ─────────────────────────────────────────────────────────── */
:root {
  --ivory: #f7f3ea;
  --paper: #fffdf8;
  --cream: #fbf6ea;
  --gold: #c79a36;
  --champagne: #efd58e;
  --gold-deep: #8f671e;
  --black: #171411;
  --brown: #2b2115;
  --ink: #272117;
  --muted: #74695a;
  --line: #ebe1cb;
  --line-strong: #dccb9f;

  --success: #3f7a3a; --success-bg: #edf5e6;
  --warning: #9a6a12; --warning-bg: #fcf1d8;
  --danger:  #a63b25; --danger-bg:  #fbe9e4;
  --info:    #2f5f86; --info-bg:    #e8f0f7;

  --grad-gold: linear-gradient(110deg, #b0802a 0%, #e8c46c 35%, #fbe7a9 52%, #d4a74a 72%, #a87a24 100%);
  --grad-gold-soft: linear-gradient(135deg, #f6e5b4, #c79a36 55%, #efd58e);
  --grad-dark: linear-gradient(140deg, #2b2115 0%, #171411 65%);

  --shadow-xs: 0 2px 6px rgba(50, 36, 12, .05);
  --shadow-sm: 0 6px 18px rgba(50, 36, 12, .07);
  --shadow: 0 16px 40px rgba(50, 36, 12, .11);
  --shadow-gold: 0 14px 34px rgba(199, 154, 54, .24);

  --r-lg: 18px; --r: 14px; --r-sm: 10px;
  --sb-w: 272px; --sb-w-collapsed: 84px; --tb-h: 76px;
  --pad: clamp(16px, 2.4vw, 32px);
  --gap: 22px;
  --ease: cubic-bezier(.22, .8, .24, 1);

  --font-display: "Playfair Display", Georgia, serif;
  --font-brand: "Cinzel", Georgia, serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.density-compact { --gap: 14px; --pad: clamp(12px, 1.8vw, 22px); }

/* 2 ─ Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
/* Playfair Display defaults to old-style figures (digits of mixed height, e.g. "$114.88").
   Force lining figures everywhere so amounts sit on one even height. Uses font-feature-settings
   (not font-variant-numeric) so it combines with the existing tabular-nums rules and survives
   the `font:` shorthand used on headings/amounts. */
*, *::before, *::after { font-feature-settings: "lnum" 1 !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  font: 15px/1.6 var(--font-body); color: var(--ink);
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(239, 213, 142, .25), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(239, 213, 142, .18), transparent 70%),
    var(--ivory);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--champagne); color: var(--black); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gold-icon .icon, .icon.gold { stroke: url(#goldStroke); }
.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0 !important; }

.skip-link { position: fixed; left: 12px; top: -60px; z-index: 999; padding: 10px 16px; border-radius: 8px; background: var(--black); color: var(--champagne); font-weight: 600; transition: top .2s; }
.skip-link:focus { top: 12px; }

/* Page loader bar */
.page-loader { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000; pointer-events: none; }
.page-loader span { display: block; height: 100%; width: 0; background: var(--grad-gold); box-shadow: 0 0 10px rgba(199, 154, 54, .7); }
.is-leaving .page-loader span { width: 80%; transition: width 1.6s cubic-bezier(.1, .7, .2, 1); }

/* 3 ─ App shell ─────────────────────────────────────────────────────── */
.app { min-height: 100vh; }
.app-main {
  margin-left: var(--sb-w); min-height: 100vh; display: flex; flex-direction: column;
  transition: margin-left .45s var(--ease);
}
.sb-collapsed .app-main { margin-left: var(--sb-w-collapsed); }
.content { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 26px var(--pad) 40px; outline: none; }

/* 4 ─ Sidebar ───────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 80; width: var(--sb-w);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #fffdf8 0%, #f8f1e1 100%);
  border-right: 1px solid var(--line-strong);
  box-shadow: 6px 0 30px rgba(50, 36, 12, .06);
  transition: width .45s var(--ease), transform .45s var(--ease);
}
.sidebar::after { /* champagne edge highlight */
  content: ""; position: absolute; top: 0; bottom: 0; right: -1px; width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold) 30%, var(--champagne) 60%, transparent);
}
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 92px; padding: 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.sb-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.sb-brand img { width: 50px; height: 50px; flex: none; object-fit: contain; transition: transform .6s var(--ease); }
.sb-brand:hover img { transform: rotate(-8deg) scale(1.05); }
.sb-brand-text { font: 800 15px/1.1 var(--font-brand); letter-spacing: 1.2px; color: var(--black); white-space: nowrap; transition: opacity .3s; }
.sb-brand-text small { display: block; margin-top: 5px; font: 700 9.5px var(--font-body); letter-spacing: 2px; text-transform: uppercase; color: var(--gold-deep); }
.sb-head { height: auto; min-height: 92px; padding-top: 12px; padding-bottom: 12px; }
.sb-brand-text { min-width: 0; }
.sb-member { display: grid; gap: 1px; margin-top: 7px; padding-top: 6px; border-top: 1px dashed var(--line-strong); max-width: 170px; letter-spacing: 0; }
.sb-member b, .sb-member i { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; }
.sb-member b { font: 700 14px/1.25 var(--font-display); color: var(--gold-deep); }
.sb-member i { font: 600 12.5px/1.3 var(--font-body); color: var(--black); }
.sb-close { display: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--paper); cursor: pointer; place-items: center; }
.sb-close .icon { width: 18px; height: 18px; }

.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 14px 16px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sb-group { margin: 16px 10px 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #a8987a; white-space: nowrap; height: 14px; position: relative; }
.sb-group span { transition: opacity .25s; }
.sb-group::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 1px; margin-left: -10px; background: var(--line-strong); opacity: 0; transition: opacity .25s; }
.sb-nav ul { display: grid; gap: 4px; }
.sb-link {
  position: relative; display: flex; align-items: center; gap: 13px; min-height: 46px; padding: 11px 14px;
  border-radius: 12px; color: #4f4430; font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition: background-color .3s, color .3s, box-shadow .35s var(--ease), transform .35s var(--ease);
}
.sb-icon { width: 20px; height: 20px; color: var(--gold-deep); transition: transform .4s var(--ease), color .3s; }
.sb-label { transition: opacity .25s; }
.sb-link:hover { background: rgba(239, 213, 142, .28); color: var(--black); }
.sb-link:hover .sb-icon { transform: scale(1.12) rotate(-6deg); }
.sb-link.is-active {
  background: var(--grad-gold); background-size: 200% 100%; color: #1b150c;
  box-shadow: 0 8px 20px rgba(167, 123, 42, .28), inset 0 1px 0 rgba(255, 255, 255, .55);
  animation: goldShift 8s ease-in-out infinite;
}
.sb-link.is-active .sb-icon { color: #2b2115; }
.sb-link.is-active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--black); }
.sb-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--black); color: var(--champagne); }

.sb-foot { flex: none; padding: 12px 14px 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.sb-help {
  display: flex; gap: 12px; padding: 16px; border-radius: 14px; color: #f3e5bf;
  background: radial-gradient(circle at 100% 0%, rgba(199, 154, 54, .4), transparent 60%), var(--grad-dark);
  border: 1px solid rgba(199, 154, 54, .5); overflow: hidden;
}
.sb-help-icon { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(199, 154, 54, .6); color: var(--champagne); }
.sb-help-icon .icon { width: 18px; height: 18px; }
.sb-help-text { display: grid; gap: 3px; font-size: 12.5px; color: #cdbf9f; min-width: 0; }
.sb-help-text strong { color: #f6e7c1; font-size: 13.5px; }
.sb-help-text a { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--champagne); font-weight: 700; }
.sb-help-text a .icon { width: 14px; height: 14px; transition: transform .3s; }
.sb-help-text a:hover .icon { transform: translateX(3px); }
.sb-logout .sb-icon { color: var(--danger); }
.sb-logout:hover { background: var(--danger-bg); }

/* Collapsed desktop mode */
@media (min-width: 1025px) {
  .sb-collapsed .sidebar { width: var(--sb-w-collapsed); }
  .sb-collapsed .sb-head { padding: 0 17px; }
  .sb-collapsed .sb-brand-text, .sb-collapsed .sb-label, .sb-collapsed .sb-group span, .sb-collapsed .sb-help { opacity: 0; pointer-events: none; }
  .sb-collapsed .sb-help { display: none; }
  .sb-collapsed .sb-group::after { opacity: 1; }
  .sb-collapsed .sb-link { justify-content: center; padding: 11px; gap: 0; min-width: 0; }
  /* Hidden text must not take space: otherwise each icon is centred with its invisible label
     (icons drift) and the menu column grows to the longest label (active pill wider than the bar). */
  .sb-collapsed .sb-label, .sb-collapsed .sb-brand-text { width: 0; max-width: 0; overflow: hidden; }
  .sb-collapsed .sb-brand { gap: 0; }
  .sb-collapsed .sb-nav ul { grid-template-columns: minmax(0, 1fr); }
  .sb-collapsed .sb-badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px; }
  .sb-collapsed .sb-link::after { /* tooltip */
    content: attr(data-tooltip); position: absolute; left: calc(100% + 14px); top: 50%; z-index: 5;
    padding: 7px 12px; border-radius: 8px; background: var(--black); color: var(--champagne);
    font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: none;
    opacity: 0; transform: translate(-6px, -50%); transition: opacity .2s, transform .25s var(--ease);
    box-shadow: var(--shadow);
  }
  .sb-collapsed .sb-link:hover::after, .sb-collapsed .sb-link:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
  .sb-collapsed .sb-nav { overflow: visible; }
}
.sidebar-overlay { display: none; }

/* 5 ─ Topbar ────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 60; height: var(--tb-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--pad);
  background: rgba(255, 253, 248, .88);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.topbar::before { /* gold skyline accent, as in the brand reference */
  content: ""; position: absolute; right: 0; bottom: 0; width: min(520px, 50%); height: 64px; z-index: -1; pointer-events: none;
  background: url("../images/skyline.svg") right bottom / auto 100% no-repeat; opacity: .38;
  -webkit-mask: linear-gradient(90deg, transparent, #000 40%); mask: linear-gradient(90deg, transparent, #000 40%);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), var(--champagne), var(--gold), transparent); opacity: .7; }
.tb-left, .tb-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-logo { display: none; }
.tb-logo img { width: 50px; height: 50px; object-fit: contain; }
.tb-mobile-id { display: none; min-width: 0; text-align: center; color: var(--black); font: 700 15px/1.3 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-mobile-id strong { font-weight: 700; }
.tb-mobile-id span { color: var(--gold-deep); font-size: 14px; }
.tb-welcome { display: grid; min-width: 0; }
.tb-hello { font: 600 20px/1.2 var(--font-display); color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-hello strong { color: var(--gold-deep); }
.tb-id { display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tb-id .icon { width: 15px; height: 15px; color: var(--gold); }

.icon-btn {
  position: relative; width: 44px; height: 44px; flex: none; border-radius: 12px; cursor: pointer;
  display: grid; place-items: center; border: 1px solid var(--line-strong); background: var(--paper); color: var(--brown);
  transition: border-color .3s, box-shadow .3s, transform .3s var(--ease), background-color .3s;
}
.icon-btn:hover { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(199, 154, 54, .12); transform: translateY(-1px); }
.icon-btn .icon { width: 20px; height: 20px; }
.tb-menu { display: none; }
.tb-collapse .icon { transition: transform .45s var(--ease); }
.sb-collapsed .tb-collapse .icon { transform: scaleX(-1); }
.tb-bell:hover .icon { animation: ring .7s ease; }
@keyframes ring { 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
.dot-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--grad-gold); color: #1b150c; border: 2px solid var(--paper); }
.dot-count::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; border: 1px solid var(--gold); animation: pulse 2.2s ease-out infinite; }
@keyframes pulse { from { opacity: .9; transform: scale(.85); } to { opacity: 0; transform: scale(1.5); } }

.demo-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .4px; color: var(--gold-deep); background: rgba(239, 213, 142, .3); border: 1px dashed var(--gold); }
.demo-chip .icon { width: 15px; height: 15px; }

.tb-profile { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--paper); cursor: pointer; transition: border-color .3s, box-shadow .3s; }
.tb-profile:hover, .tb-profile[aria-expanded="true"] { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(199, 154, 54, .12); }
.tb-profile img { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--gold); }
.tb-profile-text { display: grid; text-align: left; line-height: 1.25; }
.tb-profile-text strong { font-size: 14px; white-space: nowrap; }
.tb-profile-text small { font-size: 12px; color: var(--success); font-weight: 600; }
.tb-caret { width: 16px; height: 16px; color: var(--muted); transition: transform .3s var(--ease); }
.tb-profile[aria-expanded="true"] .tb-caret { transform: rotate(180deg); }

/* Dropdowns */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 90; min-width: 250px;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r);
  box-shadow: 0 24px 60px rgba(50, 36, 12, .18); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98); transform-origin: top right;
  transition: opacity .25s, transform .3s var(--ease), visibility 0s linear .3s;
}
.dropdown-menu::before { content: ""; position: absolute; top: -7px; right: 18px; width: 12px; height: 12px; background: var(--paper); border-left: 1px solid var(--line-strong); border-top: 1px solid var(--line-strong); transform: rotate(45deg); }
.dropdown.is-open .dropdown-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .3s var(--ease), visibility 0s; }
.dropdown-menu > a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; font-size: 14px; font-weight: 500; transition: background-color .2s, color .2s; }
.dropdown-menu > a .icon { width: 18px; height: 18px; color: var(--gold-deep); }
.dropdown-menu > a:hover { background: var(--cream); color: var(--black); }
.dropdown-menu > a.dd-logout { color: var(--danger); border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; margin-top: 4px; }
.dropdown-menu > a.dd-logout .icon { color: var(--danger); }
.dd-user { display: flex; gap: 12px; align-items: center; padding: 10px 12px 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.dd-user img { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gold); }
.dd-user div { display: grid; min-width: 0; }
.dd-user strong { font-size: 15px; }
.dd-user small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.dd-notifications { width: 360px; padding: 0; }
.dd-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dd-list { max-height: 330px; overflow-y: auto; padding: 6px; }
.dd-note { display: flex; gap: 12px; padding: 10px; border-radius: 10px; transition: background-color .2s; position: relative; }
.dd-note:hover { background: var(--cream); }
.dd-note.is-unread::after { content: ""; position: absolute; right: 12px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--champagne); }
.dd-note-icon { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--grad-dark); color: var(--champagne); }
.dd-note-icon .icon { width: 17px; height: 17px; }
.dd-note-text { display: grid; padding-right: 14px; }
.dd-note-text strong { font-size: 13.5px; font-weight: 600; }
.dd-note-text small { font-size: 12px; color: var(--muted); }
.dd-foot { display: flex !important; justify-content: center; gap: 6px; padding: 13px !important; border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r) !important; font-weight: 700 !important; color: var(--gold-deep); }
.dd-foot .icon { width: 16px !important; height: 16px !important; }

/* 6 ─ Page head ─────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font: 700 clamp(26px, 3vw, 34px)/1.15 var(--font-display); color: var(--black); margin-top: 8px; }
.page-head p { margin-top: 6px; color: var(--muted); max-width: 640px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.breadcrumb ol { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.breadcrumb li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb li, .page-head-text { min-width: 0; }
.breadcrumb [aria-current], .page-head-text h1 { overflow-wrap: anywhere; } /* long IDs (journal entry, order no.) wrap on phones */
.breadcrumb a { display: inline-flex; color: var(--gold-deep); transition: color .2s; }
.breadcrumb a:hover { color: var(--black); }
.breadcrumb .icon { width: 15px; height: 15px; }
.breadcrumb .crumb-sep { width: 13px; height: 13px; color: #b9a988; }
.breadcrumb [aria-current] { color: var(--ink); }

/* 7 ─ Components ────────────────────────────────────────────────────── */
/* Grid */
.grid { display: grid; gap: var(--gap); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.stack { display: grid; gap: var(--gap); align-content: start; }
.mb { margin-bottom: var(--gap); }

/* Cards */
.card {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs); transition: box-shadow .4s var(--ease), border-color .4s, transform .4s var(--ease);
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-gold); border-color: var(--line-strong); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-title { display: flex; align-items: center; gap: 10px; font: 700 18px var(--font-display); color: var(--black); }
.card-title .icon { width: 20px; height: 20px; color: var(--gold); }
.card-body { padding: 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.card-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--gold-deep); }
.card-link .icon { width: 15px; height: 15px; transition: transform .3s; }
.card-link:hover .icon { transform: translateX(3px); }
.card-gold { border-color: rgba(199, 154, 54, .55); background: linear-gradient(150deg, #fffdf8, #f8eedb); }
.card-gold::after { content: ""; position: absolute; top: 0; left: 22px; right: 22px; height: 2px; background: var(--grad-gold-soft); border-radius: 0 0 4px 4px; }
.card-dark { background: radial-gradient(circle at 100% 0%, rgba(199, 154, 54, .35), transparent 55%), var(--grad-dark); color: #f3e5bf; border-color: rgba(199, 154, 54, .5); }
.card-dark .card-title { color: #fbecc4; }
.card-dark .card-head, .card-dark .card-foot, .card-dark .list-rows > li { border-color: rgba(239, 213, 142, .15); }
.card-dark .list-rows strong { color: #fbecc4; }
.card-dark .list-rows small, .card-dark p { color: #cdbf9f; }

/* Animated gold border */
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.glow-border::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--angle), transparent 0deg, #fff0bd 50deg, #c79a36 90deg, transparent 150deg, transparent 220deg, #efd58e 280deg, transparent 340deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: borderSpin 7s linear infinite;
}
@keyframes borderSpin { to { --angle: 360deg; } }

/* Icon tile */
.tile-icon { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; position: relative; background: radial-gradient(circle at 30% 25%, #4a3920, #171411 72%); border: 1px solid rgba(199, 154, 54, .65); box-shadow: 0 0 0 4px rgba(199, 154, 54, .08); transition: transform .45s var(--ease), box-shadow .45s; }
.tile-icon .icon { width: 22px; height: 22px; stroke: url(#goldStroke); stroke-width: 1.6; }
.tile-icon-light { background: linear-gradient(145deg, #fffaf0, #f3e6c6); border-color: var(--line-strong); }
.tile-icon-light .icon { stroke: var(--gold-deep); }
.card-hover:hover .tile-icon { transform: rotate(-6deg) scale(1.05); box-shadow: 0 0 0 5px rgba(199, 154, 54, .14), 0 0 22px rgba(239, 213, 142, .55); }

/* Buttons */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 12px; border: 1px solid transparent;
  font-size: 14px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .3s, border-color .3s, color .3s;
}
.btn .icon { width: 17px; height: 17px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-lg { min-height: 52px; padding: 13px 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-gold { background: var(--grad-gold); background-size: 200% 100%; color: #1b150c; border-color: #b98a2e; box-shadow: 0 6px 16px rgba(167, 123, 42, .25), inset 0 1px 0 rgba(255, 255, 255, .55); }
.btn-gold::after, .btn-dark::after { content: ""; position: absolute; inset: -2px auto -2px -60%; width: 45%; z-index: -1; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent); transform: skewX(-20deg); transition: left .7s var(--ease); }
.btn-dark::after { background: linear-gradient(100deg, transparent, rgba(239, 213, 142, .35), transparent); }
.btn-gold:hover:not(:disabled), .btn-dark:hover:not(:disabled) { transform: translateY(-2px); }
.btn-gold:hover:not(:disabled) { background-position: 100% 50%; box-shadow: 0 12px 26px rgba(167, 123, 42, .38); }
.btn-gold:hover::after, .btn-dark:hover::after { left: 120%; }
.btn-dark { background: var(--grad-dark); color: var(--champagne); border-color: rgba(199, 154, 54, .75); box-shadow: 0 6px 16px rgba(23, 20, 17, .2); }
.btn-dark:hover:not(:disabled) { border-color: var(--champagne); box-shadow: 0 12px 26px rgba(23, 20, 17, .3), 0 0 16px rgba(199, 154, 54, .25); }
.btn-outline { background: var(--paper); color: #4d3a16; border-color: var(--line-strong); }
.btn-outline:hover:not(:disabled) { border-color: var(--gold); background: var(--cream); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--gold-deep); }
.btn-ghost:hover:not(:disabled) { background: rgba(239, 213, 142, .25); }
.btn-danger-outline { background: var(--paper); color: var(--danger); border-color: #e7b8ab; }
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-bg); border-color: var(--danger); }
.btn .spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(27, 21, 12, .25); border-top-color: currentColor; animation: spin .7s linear infinite; }
.btn.is-loading { pointer-events: none; }
.is-submitting { pointer-events: none; opacity: .65; cursor: progress; }
.btn.is-loading .spinner { display: block; }
.btn.is-loading .btn-text, .btn.is-loading > .icon { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.3; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge-info    { background: var(--info-bg); color: var(--info); }
.badge-muted   { background: #f0ebe0; color: #7a6f5e; }
.badge-gold    { background: var(--grad-gold); color: #1b150c; }
.badge-gold::before { display: none; }

/* Alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; font-size: 14px; border: 1px solid; }
.alert .icon { width: 19px; height: 19px; margin-top: 1px; }
.alert-info { background: #fbf4e2; border-color: #ead39a; color: #5b4416; }
.alert-info .icon { color: var(--gold); }
.alert-danger { background: var(--danger-bg); border-color: #ecbcae; color: #7c2c18; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 7px; align-content: start; }
.field > label, .label { font-size: 13px; font-weight: 700; color: #4f4430; }
.field > label .req { color: var(--danger); }
.field-hint { font-size: 12.5px; color: var(--muted); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .icon { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--gold); pointer-events: none; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: #fffefa; color: var(--ink); font-size: 15px; outline: none;
  transition: border-color .25s, box-shadow .25s, background-color .25s;
}
.input-wrap > .icon ~ .input, .input-wrap > .icon ~ .select { padding-left: 44px; }
.input::placeholder, .textarea::placeholder { color: #ab9f8a; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(199, 154, 54, .16); background: #fff; }
.input[readonly] { background: var(--cream); color: var(--muted); }
.select { appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f671e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; }
.textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
.pw-toggle { position: absolute; right: 6px; width: 38px; height: 38px; border: 0; background: none; border-radius: 9px; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.pw-toggle:hover { color: var(--gold-deep); background: var(--cream); }
.pw-toggle .icon { width: 18px; height: 18px; }
.input-wrap .pw-toggle ~ .input, .input-wrap .input:has(~ .pw-toggle) { padding-right: 48px; }
.field-error { font-size: 12.5px; color: var(--danger); min-height: 0; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(166, 59, 37, .1); }
.field.is-valid .input, .field.is-valid .textarea { border-color: #b8a05e; }
.field.has-error { animation: shake .35s ease; }
@keyframes shake { 25%, 75% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; padding-top: 6px; }

.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--gold); flex: none; }
.check a { color: var(--gold-deep); font-weight: 700; }

/* Toggle switch */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; padding-bottom: 0; }
.switch-row:first-child { padding-top: 0; }
.switch-text { display: grid; gap: 2px; }
.switch-text strong { font-size: 14.5px; }
.switch-text span { font-size: 13px; color: var(--muted); }
.switch { position: relative; width: 50px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #e2d8c3; border: 1px solid var(--line-strong); transition: background-color .3s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .2); transition: transform .35s var(--ease); }
.switch input:checked + span { background: var(--grad-gold); border-color: #b98a2e; }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 4px rgba(199, 154, 54, .3); }

/* Option cards (radio) */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.option { position: relative; cursor: pointer; }
.option input { position: absolute; opacity: 0; }
.option span { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fffefa; text-align: center; font-size: 13.5px; font-weight: 600; transition: border-color .25s, box-shadow .25s, background-color .25s; }
.option span .icon { width: 22px; height: 22px; color: var(--gold-deep); }
.option input:checked + span { border-color: var(--gold); background: linear-gradient(150deg, #fffdf8, #f8eedb); box-shadow: 0 0 0 3px rgba(199, 154, 54, .18); }
.option input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Tabs */
.tabs { display: flex; gap: 6px; padding: 5px; border-radius: 14px; background: #f1e9d6; border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
a.tab { text-decoration: none; }
.tab { position: relative; flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 16px; border: 0; border-radius: 10px; background: transparent; font-size: 14px; font-weight: 600; color: #5e5039; cursor: pointer; transition: background-color .25s, color .25s, box-shadow .25s; }
.tab .icon { width: 16px; height: 16px; }
.tab:hover { text-decoration: none; color: var(--black); background: rgba(255, 253, 248, .6); }
.tab[aria-selected="true"], a.tab[aria-current="page"] { background: var(--grad-gold); color: #1b150c; box-shadow: 0 4px 12px rgba(167, 123, 42, .25); }
.tab .count { min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; background: rgba(23, 20, 17, .08); }
.tab[aria-selected="true"] .count, a.tab[aria-current="page"] .count { background: rgba(23, 20, 17, .85); color: var(--champagne); }
.tab-panel[hidden] { display: none; }
.tab-panel { animation: fadeUp .45s var(--ease) both; }

/* Tables (become cards on mobile) */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #8b7d63; background: #faf4e6; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background-color .2s; }
.table tbody tr:hover { background: #fdf8ec; }
.table tbody tr:last-child td { border-bottom: 0; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main strong { display: block; font-weight: 600; }
.cell-main small { display: block; color: var(--muted); font-size: 12.5px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.mini-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--paper); display: grid; place-items: center; cursor: pointer; color: var(--gold-deep); transition: all .25s; }
.mini-btn:hover { border-color: var(--gold); background: var(--cream); transform: translateY(-1px); }
.mini-btn .icon { width: 16px; height: 16px; }
.mini-btn.danger { color: var(--danger); }
.mini-btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); }

/* Timeline */
.timeline { position: relative; display: grid; gap: 4px; }
.timeline::before { content: ""; position: absolute; left: 21px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(180deg, var(--gold), var(--line) 85%); }
.tl-item { position: relative; display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 10px 0; }
.tl-dot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; z-index: 1; background: var(--paper); border: 2px solid var(--gold); color: var(--gold-deep); box-shadow: 0 0 0 4px var(--paper); transition: transform .35s var(--ease), background-color .3s; }
.tl-dot .icon { width: 18px; height: 18px; }
.tl-item:hover .tl-dot { transform: scale(1.08); background: var(--cream); }
.tl-body strong { display: block; font-weight: 600; }
.tl-body small { color: var(--muted); font-size: 13px; }
.tl-time { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.tl-date { position: relative; z-index: 1; display: inline-block; margin: 14px 0 6px; padding: 4px 12px; border-radius: 999px; background: var(--black); color: var(--champagne); font-size: 12px; font-weight: 700; letter-spacing: .6px; justify-self: start; }

/* Progress */
.progress { height: 8px; border-radius: 999px; background: #efe6d2; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad-gold); transition: width 1.4s var(--ease); }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; position: relative; background: conic-gradient(var(--gold) calc(var(--p) * 1%), #efe6d2 0); transition: --p 1.4s var(--ease); }
.ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--paper); }
.ring strong { position: relative; font: 700 26px var(--font-display); color: var(--black); }
.ring small { position: absolute; bottom: 30px; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
@property --p { syntax: "<number>"; initial-value: 0; inherits: false; }

/* Lists */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.kv-item { display: flex; gap: 14px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.kv-item .tile-icon { width: 42px; height: 42px; border-radius: 12px; }
.kv-item .tile-icon .icon { width: 19px; height: 19px; margin: 10px; }
.kv-item div { min-width: 0; }
.kv-item small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #9a8c72; }
.kv-item span { display: block; font-weight: 600; overflow-wrap: anywhere; }

.list-rows > li { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list-rows > li:last-child { border-bottom: 0; padding-bottom: 0; }
.list-rows > li:first-child { padding-top: 0; }
.list-rows .grow { flex: 1; min-width: 0; }
.list-rows strong { display: block; font-weight: 600; font-size: 14.5px; }
.list-rows small { display: block; color: var(--muted); font-size: 12.5px; }

/* Empty state */
.empty { display: grid; justify-items: center; gap: 10px; padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .tile-icon { width: 64px; height: 64px; border-radius: 50%; }
.empty strong { color: var(--ink); font-size: 16px; }

/* Skeleton */
.skeleton-host .skeleton { display: none; }
.skeleton-host.is-loading .skeleton { display: block; }
.skeleton-host.is-loading .skeleton-content { display: none; }
.sk-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; }
.sk { border-radius: 8px; background: linear-gradient(90deg, #f1e9d6 0%, #fbf6ea 50%, #f1e9d6 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk-circle { width: 42px; height: 42px; border-radius: 50%; flex: none; }
.sk-lines { flex: 1; display: grid; gap: 8px; }
.sk-line { height: 11px; }
.sk-line.w60 { width: 60%; } .sk-line.w40 { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; visibility: hidden; pointer-events: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(23, 20, 17, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s; }
.modal-dialog { position: relative; width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--paper); border-radius: 20px; border: 1px solid rgba(199, 154, 54, .55); box-shadow: 0 40px 90px rgba(23, 20, 17, .35); opacity: 0; transform: translateY(20px) scale(.97); transition: opacity .3s, transform .4s var(--ease); }
.modal-dialog.modal-lg { width: min(760px, 100%); }
.modal.is-open { visibility: visible; pointer-events: auto; }
.modal.is-open .modal-backdrop { opacity: 1; }
.modal.is-open .modal-dialog { opacity: 1; transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 700 20px var(--font-display); }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-close { width: 38px; height: 38px; }
.preview-frame { aspect-ratio: 4 / 3; border-radius: 14px; display: grid; place-items: center; gap: 10px; text-align: center; color: var(--muted); background: repeating-linear-gradient(45deg, #faf4e6 0 12px, #f5ecd7 12px 24px); border: 1px dashed var(--line-strong); }
.preview-frame .tile-icon { width: 70px; height: 70px; border-radius: 18px; }
.preview-frame .tile-icon .icon { width: 32px; height: 32px; }

/* Toasts */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--grad-dark); color: #f3e5bf; border: 1px solid rgba(199, 154, 54, .6); box-shadow: 0 20px 50px rgba(23, 20, 17, .35); animation: toastIn .45s var(--ease) both; }
.toast.is-leaving { animation: toastOut .35s ease forwards; }
.toast > .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--champagne); }
.toast.success > .icon { color: #9fd08c; }
.toast.error > .icon { color: #f0a08c; }
.toast-text { flex: 1; font-size: 14px; line-height: 1.5; }
.toast-text strong { display: block; color: #fbecc4; }
.toast-close { background: none; border: 0; color: #b9a988; cursor: pointer; padding: 2px; border-radius: 6px; }
.toast-close .icon { width: 16px; height: 16px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* Footer */
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; padding: 18px var(--pad); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); background: rgba(255, 253, 248, .6); }
.footer-note { display: inline-flex; align-items: center; gap: 6px; }
.footer-note .icon { width: 15px; height: 15px; color: var(--gold); }
.app-footer nav { display: flex; gap: 18px; }
.app-footer a { font-weight: 600; color: var(--gold-deep); }
.app-footer a:hover { color: var(--black); }

/* 8 ─ Page modules ──────────────────────────────────────────────────── */
/* Welcome banner */
.welcome {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: clamp(22px, 3vw, 34px); border-radius: 22px; color: #f6e7c1;
  background: radial-gradient(circle at 85% 10%, rgba(199, 154, 54, .45), transparent 45%), var(--grad-dark);
  border: 1px solid rgba(199, 154, 54, .55); box-shadow: 0 24px 50px rgba(23, 20, 17, .22);
}
.welcome::before { content: ""; position: absolute; right: 0; bottom: 0; width: 60%; height: 80px; background: url("../images/skyline.svg") right bottom / auto 100% no-repeat; opacity: .16; pointer-events: none; -webkit-mask: linear-gradient(90deg, transparent, #000 50%); mask: linear-gradient(90deg, transparent, #000 50%); }
.welcome::after { content: ""; position: absolute; top: -60%; left: -30%; width: 35%; height: 220%; background: linear-gradient(100deg, transparent, rgba(255, 240, 190, .12), transparent); transform: rotate(18deg); animation: sheen 9s ease-in-out infinite 1.5s; pointer-events: none; }
@keyframes sheen { 0%, 70% { left: -30%; } 100% { left: 130%; } }
.welcome-main { position: relative; display: flex; align-items: center; gap: 20px; min-width: 0; }
.welcome-avatar { position: relative; flex: none; }
.welcome-avatar img { width: 84px; height: 84px; border-radius: 50%; border: 3px solid var(--gold); box-shadow: 0 0 0 6px rgba(199, 154, 54, .18); }
.welcome-avatar .online { position: absolute; right: 4px; bottom: 4px; width: 16px; height: 16px; border-radius: 50%; background: #6cc25a; border: 3px solid #1d1812; }
.welcome h2 { font: 700 clamp(22px, 2.6vw, 30px) var(--font-display); color: #fff6dc; }
.welcome h2 span { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.welcome p { margin-top: 6px; color: #cdbf9f; font-size: 14.5px; }
.welcome-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .06); border: 1px solid rgba(239, 213, 142, .3); color: #f1deb0; }
.pill .icon { width: 14px; height: 14px; color: var(--champagne); }
.pill button { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; display: inline-flex; }
.welcome-actions { position: relative; display: flex; gap: 10px; flex-wrap: wrap; }

/* Stat tiles (non-financial) */
.stat { display: flex; gap: 16px; align-items: center; padding: 20px; }
.stat-text { display: grid; min-width: 0; }
.stat-text small { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #9a8c72; }
.stat-text strong { font: 700 26px/1.2 var(--font-display); color: var(--black); }
.stat-text span { font-size: 12.5px; color: var(--muted); }

/* Dashboard (member business overview) */
.dash-hero {
  overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: clamp(20px, 2.6vw, 30px); border-radius: 22px; border: 1.5px solid rgba(199, 154, 54, .6);
  background: radial-gradient(circle at 100% 0%, rgba(239, 213, 142, .45), transparent 50%), linear-gradient(150deg, #fffdf8, #f8eedb);
  box-shadow: var(--shadow-sm);
}
.dash-hero::before { content: ""; position: absolute; right: 0; bottom: 0; width: 55%; height: 90px; background: url("../images/skyline.svg") right bottom / auto 100% no-repeat; opacity: .12; pointer-events: none; -webkit-mask: linear-gradient(90deg, transparent, #000 50%); mask: linear-gradient(90deg, transparent, #000 50%); }
.dash-hero-main { position: relative; display: flex; align-items: center; gap: 22px; min-width: 0; }
.dash-avatar { flex: none; padding: 4px; border-radius: 50%; background: var(--grad-gold); box-shadow: var(--shadow-gold); }
.dash-avatar img { width: 96px; height: 96px; border-radius: 50%; border: 3px solid var(--black); background: var(--black); }
.dash-hero-text h2 { display: flex; align-items: center; gap: 8px; font: 700 clamp(22px, 2.6vw, 30px) var(--font-display); color: var(--black); }
.dash-copy { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--gold-deep); cursor: pointer; transition: background-color .25s; }
.dash-copy:hover { background: var(--cream); }
.dash-copy .icon { width: 15px; height: 15px; }
.dash-ref { margin-top: 8px; display: grid; gap: 3px; min-width: 0; }
.dash-ref small { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dash-ref-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dash-ref-link { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--gold-deep); text-decoration: none; }
.dash-ref-link:hover { text-decoration: underline; }
.dash-name { margin-top: 4px; font-size: 17px; font-weight: 700; color: var(--ink); }
.dash-pkg { font-size: 15.5px; font-weight: 600; color: var(--muted); }
.dash-pkg strong { color: var(--gold-deep); }
.dash-rank {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 12px;
  background: var(--grad-gold); background-size: 200% 100%; animation: goldShift 8s ease-in-out infinite;
  color: #1b150c; font-weight: 700; font-size: 15.5px; box-shadow: 0 8px 20px rgba(167, 123, 42, .28), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.dash-rank .icon { width: 19px; height: 19px; }
a.dash-rank { text-decoration: none; }
a.dash-rank:hover { filter: brightness(1.04); }
.dash-rank-box { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: min(100%, 340px); }

/* CTO next-rank card + countdown (dashboard & CTO page) */
.cto-next { padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .78); border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.cto-next-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cto-next-title { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink); }
.cto-next-title .icon { width: 18px; height: 18px; color: var(--gold); }
.cto-next-title strong { color: var(--black); }
.cto-timer { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #1b150c; color: #f3dc9b; font-variant-numeric: tabular-nums; }
.cto-timer .icon { width: 15px; height: 15px; }
.cto-timer strong { font: 700 16px var(--font-display); letter-spacing: .02em; }
.cto-timer small { font-size: 12px; opacity: .8; }
.cto-timer.is-urgent { background: var(--danger); color: #fff; }
.cto-timer.is-over { background: var(--muted); color: #fff; }
.cto-req { display: grid; gap: 8px; }
.cto-req li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 10px; font-size: 14px; }
.cto-req li > .icon { width: 18px; height: 18px; grid-row: span 2; }
.cto-req li > span { color: var(--ink); font-weight: 600; }
.cto-req li > span em { font-style: normal; color: var(--muted); font-weight: 500; }
.cto-req li > strong { font: 700 16px var(--font-display); color: var(--black); }
.cto-req li > small { grid-column: 2 / 4; font-size: 12.5px; }
.cto-req li.is-done > .icon, .cto-req li.is-done > small { color: var(--success); }
.cto-req li.is-pending > .icon, .cto-req li.is-pending > small { color: var(--warning); }
.cto-next-foot { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.cto-next-note { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); }
.cto-next-note .icon { width: 17px; height: 17px; color: var(--gold); flex: none; }
.team-card > .cto-next, .team-card > .cto-next-note { margin-bottom: 18px; max-width: 560px; }
.cto-target { font-size: 13px; color: var(--ink); }
.cto-rank.is-expired { opacity: .6; }
.cto-rank.is-expired .cto-status { color: var(--muted); }

.wallet-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 22px 16px; border-color: var(--line-strong); }
.wallet-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 14px; background: linear-gradient(145deg, #fffaf0, #f3e6c6); border: 1px solid var(--line-strong); color: var(--gold); transition: transform .45s var(--ease); }
.wallet-icon .icon { width: 26px; height: 26px; stroke: url(#goldStroke); stroke-width: 2; }
.wallet-card:hover .wallet-icon { transform: rotate(-6deg) scale(1.06); }
.wallet-card strong { font: 700 clamp(22px, 2.2vw, 27px)/1.2 var(--font-display); color: var(--black); }
.wallet-card > span:last-child { font-size: 14px; font-weight: 600; color: var(--muted); }

.act-list, .net-list { display: grid; }
.act-list li, .net-list li { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.act-list li:first-child, .net-list li:first-child { padding-top: 0; }
.act-list li:last-child, .net-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.act-list strong { font: 700 19px var(--font-display); color: var(--black); }
.act-dot { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; }
.act-dot .icon { width: 18px; height: 18px; stroke-width: 3; }
.is-done .act-dot { background: radial-gradient(circle at 35% 30%, #7cc96b, #3f7a3a); color: #fff; box-shadow: 0 4px 10px rgba(63, 122, 58, .3); }
.is-pending .act-dot { background: #f0ebe0; border: 1px solid var(--line-strong); color: #a8987a; }
.is-pending .act-dot .icon { stroke-width: 2; }
.act-status { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; }
.is-done .act-status { color: var(--success); }
.is-done .act-status .icon { width: 16px; height: 16px; stroke-width: 3; }
.is-pending .act-status { color: var(--warning); }

.net-list li > span:nth-child(2) { font-size: 15px; font-weight: 600; color: var(--ink); }
.net-list strong { margin-left: auto; font: 700 19px var(--font-display); color: var(--black); }
.net-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: linear-gradient(145deg, #fffaf0, #f3e6c6); border: 1px solid var(--line-strong); color: var(--gold-deep); }
.net-icon .icon { width: 18px; height: 18px; }

@media (max-width: 760px) {
  .dash-hero-main { gap: 16px; }
  .dash-avatar img { width: 74px; height: 74px; }
  .dash-rank { width: 100%; justify-content: center; }
  .dash-rank-box { width: 100%; min-width: 0; }
}
@media (max-width: 760px) {
  .g-4.wallets-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wallet-card { padding: 18px 10px; }
}

/* Deposit (USDT) */
.dep-card {
  max-width: 980px; padding: clamp(20px, 3vw, 34px); border-radius: 22px; border: 1.5px solid rgba(199, 154, 54, .6);
  background: radial-gradient(circle at 100% 0%, rgba(239, 213, 142, .4), transparent 45%), linear-gradient(150deg, #fffdf8, #f8eedb);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.dep-card::before { content: ""; position: absolute; right: 0; top: 0; width: 50%; height: 70px; background: url("../images/skyline.svg") right top / auto 100% no-repeat; opacity: .1; pointer-events: none; -webkit-mask: linear-gradient(90deg, transparent, #000 50%); mask: linear-gradient(90deg, transparent, #000 50%); }
.dep-title { position: relative; display: flex; align-items: center; gap: 12px; margin-bottom: 24px; font: 700 clamp(22px, 2.4vw, 28px) var(--font-display); color: var(--black); }
.dep-title-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--grad-gold); box-shadow: 0 6px 14px rgba(167, 123, 42, .3); }
.dep-title-icon .icon { width: 20px; height: 20px; color: #2b2115; }

.dep-top { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 26px; align-items: center; margin-bottom: 26px; }
.dep-qr {
  position: relative; display: grid; place-items: center; width: 190px; aspect-ratio: 1; padding: 12px; border-radius: 18px;
  background: #fff; border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm);
}
.dep-qr .qr-svg { width: 100%; height: 100%; display: block; }
.dep-qr-fallback { font-size: 12.5px; color: var(--muted); text-align: center; }
.dep-qr.is-ready .dep-qr-fallback { display: none; }
.dep-qr-logo {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none; place-items: center;
  width: 40px; height: 40px; border-radius: 50%; background: #26a17b; color: #fff; font: 700 24px/1 var(--font-body);
  border: 4px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.dep-qr.is-ready .dep-qr-logo { display: grid; }

.dep-info h3 { margin-bottom: 12px; font-size: 18px; font-weight: 700; color: var(--black); }
.dep-address {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 14px;
  background: var(--paper); border: 1px solid var(--line-strong);
}
.dep-address > div { display: grid; gap: 4px; min-width: 0; flex: 1; }
.dep-address small { font-size: 14px; font-weight: 600; color: var(--ink); }
.dep-address code { font: 600 15px/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--black); word-break: break-all; }
.dep-copy { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--cream); color: var(--black); cursor: pointer; transition: background-color .25s, transform .25s; }
.dep-copy:hover { background: #f3e6c6; transform: scale(1.05); }
.dep-network { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.dep-network .icon { width: 15px; height: 15px; color: var(--gold); }
.dep-network strong { color: var(--ink); }

.dep-form .field > label { font-size: 14.5px; color: var(--black); }
.dep-form .field > label .req { color: var(--gold); }
.dep-form .input { min-height: 50px; background: #fff; }
.dep-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 24px; }
.dep-note strong { display: block; margin-bottom: 6px; color: var(--black); }
.dep-note ul { display: grid; gap: 4px; }
.dep-note li { position: relative; padding-left: 16px; font-size: 14px; color: var(--ink); }
.dep-note li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.dep-submit { min-width: 210px; font-size: 16px; font-weight: 700; }

@media (max-width: 760px) {
  .dep-top { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .dep-info { width: 100%; }
  .dep-submit { width: 100%; }
}

/* Package activation */
.act-card { max-width: 980px; }
.act-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; padding: 0; background: none; border: 0; }
.act-tabs .tab { justify-content: center; min-height: 50px; border-radius: 12px; font-size: 15.5px; font-weight: 700; color: var(--black); background: var(--paper); border: 1px solid var(--line-strong); }
.act-tabs .tab:hover { background: var(--cream); }
.act-tabs .tab[aria-selected="true"], .act-tabs a.tab[aria-current="page"] { border-color: #b98a2e; }
.act-form .input[readonly] { background: #fff; color: var(--black); font-weight: 600; }
.act-flow-title { margin: 24px 0 14px; font-size: 18px; font-weight: 700; color: var(--black); }

.act-flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.act-step {
  display: grid; justify-items: center; gap: 4px; padding: 16px 10px; border-radius: 14px; text-align: center;
  background: linear-gradient(150deg, #fffaf0, #f6ead0); border: 1px solid var(--line-strong);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.act-step strong { font: 700 clamp(22px, 2.6vw, 28px) var(--font-display); color: var(--black); }
.act-step span { display: inline-flex; align-items: center; gap: 5px; font-size: 15px; font-weight: 700; }
.act-step span .icon { width: 16px; height: 16px; stroke-width: 3; }
.act-step.is-done span { color: var(--success); }
.act-step.is-next { background: var(--paper); border: 1.5px solid var(--gold); box-shadow: 0 0 0 4px rgba(199, 154, 54, .14), var(--shadow-gold); }
.act-step.is-next span { color: var(--black); }
.act-step.is-locked { opacity: .6; }
.act-step.is-locked span { color: var(--muted); font-weight: 600; }
.act-step.is-locked span .icon { stroke-width: 2; }
.act-arrow { display: grid; place-items: center; color: var(--gold); }
.act-arrow .icon { width: 24px; height: 24px; stroke-width: 2.6; }

.act-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.act-hint { flex: 1 1 320px; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: 14.5px; color: var(--ink); background: #fbf4e2; border: 1px solid #ead39a; }
.act-hint > .icon { width: 22px; height: 22px; flex: none; padding: 3px; border-radius: 50%; background: var(--grad-gold); color: #2b2115; }
.act-hint.is-done { background: var(--success-bg); border-color: #c4dcb8; }
.act-hint.is-done > .icon { background: var(--success); color: #fff; }
.act-hint.is-error { background: var(--danger-bg); border-color: #e9bdb8; }
.act-hint.is-error > .icon { background: var(--danger); color: #fff; }
.act-hint a { font-weight: 700; text-decoration: underline; }
.act-balance { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.act-lookup { display: flex; gap: 10px; }
.act-lookup .input { flex: 1 1 auto; min-width: 0; }
.act-lookup .btn { flex: none; }
.act-target { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line-strong); font-size: 15px; }
.act-target .icon { width: 20px; height: 20px; color: var(--gold); flex: none; }

/* My Team */
.team-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.team-table-box { border-radius: 16px; border: 1px solid var(--line-strong); background: var(--paper); overflow: hidden; box-shadow: var(--shadow-xs); }
.team-table th { color: var(--black); font-size: 13px; letter-spacing: .4px; text-transform: none; background: linear-gradient(180deg, #fbf3e0, #f5e8c8); }
.team-table th.num, .team-table td.num { text-align: right; }
.team-table td { font-size: 14.5px; font-weight: 500; color: var(--ink); }
.team-table td.num strong { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--black); }
.team-table .team-sn { width: 52px; font-weight: 700; color: var(--black); }
.team-table .team-id { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--black); }
.team-level { display: inline-grid; place-items: center; min-width: 38px; height: 28px; padding: 0 8px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--gold-deep); background: #fbf4e2; border: 1px solid #ead39a; }
.team-totals { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.team-pill { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 999px; font-size: 14.5px; font-weight: 700; color: var(--black); background: linear-gradient(150deg, #fffaf0, #f6e6bd); border: 1px solid #ddc382; box-shadow: var(--shadow-xs); }

/* Income */
.income-card { max-width: 1080px; }
.income-stats { gap: 16px; margin-bottom: 26px; }
.income-stat {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; text-align: center;
  border-radius: 16px; background: linear-gradient(150deg, #fffdf8, #f7ead0); border: 1px solid #ddc382; box-shadow: var(--shadow-xs);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.income-stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-gold); }
.income-stat-icon { display: grid; place-items: center; width: 46px; height: 46px; }
.income-stat-icon .icon { width: 34px; height: 34px; stroke: url(#goldStroke); stroke-width: 1.8; color: var(--gold); }
.income-stat:hover .income-stat-icon { transform: scale(1.08); transition: transform .4s var(--ease); }
.income-stat-label { font-size: 15px; font-weight: 600; color: var(--black); }
.income-stat strong { font: 700 clamp(20px, 2.2vw, 25px)/1.2 var(--font-display); color: var(--black); font-variant-numeric: tabular-nums; }
.income-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.income-head h3 { font: 700 clamp(19px, 2vw, 22px) var(--font-display); color: var(--black); }
.income-filter { width: auto; min-width: 190px; min-height: 40px; padding-top: 8px; padding-bottom: 8px; font-size: 14px; font-weight: 600; background-color: #fff; }

/* Wallets */
.wallets-card { max-width: 1080px; }
.wl-tx { margin-top: var(--gap); scroll-margin-top: calc(var(--tb-h) + 16px); }
.wl-grid { gap: 18px; }
.wl-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 18px 20px; text-align: center;
  border-radius: 18px; background: linear-gradient(150deg, #fffdf8, #f7ead0); border: 1px solid #ddc382; box-shadow: var(--shadow-xs);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s;
}
.wl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-gold); }
.wl-card.is-current { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(199, 154, 54, .18), var(--shadow-sm); }
.wl-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: radial-gradient(circle at 35% 30%, #fff6dc, #f1dca6); border: 1px solid #e2c77f; transition: transform .45s var(--ease); }
.wl-icon .icon { width: 34px; height: 34px; stroke: url(#goldStroke); stroke-width: 2; color: var(--gold); }
.wl-card:hover .wl-icon { transform: rotate(-6deg) scale(1.06); }
.wl-label { margin-top: 4px; font-size: 17px; font-weight: 700; color: var(--black); }
.wl-amount { font: 700 clamp(24px, 2.6vw, 30px)/1.2 var(--font-display); color: var(--black); font-variant-numeric: tabular-nums; }
.wl-btn { width: 100%; max-width: 220px; margin-top: 6px; font-size: 15px; }
.wl-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: var(--gold-deep); }
.wl-link .icon { width: 14px; height: 14px; transition: transform .3s; }
.wl-link:hover .icon { transform: translateX(3px); }
.wl-desc { display: grid; gap: 2px; }
.wl-desc strong { font-weight: 600; color: var(--black); }
.wl-desc small { font-size: 12.5px; color: var(--muted); }
.wl-amt.is-cr { color: var(--success) !important; }
.wl-amt.is-dr { color: var(--danger) !important; }

@media (max-width: 760px) {
  .wl-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Withdrawal */
.wd-card { max-width: 820px; }
.wd-rules { display: grid; gap: 6px; margin-bottom: 22px; padding: 14px 18px; border-radius: 14px; background: #fbf4e2; border: 1px solid #ead39a; }
.wd-rules li { position: relative; padding-left: 18px; font-size: 15px; font-weight: 600; color: var(--ink); }
.wd-rules li::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.wd-rules strong { color: var(--black); }
.wd-split { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin: 18px 0 22px; font-size: 15px; font-weight: 600; color: var(--ink); }
.wd-split strong { color: var(--black); font-variant-numeric: tabular-nums; }
.wd-submit { display: flex; width: 100%; max-width: 420px; margin: 0 auto; font-size: 16px; }
.wd-hash { display: inline-flex; align-items: center; gap: 5px; color: var(--gold-deep); }
.wd-hash code { color: var(--gold-deep); text-decoration: underline; text-decoration-color: rgba(143, 103, 30, .35); text-underline-offset: 3px; }
.wd-hash .icon { width: 13px; height: 13px; }
.wd-hash:hover code { color: var(--black); text-decoration-color: currentColor; }

/* Reports — Global queue */
.q-table td, .q-table th { text-align: center; }
.q-table tr.q-me td { background: var(--grad-gold); color: #1b150c; font-weight: 700; }
.q-table tbody tr.q-me:hover { background: none; }
.q-table tr.q-gap td { padding-top: 6px; padding-bottom: 6px; color: #a8987a; font-weight: 700; letter-spacing: 2px; }
.q-table tbody tr.q-gap:hover { background: none; }

/* Reports — CTO rank */
.cto-rank { gap: 6px; }
.cto-trophy .icon { width: 44px; height: 44px; stroke: url(#goldStroke); stroke-width: 1.8; color: var(--gold); filter: drop-shadow(0 4px 8px rgba(167, 123, 42, .3)); }
.cto-name { font: 700 clamp(20px, 2.2vw, 24px) var(--font-display); color: var(--black); }
.cto-status { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 700; }
.cto-status .icon { width: 18px; height: 18px; stroke-width: 3; }
.is-achieved .cto-status { color: var(--success); }
.is-pending .cto-status { color: var(--warning); }
.is-pending .cto-status .icon { stroke-width: 2.2; }
.is-pending .cto-trophy { opacity: .7; }
.cto-window { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.cto-date { font-size: 12.5px; color: var(--muted); }
.cto-income { margin-top: 24px; }
.cto-income h3 { margin-bottom: 10px; font-size: 18px; font-weight: 700; color: var(--black); }
.cto-income dl { display: grid; gap: 4px; padding: 6px 18px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line-strong); max-width: 520px; }
.cto-income dl > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cto-income dl > div:last-child { border-bottom: 0; }
.cto-income dt { position: relative; padding-left: 16px; font-size: 15px; font-weight: 600; color: var(--ink); }
.cto-income dt::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.cto-income dd { margin: 0; }
.cto-income dd strong { font: 700 18px var(--font-display); color: var(--black); }

@media (max-width: 760px) {
  .income-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

@media (max-width: 600px) {
  .income-filter { width: 100%; }
  .team-tabs { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .act-flow { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .act-arrow .icon { transform: rotate(90deg); }
  .act-step { grid-auto-flow: column; justify-content: space-between; padding: 14px 18px; }
  .act-tabs .tab { font-size: 14px; padding: 8px 10px; }
}

/* Quick links */
.quick { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px; height: 100%; }
.quick strong { font-size: 15.5px; }
.quick small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.quick .card-link { margin-top: auto; }

/* Profile */
.profile-card { text-align: center; padding: 30px 22px; }
.avatar-xl { position: relative; width: 132px; height: 132px; margin: 0 auto 16px; }
.avatar-xl img { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--gold); box-shadow: 0 0 0 8px rgba(199, 154, 54, .12), var(--shadow); }
.avatar-xl .avatar-edit { position: absolute; right: 4px; bottom: 4px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-gold); border: 3px solid var(--paper); cursor: pointer; color: #1b150c; transition: transform .3s var(--ease); }
.avatar-xl .avatar-edit:hover { transform: scale(1.1) rotate(-8deg); }
.avatar-xl .avatar-edit .icon { width: 17px; height: 17px; }
.profile-card h2 { font: 700 23px var(--font-display); }
.member-id { display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 14px; padding: 8px 8px 8px 14px; border-radius: 12px; border: 1px dashed var(--gold); background: #fbf4e2; font: 700 15px var(--font-brand); letter-spacing: 1.2px; color: var(--gold-deep); }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.profile-stats div + div { border-left: 1px solid var(--line); }
.profile-stats strong { display: block; font: 700 20px var(--font-display); }
.profile-stats small { font-size: 12px; color: var(--muted); }

/* Notifications */
.note { position: relative; display: flex; gap: 16px; align-items: flex-start; padding: 18px 22px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color .25s; }
.note:last-child { border-bottom: 0; }
.note:hover { background: #fdf8ec; }
.note.is-unread { background: linear-gradient(90deg, rgba(239, 213, 142, .22), transparent 60%); }
.note.is-unread::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad-gold-soft); }
.note-body { flex: 1; min-width: 0; }
.note-body strong { display: block; font-weight: 600; }
.note.is-unread .note-body strong { font-weight: 700; color: var(--black); }
.note-body p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.note-meta .icon { width: 14px; height: 14px; }
.note-meta span { display: inline-flex; align-items: center; gap: 5px; }
.note-unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--champagne); flex: none; margin-top: 8px; transition: opacity .3s, transform .3s; }
.note:not(.is-unread) .note-unread-dot { opacity: 0; transform: scale(0); }
.note.is-hidden { display: none; }

/* Dropzone */
.dropzone { position: relative; display: grid; justify-items: center; gap: 10px; padding: 34px 20px; text-align: center; border-radius: 16px; border: 2px dashed var(--line-strong); background: repeating-linear-gradient(135deg, #fffdf8 0 14px, #fbf6ea 14px 28px); transition: border-color .3s, background-color .3s, transform .3s var(--ease); cursor: pointer; }
.dropzone:hover, .dropzone.is-over { border-color: var(--gold); transform: scale(1.01); }
.dropzone.is-over { background: #fbf1d6; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .tile-icon { width: 60px; height: 60px; border-radius: 50%; }
.dropzone strong { font-size: 16px; }
.dropzone small { color: var(--muted); }
.upload-list { display: grid; gap: 10px; margin-top: 14px; }
.upload-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fffefa; animation: fadeUp .4s var(--ease) both; }
.upload-item .grow { flex: 1; min-width: 0; }
.upload-item strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item small { color: var(--muted); font-size: 12px; }
.upload-item .progress { margin-top: 6px; height: 5px; }

/* File type chip */
.ftype { width: 42px; height: 46px; flex: none; border-radius: 8px; display: grid; place-items: end center; padding-bottom: 6px; position: relative; font-size: 10px; font-weight: 800; letter-spacing: .5px; color: #fff; background: linear-gradient(160deg, #3a2d1a, #171411); border: 1px solid rgba(199, 154, 54, .6); }
.ftype::before { content: ""; position: absolute; top: 0; right: 0; width: 12px; height: 12px; background: linear-gradient(225deg, var(--ivory) 50%, var(--gold) 50%); border-radius: 0 7px 0 4px; }
.ftype.pdf { color: #f2b9a6; } .ftype.jpg, .ftype.png { color: var(--champagne); }

/* Sessions / devices */
.device { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.device:last-child { border-bottom: 0; padding-bottom: 0; }
.device:first-child { padding-top: 0; }
.device .grow { flex: 1; min-width: 0; }
.device strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.device small { display: block; color: var(--muted); font-size: 12.5px; }

/* Security score */
.score { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.score-list { flex: 1; min-width: 200px; display: grid; gap: 10px; }
.score-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.score-list .icon { width: 18px; height: 18px; }
.score-list .ok .icon { color: var(--success); }
.score-list .todo .icon { color: var(--warning); }

/* Password strength */
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 4px; }
.strength span { height: 5px; border-radius: 4px; background: #ebe1cb; transition: background-color .3s; }
.strength[data-level="1"] span:nth-child(-n+1) { background: #c8553d; }
.strength[data-level="2"] span:nth-child(-n+2) { background: #d99a2b; }
.strength[data-level="3"] span:nth-child(-n+3) { background: #b7a136; }
.strength[data-level="4"] span { background: #4f8a3f; }
.strength-label { font-size: 12.5px; color: var(--muted); }
.pw-rules { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 8px; transition: color .25s; }
.pw-rules .icon { width: 15px; height: 15px; }
.pw-rules li.ok { color: var(--success); }

/* Ticket conversation */
.chat { display: grid; gap: 18px; }
.msg { display: flex; gap: 12px; max-width: 86%; animation: fadeUp .45s var(--ease) both; }
.msg img, .msg .msg-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 2px solid var(--gold); }
.msg-avatar { display: grid; place-items: center; background: var(--grad-dark); }
.msg-avatar .icon { width: 18px; height: 18px; stroke: url(#goldStroke); }
.msg-bubble { padding: 14px 16px; border-radius: 4px 16px 16px 16px; background: #fffefa; border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.msg-bubble p { font-size: 14.5px; }
.msg-bubble p + p { margin-top: 8px; }
.msg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.msg-head strong { font-size: 14px; }
.msg-head small { color: var(--muted); }
.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msg.mine .msg-bubble { border-radius: 16px 4px 16px 16px; background: linear-gradient(150deg, #fbf1d6, #f6e7c0); border-color: #e7cf8f; }
.msg-attach { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; }
.msg-attach .icon { width: 15px; height: 15px; color: var(--gold-deep); }
.composer { display: grid; gap: 12px; }
.composer-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Meta list (ticket details) */
.meta-list { display: grid; gap: 14px; }
.meta-list div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; font-weight: 600; text-align: right; }

/* Filter bar */
.filter-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-input { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search-input .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--gold); }
.search-input .input { min-height: 42px; padding-left: 40px; }

/* 9 ─ Auth (login / register) ─────────────────────────────────────── */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 30px;
  padding: clamp(28px, 5vw, 60px); color: #f6e7c1;
  background: radial-gradient(circle at 70% 20%, rgba(199, 154, 54, .45), transparent 50%), var(--grad-dark);
}
.auth-brand::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 180px; background: url("../images/skyline.svg") center bottom / auto 100% repeat-x; opacity: .35; }
.auth-brand::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, transparent, var(--gold), var(--champagne), var(--gold), transparent); }
.auth-brand > * { position: relative; }
.auth-back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--champagne); }
.auth-back .icon { width: 17px; height: 17px; transition: transform .3s; }
.auth-back:hover .icon { transform: translateX(-3px); }
.auth-logo { width: min(300px, 70%); margin: 0 auto; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .45)); animation: floatY 6s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.auth-brand h2 { font: 700 clamp(26px, 3vw, 36px)/1.2 var(--font-display); text-align: center; }
.auth-brand h2 span { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-brand p { text-align: center; color: #cdbf9f; max-width: 420px; margin: 10px auto 0; }
.auth-points { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.auth-main { display: grid; place-items: center; padding: clamp(24px, 5vw, 60px) clamp(18px, 5vw, 60px); position: relative; }
.auth-card { width: min(480px, 100%); padding: clamp(26px, 4vw, 40px); border-radius: 24px; background: var(--paper); border: 1px solid rgba(199, 154, 54, .45); box-shadow: 0 30px 70px rgba(50, 36, 12, .14); position: relative; }
.auth-card-logo { display: none; width: 72px; height: 72px; margin: 0 auto 10px; }
.auth-card h1 { font: 700 30px var(--font-display); text-align: center; }
.auth-card .auth-sub { text-align: center; color: var(--muted); margin: 6px 0 26px; }
.auth-form { display: grid; gap: 16px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.auth-row a, .auth-alt a { color: var(--gold-deep); font-weight: 700; }
.auth-row a:hover, .auth-alt a:hover { text-decoration: underline; }
.auth-alt { text-align: center; font-size: 14.5px; color: var(--muted); margin-top: 6px; }

/* Login — single centered card (gold/black swoosh corners + skyline) */
.auth-solo .auth-shell { grid-template-columns: 1fr; }
.auth-solo .auth-main { min-height: 100vh; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; gap: 18px; background: radial-gradient(circle at 50% 0%, rgba(239, 213, 142, .4), transparent 60%), var(--ivory); }
.auth-solo .auth-main::after { display: none; }
.auth-solo .auth-back { justify-self: center; color: var(--gold-deep); order: 2; }
.login-card { width: min(440px, 100%); padding: 0; overflow: hidden; border-radius: 22px; background: linear-gradient(160deg, #ffffff 0%, #fbf7ee 55%, #f5eedf 100%); border: 1px solid rgba(199, 154, 54, .55); box-shadow: 0 30px 70px rgba(50, 36, 12, .18), inset 0 0 0 6px rgba(255, 255, 255, .6); }
.lc-inner { position: relative; z-index: 2; padding: 30px clamp(26px, 6vw, 46px) 34px; }
.lc-swoosh { position: absolute; z-index: 1; width: 230px; height: 230px; border-radius: 50%; pointer-events: none; }
.lc-swoosh-tl { top: -158px; left: -158px; border: 26px solid #171411; box-shadow: 0 0 0 8px #e6c46c, 0 0 0 14px #fffdf8, 0 0 0 20px #b98a2e, 0 0 0 22px rgba(23, 20, 17, .85); }
.lc-swoosh-br { bottom: -162px; right: -162px; border: 26px solid #171411; box-shadow: 0 0 0 8px #e6c46c, 0 0 0 14px #fffdf8, 0 0 0 20px #b98a2e, 0 0 0 22px rgba(23, 20, 17, .85); }
.lc-skyline { position: absolute; z-index: 1; left: 0; bottom: 0; width: 62%; height: 70px; background: url("../images/skyline.svg") left bottom / auto 100% no-repeat; opacity: .45; -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent); mask-image: linear-gradient(90deg, #000 55%, transparent); pointer-events: none; }
.lc-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 auto 14px; }
.lc-brand img { width: 58px; height: 58px; filter: drop-shadow(0 6px 12px rgba(143, 103, 30, .3)); }
.lc-brand-text { display: grid; line-height: 1.1; }
.lc-brand-text strong { font: 800 23px var(--font-brand); letter-spacing: .5px; color: var(--brown); text-transform: uppercase; }
.lc-brand-text small { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--gold); font: 700 9.5px var(--font-body); letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold-deep); }
.lc-brand-text small i { font-style: normal; color: var(--gold); }
.login-card h1 { font: 800 30px/1.2 var(--font-body); letter-spacing: -.3px; color: var(--black); margin: 0 0 22px; }
.login-card .auth-form { gap: 14px; }
.login-card .input { min-height: 50px; border-radius: 12px; background: #fff; border-color: #d8d2c4; box-shadow: 0 2px 4px rgba(50, 36, 12, .06); }
.login-card .input-wrap > .icon { color: var(--gold-deep); width: 20px; height: 20px; }
.login-card .input-wrap > .icon ~ .input { padding-left: 48px; }
.login-card .pw-toggle { color: var(--ink); }
.lc-forgot { text-align: right; margin-top: -2px; }
.lc-forgot a { font-size: 14px; font-weight: 700; color: var(--black); text-decoration: underline; text-underline-offset: 3px; }
.lc-forgot a:hover { color: var(--gold-deep); }
.lc-submit { min-height: 54px; margin-top: 8px; border-radius: 12px; font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.login-card .auth-alt { color: var(--ink); font-weight: 500; margin-top: 2px; }
.login-card .auth-alt a { color: var(--black); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.login-card .auth-alt a:hover { color: var(--gold-deep); }
@media (max-width: 420px) {
  .lc-swoosh { width: 190px; height: 190px; }
  .lc-brand img { width: 48px; height: 48px; }
  .lc-swoosh-tl { top: -135px; left: -135px; }
  .lc-swoosh-br { bottom: -142px; right: -142px; }
  .lc-brand-text strong { font-size: 20px; }
  .login-card h1 { font-size: 26px; }
}

/* 10 ─ Motion ───────────────────────────────────────────────────────── */
@keyframes goldShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Page transition */
.js body { animation: pageIn .55s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
.js body.is-leaving .content, .js body.is-leaving .auth-shell { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .3s var(--ease); }

/* Card entrances */
.js [data-anim] { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js [data-anim].in { opacity: 1; transform: none; }

.motion-reduced *, .motion-reduced *::before, .motion-reduced *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
.motion-reduced [data-anim] { opacity: 1 !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .js [data-anim] { opacity: 1 !important; transform: none !important; }
}

/* 11 ─ Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-profile-text { display: none; }
  .tb-profile { padding-right: 8px; }
}

@media (max-width: 1100px) {
  .g-main, .g-side { grid-template-columns: minmax(0, 1fr); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  /* Sidebar → slide-out drawer */
  .app-main, .sb-collapsed .app-main { margin-left: 0; }
  .sidebar { width: min(300px, 86vw); transform: translateX(-105%); box-shadow: none; }
  .sidebar.is-open { transform: none; box-shadow: 20px 0 60px rgba(23, 20, 17, .3); }
  .sb-close { display: grid; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(23, 20, 17, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .35s, visibility 0s linear .35s; }
  .sidebar-overlay.is-visible { opacity: 1; visibility: visible; transition: opacity .35s, visibility 0s; }
  .tb-menu { display: grid; }
  .tb-collapse { display: none; }

  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-card-logo { display: block; }
  .auth-main { min-height: 100vh; background: radial-gradient(circle at 50% 0%, rgba(239, 213, 142, .35), transparent 60%); }
  .auth-main::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 110px; z-index: -1; background: url("../images/skyline.svg") center bottom / auto 100% repeat-x; opacity: .3; }
}

@media (max-width: 760px) {
  :root { --tb-h: 100px; --gap: 16px; } /* two-row mobile topbar (scroll offsets) */
  body { font-size: 14.5px; }
  .content { padding-top: 18px; }
  .g-2, .g-3, .g-4, .kv, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .tb-welcome, .demo-chip span { display: none; }
  .tb-logo { display: block; flex-shrink: 0; }
  /* Row 1: menu + logo (left) · bell + profile (right). Row 2: name (Login ID), centred on one line. */
  .topbar { height: auto; flex-wrap: wrap; row-gap: 4px; padding-top: 10px; padding-bottom: 8px; }
  .tb-mobile-id { display: block; flex: 0 0 100%; order: 3; position: relative; }
  .tb-left { flex: 1 1 auto; }
  .tb-right { flex-shrink: 0; }
  .demo-chip { padding: 8px; }
  .topbar { column-gap: 10px; }
  .tb-left, .tb-right { gap: 8px; }
  .icon-btn { width: 42px; height: 42px; }
  .dd-notifications { width: min(340px, calc(100vw - 24px)); right: -52px; }
  .dd-notifications::before { right: 66px; }
  .page-head { margin-bottom: 18px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .card-head, .card-body { padding-left: 16px; padding-right: 16px; }
  .card-foot { padding: 14px 16px; }
  .card-foot .btn, .form-actions .btn { flex: 1; }
  .welcome-actions { width: 100%; }
  .welcome-actions .btn { flex: 1; }
  .welcome-main { flex-direction: column; align-items: flex-start; }
  .stat { padding: 16px; }
  .note { padding: 16px; gap: 12px; }
  .tl-item { grid-template-columns: 44px 1fr; }
  .tl-time { grid-column: 2; margin-top: -6px; }
  .msg { max-width: 100%; }
  .filter-bar .search-input { max-width: none; }
  .app-footer { flex-direction: column; align-items: flex-start; }

  /* Tables become stacked cards */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table-cards tbody tr:last-child { border-bottom: 0; }
  .table-cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border: 0; text-align: right; }
  .table-cards td::before { content: attr(data-label); flex: none; font-size: 11.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #9a8c72; text-align: left; }
  .table-cards td.cell-primary { padding-bottom: 10px; text-align: left; }
  .table-cards td.cell-primary::before { display: none; }
  .table-cards .row-actions { justify-content: flex-end; }
}

@media (max-width: 420px) {
  .tabs .tab { padding: 8px 12px; font-size: 13.5px; }
  .profile-stats strong { font-size: 18px; }
  .auth-card { border-radius: 18px; }
  .welcome-avatar img { width: 68px; height: 68px; }
}

/* 12 ─ Centered auth variant (register page design) ─────────────────── */
.auth-centered .auth-shell {
  grid-template-columns: 1fr; place-items: center; position: relative; overflow: hidden; isolation: isolate;
  padding: 48px 18px;
  background: radial-gradient(ellipse 70% 60% at 50% 40%, #fffdf8 0%, #f7f0df 60%, #efe3c6 100%);
}
.auth-decor { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
/* Curved glossy-black + metallic-gold corner arcs */
.arc { position: absolute; width: 760px; height: 760px; border-radius: 50%; border: 34px solid #171411; box-shadow: inset 0 0 0 9px #c79a36, inset 0 0 0 13px #f3dc93, 0 0 0 8px #d9b257, 0 0 0 12px rgba(239, 213, 142, .5), 0 20px 50px rgba(23, 20, 17, .25); }
.arc::after { content: ""; position: absolute; inset: 40px; border-radius: 50%; border: 2px solid rgba(199, 154, 54, .45); }
.arc-tl { left: -600px; top: -540px; }
.arc-tr { right: -590px; top: -470px; }
.arc-br { right: -640px; bottom: -600px; border-width: 26px; }
.auth-skyline { position: absolute; left: 0; bottom: 0; width: min(560px, 60vw); height: 150px; background: url("../images/skyline.svg") left bottom / auto 100% no-repeat; opacity: .55; -webkit-mask: linear-gradient(90deg, #000 40%, transparent); mask: linear-gradient(90deg, #000 40%, transparent); }

.reg-card {
  position: relative; width: min(450px, 100%); padding: 26px 28px 24px; border-radius: 20px;
  background: rgba(255, 253, 248, .93); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(199, 154, 54, .45); box-shadow: 0 30px 70px rgba(50, 36, 12, .16), inset 0 1px 0 #fff;
}
.reg-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; }
.reg-brand img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(91, 60, 18, .25)); transition: transform .6s var(--ease); }
.reg-brand:hover img { transform: rotate(-8deg) scale(1.05); }
.reg-brand-text { font: 800 22px/1 var(--font-brand); letter-spacing: 1px; background: linear-gradient(180deg, #2b2115 0%, #171411 55%, #8f671e 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.reg-brand-text small { display: block; margin-top: 5px; font: 700 8.5px var(--font-body); letter-spacing: 1.6px; color: var(--gold-deep); -webkit-text-fill-color: var(--gold-deep); }
.reg-card h1 { font: 800 27px/1.2 var(--font-body); color: var(--black); text-align: center; letter-spacing: -.3px; margin-bottom: 16px; }

.reg-form { display: grid; gap: 10px; }
.reg-form .field { gap: 3px; }
.reg-form .input { min-height: 46px; padding-top: 10px; padding-bottom: 10px; border-radius: 10px; border-color: #e3d4ad; background: #fffefb; box-shadow: inset 0 1px 2px rgba(50, 36, 12, .04); }
.reg-form .input::placeholder { color: #3a2e1c; font-weight: 500; opacity: .85; }
.reg-form .input-wrap > .icon { width: 20px; height: 20px; color: var(--gold); stroke-width: 2; }
.reg-form .input-wrap > .icon ~ .input { padding-left: 46px; }
.reg-form .input-wrap::before { /* divider after icon, as in the design */
  content: ""; position: absolute; left: 40px; top: 11px; bottom: 11px; width: 1px; background: #eadcb8; pointer-events: none;
}
.reg-form .pw-toggle { color: #3a2e1c; }
.reg-form .field-error:empty { display: none; }
.reg-terms { display: grid; justify-items: center; gap: 3px; margin: 4px 0 2px; }
.reg-terms .check { font-size: 13.5px; font-weight: 600; color: #2f2412; align-items: center; }
.reg-terms .check input { margin: 0; }
.reg-submit { min-height: 52px; font-size: 18px; letter-spacing: .3px; text-transform: none; border-radius: 12px; }
.reg-card .auth-alt { margin-top: 4px; font-size: 13.5px; }

@media (max-width: 560px) {
  .auth-centered .auth-shell { padding: 28px 12px 40px; align-items: start; }
  .reg-card { padding: 22px 18px 20px; border-radius: 18px; }
  .reg-brand img { width: 54px; height: 54px; }
  .reg-brand-text { font-size: 19px; }
  .reg-card h1 { font-size: 24px; }
  .arc { width: 520px; height: 520px; border-width: 24px; }
  .arc-tl { left: -430px; top: -420px; }
  .arc-tr { right: -440px; top: -400px; }
  .arc-br { display: none; }
}

/* 13 ─ Registration success page ───────────────────────────────────── */
.js .success-card:not(.is-resolved) .success-empty { visibility: hidden; }
.success-card { text-align: center; }
.success-badge { position: relative; width: 84px; height: 84px; margin: 4px auto 12px; }
.success-badge svg { position: relative; z-index: 1; width: 100%; height: 100%; overflow: visible; }
.sb-ring { fill: #fffaf0; stroke: url(#goldStroke); stroke-width: 3.5; stroke-dasharray: 176; stroke-dashoffset: 176; animation: sbDraw .9s var(--ease) .25s forwards; filter: drop-shadow(0 4px 10px rgba(167, 123, 42, .35)); }
.sb-check { fill: none; stroke: #b88629; stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: sbDraw .55s var(--ease) 1s forwards; }
.sb-glow { position: absolute; inset: -14px; border-radius: 50%; background: radial-gradient(circle, rgba(239, 213, 142, .65), transparent 65%); animation: sbPulse 2.6s ease-in-out 1.2s infinite; opacity: 0; }
@keyframes sbDraw { to { stroke-dashoffset: 0; } }
@keyframes sbPulse { 0%, 100% { opacity: .35; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.08); } }

.success-card h1 { font: 800 27px/1.2 var(--font-body); color: var(--black); letter-spacing: -.3px; margin-bottom: 4px; }
.success-sub { font: 700 18px var(--font-body); color: var(--black); margin-bottom: 14px; }

.cred-box {
  margin: 0 0 14px; padding: 6px 16px; border-radius: 14px; text-align: left;
  background: linear-gradient(150deg, #fffdf8, #fbf3df); border: 1.5px solid #e2c47a;
  box-shadow: 0 8px 22px rgba(167, 123, 42, .12), inset 0 1px 0 #fff;
}
.cred-row { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 8px; padding: 10px 0; }
.cred-row + .cred-row { border-top: 1px solid #efe2c2; }
.cred-row dt { font-size: 15px; font-weight: 500; color: #2f2412; }
.cred-row dd { margin: 0; display: flex; align-items: center; gap: 12px; min-width: 0; }
.cred-colon { font-weight: 700; }
.cred-row strong { font: 800 20px/1.2 var(--font-body); color: var(--black); letter-spacing: .5px; overflow-wrap: anywhere; }
.cred-copy { width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--gold-deep); cursor: pointer; display: grid; place-items: center; transition: background-color .25s, transform .25s var(--ease); }
.cred-copy:hover { background: rgba(239, 213, 142, .35); transform: scale(1.08); }
.cred-copy .icon { width: 20px; height: 20px; stroke-width: 2; }

.success-note { font-size: 14.5px; color: #2f2412; margin-bottom: 16px; }
.success-cta { width: min(260px, 100%); }
.success-demo { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.success-demo .icon { width: 14px; height: 14px; color: var(--gold); }

.success-empty { display: grid; justify-items: center; gap: 10px; padding: 6px 0 4px; }
.success-empty .tile-icon { width: 64px; height: 64px; border-radius: 50%; }
.success-empty h1 { margin: 4px 0 0; }
.success-empty p { color: var(--muted); max-width: 320px; }
.success-empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

@media (max-width: 560px) {
  .success-card h1 { font-size: 24px; }
  .cred-row { grid-template-columns: 78px 1fr auto; }
  .cred-row strong { font-size: 18px; }
}

/* ---------------- Sidebar submenu ---------------- */
.sb-toggle { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.sb-caret { width: 16px; height: 16px; margin-left: auto; color: #8b7d63; transition: transform .35s var(--ease), opacity .25s; }
.sb-has-sub.is-open > .sb-toggle .sb-caret { transform: rotate(180deg); }
.sb-toggle.is-active .sb-caret { color: #2b2115; }
.sb-sub-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.sb-has-sub.is-open > .sb-sub-wrap { grid-template-rows: 1fr; }
.sb-sub { overflow: hidden; min-height: 0; display: grid; gap: 2px; margin-left: 24px; padding-left: 12px; border-left: 1px solid var(--line-strong); }
.sb-has-sub.is-open .sb-sub { padding-top: 6px; padding-bottom: 4px; }
.sb-sub-title { display: none; }
.sb-sublink { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: #5e5039; white-space: nowrap; transition: background-color .25s, color .25s; }
.sb-subicon { width: 16px; height: 16px; color: var(--gold-deep); }
.sb-sublink:hover { background: rgba(239, 213, 142, .28); color: var(--black); }
.sb-sublink.is-current { background: rgba(239, 213, 142, .45); color: var(--black); font-weight: 700; }
.sb-sublink.is-current .sb-subicon { color: #2b2115; }

/* Collapsed desktop: submenu becomes a hover flyout */
@media (min-width: 1025px) {
  .sb-collapsed .sb-caret { display: none; }
  .sb-collapsed .sb-has-sub { position: relative; }
  .sb-collapsed .sb-sub-wrap { position: absolute; left: calc(100% + 10px); top: 0; z-index: 6; display: block; opacity: 0; visibility: hidden; transform: translateX(-6px); transition: opacity .2s, transform .25s var(--ease), visibility 0s linear .25s; }
  .sb-collapsed .sb-has-sub:hover > .sb-sub-wrap, .sb-collapsed .sb-has-sub:focus-within > .sb-sub-wrap { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .25s var(--ease), visibility 0s; }
  .sb-collapsed .sb-has-sub:hover > .sb-toggle::after, .sb-collapsed .sb-has-sub:focus-within > .sb-toggle::after { display: none; }
  .sb-collapsed .sb-sub { margin: 0; padding: 8px; min-width: 200px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); }
  .sb-collapsed .sb-sub-title { display: block; padding: 4px 12px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #a8987a; }
}

/* ---------------- Deposit history ---------------- */
.dep-table th.num, .dep-table td.num { text-align: right; }
.dep-table td.num strong { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.dep-table .dep-sn { width: 48px; font-weight: 700; color: #8b7d63; }
.dep-hash { display: inline-flex; align-items: center; gap: 8px; }
.dep-hash code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.dep-hash .dash-copy { width: 26px; height: 26px; }
.dep-hash .dash-copy .icon { width: 13px; height: 13px; }
.dep-table .badge { min-width: 92px; justify-content: center; }


/* =====================================================================
   v1.3 — Database-connected additions (same gold theme tokens)
   ===================================================================== */
.mt-gap { margin-top: var(--gap, 22px); }
.text-danger { color: var(--danger); display: flex; gap: 4px; align-items: center; }
.text-danger .icon { width: 14px; height: 14px; }
.alert-success { background: var(--success-bg); border-color: #c5ddb9; color: #2d5a29; }
.alert-success .icon { color: var(--success); }
.alert a { color: var(--gold-deep); font-weight: 700; }
.auth-alert { margin: 0 0 16px; text-align: left; }
.auth-lead { margin: -4px 0 18px; color: var(--muted); font-size: 14.5px; text-align: center; }
.dev-only code { font-size: 12px; }
.feature-lock { border-style: dashed; }
.feature-lock strong { color: var(--gold-deep); }
.sponsor-hint { display: block; margin-top: 6px; font-weight: 600; }
.sponsor-hint.is-ok { color: var(--success); }
.sponsor-hint.is-bad { color: var(--danger); }
.dd-empty { padding: 14px 18px; font-size: 13.5px; }
.chat-system { display: flex; gap: 6px; align-items: center; justify-content: center; font-size: 12.5px; margin: 4px 0 12px; }
.chat-system .icon { width: 14px; height: 14px; }
.file-pick { position: relative; cursor: pointer; }
.team-pill-btn { cursor: pointer; border: 0; font: inherit; display: inline-flex; gap: 6px; align-items: center; }
.team-pill-btn .icon { width: 15px; height: 15px; }
.team-note { display: flex; gap: 6px; align-items: center; font-size: 13px; margin: 10px 4px 0; }
.team-note .icon { width: 15px; height: 15px; color: var(--gold); }
.note-meta .card-link { margin-left: auto; }

/* Pagination */
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.pager-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pager a, .pager span.is-current { min-width: 36px; height: 36px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--ink); font-weight: 600; text-decoration: none; background: var(--paper, #fff); }
.pager a:hover { border-color: var(--gold); color: var(--gold-deep); }
.pager span.is-current { background: var(--gold); border-color: var(--gold); color: #fff; }
/* Admin AJAX pagination (admin/assets/js/ajax-pager.js): dim the card while the next page loads. */
.is-ajax-loading { position: relative; pointer-events: none; }
.is-ajax-loading > * { opacity: .55; transition: opacity .15s ease; }
.is-ajax-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--gold); animation: wc-ajax-spin .7s linear infinite; z-index: 2; }
@keyframes wc-ajax-spin { to { transform: rotate(360deg); } }
[data-ajax-region]:focus, .card[tabindex="-1"]:focus { outline: none; }

/* Admin panel */
.admin-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; align-items: end; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.admin-filters .field { margin: 0; }
.admin-filters .btns { display: flex; gap: 8px; }
.perm-grid td, .perm-grid th { text-align: center; }
.perm-grid td:first-child, .perm-grid th:first-child { text-align: left; }
.json-diff { margin: 0; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-width: 420px; color: var(--ink); }
.json-diff.before { color: var(--danger); }
.json-diff.after { color: var(--success); }
.tree { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 1px dashed var(--line-strong); }
.tree li { position: relative; padding: 6px 0 6px 14px; }
.tree li::before { content: ""; position: absolute; left: -18px; top: 20px; width: 26px; border-top: 1px dashed var(--line-strong); }
.tree-node { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper, #fff); font-size: 13.5px; }
.tree-node strong { color: var(--gold-deep); }
.inline-form { display: inline; }


/* =====================================================================
   v1.4 — Admin two-factor authentication
   ===================================================================== */
.mfa-shield { display: grid; place-items: center; width: 64px; height: 64px; margin: 4px auto 10px; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #3a3226, #0f0d0a 70%); border: 2px solid var(--gold);
  box-shadow: 0 0 0 6px rgba(199,154,54,.14), 0 12px 28px rgba(0,0,0,.28); color: var(--gold); }
.mfa-shield .icon { width: 28px; height: 28px; }
.mfa-lead { text-align: center; color: var(--muted); font-size: 14px; margin: -2px 0 16px; }
.mfa-lead strong { color: var(--gold-deep); }
.otp-input { text-align: center; letter-spacing: .55em; font: 700 22px/1 var(--font-body, inherit); padding-left: .55em; }
.otp-input::placeholder { letter-spacing: .4em; }
.mfa-recovery { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.mfa-recovery summary { cursor: pointer; display: flex; gap: 8px; align-items: center; justify-content: center; font-weight: 600; font-size: 13.5px; color: var(--gold-deep); list-style: none; }
.mfa-recovery summary::-webkit-details-marker { display: none; }
.mfa-recovery summary .icon { width: 16px; height: 16px; }
.mfa-recovery[open] summary { margin-bottom: 12px; }
.mfa-cancel { display: flex; justify-content: center; margin-top: 8px; }
.mfa-steps { margin: 0 0 12px; padding-left: 20px; font-size: 13.5px; color: var(--muted); text-align: left; }
.mfa-steps li { margin: 3px 0; }
.mfa-qr { position: relative; width: 196px; height: 196px; margin: 4px auto 14px; padding: 10px; background: #fff; border-radius: 16px;
  border: 1px solid var(--line-strong); box-shadow: 0 10px 26px rgba(120,90,30,.14); display: grid; place-items: center; }
.mfa-qr .qr-svg { width: 100%; height: 100%; display: block; }
.mfa-qr.is-ready .dep-qr-fallback { display: none; }
.mfa-key { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 10px 12px; margin-bottom: 14px;
  border: 1px dashed var(--gold); border-radius: 12px; background: #fffaf0; }
.mfa-key small { width: 100%; text-align: center; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.mfa-key code { font: 700 15px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 1px; color: var(--ink); word-break: break-all; text-align: center; }
.mfa-setup { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.mfa-setup .mfa-qr { margin: 0; }
.mfa-setup .mfa-key { justify-content: flex-start; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; counter-reset: rc; }
.recovery-grid li { counter-increment: rc; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(199,154,54,.35); }
.recovery-grid li::before { content: counter(rc, decimal-leading-zero); font-size: 11px; color: var(--gold); }
.recovery-grid code { font: 700 16px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 1.5px; color: #fff; }
@media (max-width: 720px) {
  .mfa-setup { grid-template-columns: 1fr; }
  .mfa-setup .mfa-qr { margin: 0 auto; }
  .recovery-grid { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .topbar, .app-footer, .card:not(.mfa-codes-card) { display: none !important; }
  .mfa-codes-card { color: #000; background: #fff; }
  .recovery-grid code { color: #000; }
}


/* =====================================================================
   v1.5 — SRS compliance additions (legal pages, 9-level team tree)
   ===================================================================== */
.legal-card { max-width: 760px; text-align: left; }
.legal-card h1 { text-align: center; }
.legal-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 14px; }
.legal-tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.legal-tabs a.is-current { background: var(--gold); border-color: var(--gold); color: #fff; }
.legal-version { text-align: center; color: var(--muted); font-size: 13px; margin: -6px 0 12px; }
.legal-body { max-height: 55vh; overflow-y: auto; padding: 4px 4px 4px 0; font-size: 14.5px; line-height: 1.7; }
.legal-body p { margin: 0 0 12px; }
a.team-level { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; }
a.team-level .icon { width: 14px; height: 14px; }
.level-nav { flex-wrap: wrap; }
.level-nav .tab { text-decoration: none; }
.level-nav .tab[aria-current="page"] { background: var(--gold); color: #fff; }

/* v1.5: three stacked acceptance checkboxes align on one left edge */
.reg-terms + .reg-terms, .reg-terms:has(+ .reg-terms) { justify-items: start; }
.reg-terms + .reg-terms .check, .reg-terms:has(+ .reg-terms) .check { text-align: left; align-items: flex-start; }
.reg-terms + .reg-terms .check input, .reg-terms:has(+ .reg-terms) .check input { margin-top: 2px; }

/* =====================================================================
   v1.6 — governance & operations (approvals, legal re-consent, e-mail, health)
   ===================================================================== */
.card-title { min-width: 0; overflow-wrap: anywhere; }
.meta-list dd { min-width: 0; overflow-wrap: anywhere; }
.json-diff { white-space: pre-wrap; overflow-wrap: anywhere; }
.legal-preview { max-height: 40vh; overflow-y: auto; padding: 14px 16px; border: 1px solid var(--line, #eadfc4); border-radius: 12px; background: #fffdf8; font-size: 14px; line-height: 1.7; }
.legal-preview p { margin: 0 0 10px; }
.reconsent-form { display: grid; gap: 18px; margin-top: 8px; }
.reconsent-doc { padding: 16px; border: 1px solid var(--line, #eadfc4); border-radius: 14px; background: #fffdf8; }
.reconsent-doc h2 { margin: 0 0 10px; font: 700 18px var(--font-display); display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.reconsent-doc h2 small { font: 600 12px var(--font-body, inherit); color: var(--muted, #6b6b6b); letter-spacing: .3px; }
.reconsent-text { max-height: 30vh; margin-bottom: 12px; border-bottom: 1px solid var(--line, #eadfc4); }
.reconsent-text:focus-visible { outline: 2px solid var(--gold, #c9a227); outline-offset: 2px; }
.verify-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.mini-link { padding: 0; border: 0; background: none; color: var(--gold-deep, #8c6a1f); font: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer; }
.mini-link:hover { color: var(--black, #0b0b0b); }
tr[data-check] td:last-child { max-width: 360px; }
.g-side > *, .g-main > *, .stack > .card { min-width: 0; }
.approval-label { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted, #6b6b6b); overflow-wrap: anywhere; }

/* Phase 13B — shop */
.product-card { color: inherit; text-decoration: none; }
.product-card .product-name { margin: 4px 0 6px; font: 700 18px var(--font-display); color: var(--black, #0b0b0b); }
.product-price { font: 700 22px var(--font-display); color: var(--gold-deep, #8c6a1f); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs .tab { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line, #eadfc4); text-decoration: none; color: inherit; font-weight: 600; font-size: 14px; }
.tabs .tab.is-active { background: var(--gold, #c9a227); color: #0b0b0b; border-color: transparent; }

/* ---------------------------------------------------------------------
   View Genealogy (admin/genealogy.php, users/genealogy.php)
   --------------------------------------------------------------------- */
.gt-help { font-size: 13px; margin: 0 0 18px; }
.gt-wrap { overflow-x: auto; padding: 4px 0 40px; -webkit-overflow-scrolling: touch; }
.gt-inner { display: inline-flex; min-width: 100%; justify-content: center; padding: 0 24px; }
.gt-root { display: flex; flex-direction: column; align-items: center; }
.gt-card {
  position: relative; width: 188px; padding: 14px 14px 26px; text-align: center;
  background: var(--paper); border: 1px solid var(--line-strong); border-top: 3px solid var(--gold);
  border-radius: 14px; box-shadow: var(--shadow-sm); font-size: 12.5px;
}
.gt-card.is-inactive { border-top-color: var(--line-strong); }
.gt-card.is-loading { opacity: .55; }
.gt-card.gt-more { padding: 12px; color: var(--muted); border-top-color: var(--line-strong); }
.gt-id { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.gt-id a { color: var(--gold-deep); text-decoration: none; }
.gt-id a:hover { text-decoration: underline; }
.gt-name { margin: 3px 0 8px; font-weight: 700; font-size: 14px; color: var(--ink); word-break: break-word; line-height: 1.3; }
.gt-meta { margin: 0; display: grid; gap: 3px; text-align: left; }
.gt-meta > div { display: flex; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--line); padding-top: 3px; }
.gt-meta dt { color: var(--muted); }
.gt-meta dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }
.gt-meta .gt-business { color: var(--success); }
.gt-toggle {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; font: 700 17px/1 var(--font-body, sans-serif);
  color: #fff; background: linear-gradient(135deg, var(--gold), var(--gold-deep)); box-shadow: var(--shadow-gold);
}
.gt-toggle:disabled { opacity: .6; cursor: wait; }
ul.gt-tree { list-style: none; margin: 0; padding: 30px 0 0; display: flex; justify-content: center; position: relative; }
.gt-root > ul.gt-tree::before, ul.gt-tree li > ul.gt-tree::before {
  content: ""; position: absolute; top: 0; left: 50%; height: 30px; border-left: 1px solid var(--line-strong);
}
ul.gt-tree li { position: relative; padding: 30px 10px 0; display: flex; flex-direction: column; align-items: center; }
ul.gt-tree li::before, ul.gt-tree li::after {
  content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 30px; border-top: 1px solid var(--line-strong);
}
ul.gt-tree li::after { right: auto; left: 50%; border-left: 1px solid var(--line-strong); }
ul.gt-tree li:only-child { padding-top: 0; }
ul.gt-tree li:only-child::before, ul.gt-tree li:only-child::after { display: none; }
ul.gt-tree li:first-child::before, ul.gt-tree li:last-child::after { border-top-color: transparent; }
ul.gt-tree li:first-child::after { border-radius: 8px 0 0 0; }

/* ---- Admin: Matching Closing Report (admin/matching-closing.php) ---- */
.mcr-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--gap); }
.mcr-cards .stat-text strong { font-variant-numeric: tabular-nums; }
.mcr-status .badge { font-size: 13px; vertical-align: middle; }
.mcr-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; background: #f1e9d6; color: #7a5a14; border: 1px solid #e2cf9c; }
.mcr-table th.num, .mcr-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mcr-table code { font-size: 12px; }
.mcr-table .mcr-total td { border-top: 2px solid var(--line-strong); }
.mcr-subhead { margin: 22px 0 10px; font-size: 15px; }
.mcr-note { margin: 16px 0 0; font-size: 13.5px; }
.mcr-check .icon { width: 20px; height: 20px; }
.mcr-check.is-ok { color: var(--success); }
.mcr-check.is-fail { color: var(--danger); }
.mcr-lock { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.mcr-lock .input { flex: 1 1 240px; }
@media (max-width: 720px) {
  .mcr-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mcr-table th.num, .mcr-table td.num { white-space: normal; }
}
@media (max-width: 420px) { .mcr-cards { grid-template-columns: minmax(0, 1fr); } }
.mcr-closings { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px 16px; font-size: 13.5px; }
.mcr-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fffdf8; color: inherit; text-decoration: none; font-weight: 600; }
.mcr-chip small { font-weight: 500; color: var(--muted); }
.mcr-chip .icon { width: 14px; height: 14px; }
.mcr-chip:hover { border-color: var(--gold); }
.mcr-chip.is-current { background: var(--grad-gold); color: #1b150c; border-color: transparent; }
.mcr-chip.is-current small { color: #3b2f17; }
.mcr-close { border: 1px solid #e2cf9c; }
.mcr-close .card-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.mcr-close-text { flex: 1 1 320px; }
.mcr-close-text p { margin: 6px 0 0; font-size: 13.5px; }
.mcr-close .btn-gold { min-width: 160px; }
/* ---- Admin: CTO Closing Report (admin/cto-closing.php) ---- */
.mcr-cto-grid { gap: 0; }
.mcr-cto-grid > .table-wrap + .table-wrap { border-left: 1px solid var(--line); }
@media (max-width: 1100px) { .mcr-cto-grid > .table-wrap + .table-wrap { border-left: 0; border-top: 1px solid var(--line); } }

/* ---------------- Admin withdrawals: Pay Now popup ---------------- */
.wd-pay-btn { margin-top: 8px; white-space: nowrap; }
.wd-pay { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.wd-pay-qr { display: grid; gap: 8px; justify-items: center; text-align: center; }
.wd-pay-qr .dep-qr { width: 210px; }
.wd-pay-info { display: grid; gap: 14px; min-width: 0; }
.wd-pay-amount, .wd-pay-addr { display: grid; gap: 6px; justify-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.wd-pay-amount small, .wd-pay-addr small { color: var(--muted); font-size: 12.5px; }
.wd-pay-amount strong { font: 700 28px/1.1 var(--font-display); color: var(--black); }
.wd-pay-amount strong span { font-size: 16px; color: var(--muted); }
.wd-pay-addr code { font-size: 13.5px; word-break: break-all; line-height: 1.5; }
.wd-pay-list { display: grid; gap: 6px; margin: 0; font-size: 13.5px; }
.wd-pay-list div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.wd-pay-list dt { color: var(--muted); }
.wd-pay-list dd { margin: 0; text-align: right; }
.wd-pay-note { margin: 18px 0 0; }
.wd-pay-approve { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.wd-pay-approve .input { flex: 1 1 260px; }
@media (max-width: 640px) {
  .wd-pay { grid-template-columns: 1fr; }
  .wd-pay-qr .dep-qr { width: 190px; }
}
