/* /assets/css/app.css
   AdvancingBud — Unified Design System (2025 Premium Redesign)
   Matches: Index.php Landing Page Aesthetic
   ==========================================================================
   TABLE OF CONTENTS:
   1.  TOKENS & THEME (Variables)
   2.  RESET & BASE TYPOGRAPHY
   3.  LAYOUT SHELL (.ui-shell)
   4.  NAVIGATION FRAMEWORK
   5.  CORE COMPONENTS
   6.  DOMAIN MODULES (People, Sheets, Schedule, Merch, Advance View)
   7.  OVERLAYS & MODALS
   8.  UTILITIES
   9.  RESPONSIVE & PRINT GLOBAL
   ========================================================================== */

/* ==========================================================================
   1. TOKENS & THEME
   ========================================================================== */
:root {
  /* --- CORE PALETTE (Matches Landing Page) --- */
  --bg: #f8f9fc;
  --bg-accent: #ffffff;
  
  /* Surfaces */
  --surface: rgba(255, 255, 255, 0.8);        /* Generic surface */
  --surface-glass: rgba(255, 255, 255, 0.75); /* Sidebar/Header */
  --surface-strong: #ffffff;                  /* Cards */
  --surface-2: #f1f5f9;                       /* Inputs/Stripes */
  --surface-1: var(--surface);                /* Legacy fallback */

  /* Typography */
  --text: #64748b;
  --text-strong: #0f172a;
  --hover-text: #000000;
  --muted: #94a3b8;
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Brand System (Deep Red) */
  --brand: #6b1a1a;
  --brand-600: #8a1f1f;
  --brand-700: #500106;
  --brand-glow: rgba(107, 26, 26, 0.15);
  --brand-contrast: #ffffff;

  --accent: #f1f1f1;
  --accent-strong: #e2e2e2;
  --focus: #6b1a1a;

  /* Helper tokens */
  --text-on-accent: #000000; 
  --divider: rgba(0, 0, 0, 0.08);
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);

  /* Status Colors */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger:  #a52525; 
  --info:    #3b82f6;

  /* Dimensions */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 24px;       /* Larger, modern curves */
  --radius-pill: 999px;    /* For buttons */
  
  --sidebar-width-expanded: 270px;
  --sidebar-width-collapsed: 80px;
  --sidebar-width: var(--sidebar-width-expanded);
  
  --transition-speed: .2s;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow:    0 6px 18px rgba(0,0,0,0.06);
  --shadow-lg: 0 20px 40px -10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.02);

  /* Background Gradient (Subtle depth) */
  --gradient-body: radial-gradient(circle at 50% 0%, rgba(107,26,26,0.05) 0%, transparent 60%),
                   radial-gradient(circle at 100% 0%, rgba(200,200,255,0.05) 0%, transparent 50%);
}

.theme-dark {
  /* Dark Mode (Deep Black/Red) */
  --bg: #050505;
  --bg-accent: #0e0e11;

  --surface: rgba(20, 20, 23, 0.6);
  --surface-glass: rgba(20, 20, 23, 0.7);
  --surface-strong: #18181b;
  --surface-2: #27272a;
  --surface-1: #141417;

  --text: #94a3b8;
  --text-strong: #ffffff;
  --hover-text: #ffffff;
  --muted: #64748b;

  --brand: #902828;
  --brand-600: #991b1b;
  --brand-700: #450a0a;
  --brand-glow: rgba(144, 40, 40, 0.25);

  --accent: #27272a;
  --accent-strong: #3f3f46;
  --focus: #ef4444;

  --divider: rgba(255,255,255, 0.08);
  --border: rgba(255,255,255, 0.08);
  --border-hover: rgba(255,255,255, 0.15);

  --danger: #ef4444;

  --shadow-sm: 0 2px 10px rgba(0,0,0,0.3);
  --shadow:    0 6px 18px rgba(0,0,0,0.4);
  --shadow-lg: 0 25px 50px -12px rgba(0,0,0,0.6);

  --gradient-body: radial-gradient(circle at 50% -20%, rgba(107,26,26,0.2) 0%, transparent 50%),
                   linear-gradient(180deg, #050505 0%, #0a0a0a 100%);
}

/* ==========================================================================
   2. RESET & BASE TYPOGRAPHY
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.6;
  background: var(--bg);
  background-image: var(--gradient-body);
  background-attachment: fixed;
  color: var(--text);
  transition: background 0.4s ease, color 0.4s ease;
}

/* Prevent flashy transitions during initial render/theme switch */
body.preload * { transition: none !important; }
body.lock-scroll { overflow: hidden; }

img, svg, video, canvas, audio, iframe, embed, object { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--divider); margin: 24px 0; }
[hidden] { display: none !important; }

/* Typography Overrides */
h1, h2, h3, h4, h5, h6, 
.ui-main h1, .ui-main h4, 
.font-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-strong);
    margin: 0;
}
.ui-main h1 { font-size: 2.2rem; margin-bottom: 0.5rem; line-height: 1.1; }
.ui-main h4 { font-size: 1.1rem; margin-bottom: 1rem; }
.ui-main p { margin: 0; }

.ui-main a { color: var(--text-strong); text-decoration: none; transition: color 0.2s; }
.ui-main a:hover { color: var(--brand); text-decoration: none; }
.ui-main .text--muted { color: var(--muted); }

/* ==========================================================================
   3. LAYOUT SHELL
   ========================================================================== */
.ui-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100dvh;
  transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Right-hand column: main content + footer */
.ui-main-column {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* Main grows, footer sticks to bottom when content is short */
.ui-main {
  padding: 40px;
  color: var(--text);
  flex: 1 0 auto;
}

/* Global footer inside the layout shell */
/* Global footer — glassy status bar, matches sidebar look */
.footer {
  border-top: 1px solid var(--divider);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-glass) 70%, transparent) 0%, transparent 80%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  z-index: 40;
}

.theme-dark .footer {
  background:
    linear-gradient(180deg, color-mix(in srgb, #050505 70%, var(--surface-strong)) 0%, transparent 80%);
}

.footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

/* Small logo in footer, reusing logo-dark/logo-light like the sidebar */
.footer__logo {
  display: inline-flex;
  align-items: center;
}

.footer__logo img {
  height: 20px;
  width: auto;
  max-width: none;
  display: block;
}


.footer__title {
  font-size: 0.85rem;
}

/* Meta (© + tagline) */
.footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.footer__divider {
  opacity: 0.6;
}

.footer__tagline {
  opacity: 0.8;
}

/* Links (contact etc.) */
.footer__links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer__links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.footer__links a:hover {
  color: var(--brand);
}

/* Stack nicely on mobile */
@media (max-width: 768px) {
  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    padding-block: 8px;
  }
}



/* ==========================================================================
   4. NAVIGATION FRAMEWORK
   ========================================================================== */

/* 4.1. Sidebar (Desktop - Glassmorphism) */
.sidebar {
  position: sticky; top: 0; height: 100dvh;
  width: var(--sidebar-width);
  
  /* Glass Effect */
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  
  display: flex; flex-direction: column;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-out;
  z-index: 60;
}

.sidebar__inner {
  display: flex; flex-direction: column; height: 100%;
  padding: 20px; gap: 24px;
  overflow: visible; position: relative;
}

.sidebar__header, .sidebar__user, .sidebar__nav, .sidebar__footer { flex-shrink: 0; }
.sidebar__user { position: relative; z-index: 1000; }

/* Navigation Scroll Area */
.sidebar__nav { flex-grow: 1; overflow-y: auto; overflow-x: hidden; position: relative; z-index: 1; }
.sidebar__nav::-webkit-scrollbar { width: 6px; }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.sidebar__nav::-webkit-scrollbar-thumb { background-color: var(--border); border-radius: 8px; }

/* Header & Logo */
.sidebar__header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.sidebar__logo { display: block; }

/* Force consistent logo height in the sidebar, no weird stretching */
.sidebar__logo img {
  display: block;
  height: 32px;
  width: auto;
  max-width: none;
  object-fit: contain;
  transition: height 0.3s ease;
}

html:not(.theme-dark) .logo-dark { display:block; }
html:not(.theme-dark) .logo-light { display:none; }
html.theme-dark .logo-dark { display:none; }
html.theme-dark .logo-light { display:block; }

.sidebar__toggle {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  display: grid; place-items: center; transition: all 0.2s;
}
.sidebar__toggle:hover { background: var(--surface-strong); color: var(--text-strong); }
.sidebar__toggle svg { width: 18px; height: 18px; }

/* Band Switcher */
.band-switcher {
  background: var(--surface-strong); border: 1px solid var(--border);
  padding: 10px; border-radius: var(--radius); width: 100%;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  transition: all 0.2s;
}
.band-switcher:hover, .band-switcher[aria-expanded="true"] {
  border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-glow);
}
.band-switcher__avatar {
  width:32px; height:32px; border-radius:8px; overflow:hidden; background:var(--brand);
  display:grid; place-items:center; flex-shrink:0; color: #fff;
}
.band-switcher__avatar img { width:100%; height:100%; object-fit:cover; }
.band-switcher__fallback { color:#fff; font-weight:600; font-size:.8rem; }
.band-switcher__avatar--small { width:24px; height:24px; border-radius:6px; }
.band-switcher__avatar--small .band-switcher__fallback { font-size:.7rem; }

.band-switcher__meta { flex-grow:1; line-height:1.3; overflow:hidden; text-align: left; }
.band-switcher__name {
  display:block; font-weight:600; font-size:.9rem; color:var(--text-strong);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.band-switcher__plan { display:block; font-size:.75rem; color:var(--text); }
.band-switcher__icon { color:var(--text); }

.band-switcher--collapsed {
  display: none; align-items: center; justify-content: center; width: 100%;
  padding: 10px; border-radius: var(--radius); background: var(--surface-strong);
  border: 1px solid var(--border); cursor: pointer;
}
.band-switcher--collapsed:hover { border-color: var(--brand); }

/* Popover Menu */
.popover {
  position:absolute; top: calc(100% + 10px); left:0; width: 100%;
  z-index: 9999; 
  background: var(--surface-strong); border-radius: var(--radius);
  border:1px solid var(--border); box-shadow: var(--shadow-lg);
  overflow: hidden; opacity:0; transform: translateY(-10px); pointer-events:none;
  transition: opacity var(--transition-speed), transform var(--transition-speed);
}
.popover:not([hidden]) { opacity:1; transform: translateY(0); pointer-events:auto; }
.popover__header { padding:.75rem 1rem; font-size:.8rem; font-weight:600; color: var(--text-strong); border-bottom:1px solid var(--border); }
.popover__content { padding:.5rem; max-height: 300px; overflow-y: auto; }
.popover__content--empty { text-align:center; padding:1.5rem; }
.popover__button { display:inline-block; padding:.5rem 1rem; border-radius:8px; background: var(--accent-strong); color:#fff; font-weight:600; text-decoration:none; }
.popover__footer { padding:.5rem 1rem; border-top:1px solid var(--border); text-align:center; }
.popover__footer a { font-size:.8rem; color: var(--text); text-decoration:none; }

.band-list { list-style:none; margin:0; padding:0; }
.band-list__button {
  display:flex; align-items:center; gap:.75rem; width:100%; padding:.5rem;
  border-radius:8px; border:0; background:transparent; cursor:pointer; font:inherit;
  color:var(--text-strong); text-align:left;
}
.band-list__button:hover { background: var(--surface-2); }
.band-list__item.is-active .band-list__button { background: var(--brand-glow); color: var(--brand); }

/* Navigation Links */
.nav-group + .nav-group { margin-top: 20px; }
.nav-group__title {
  padding: 0 12px 8px; font-size: 0.7rem; font-weight: 700; 
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--brand);
  opacity: 1; transition: opacity 0.2s ease-out;
}
.nav-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap: 4px; }
.nav-item { position: relative; }

.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius); font-size: 0.9rem; font-weight: 500;
  color: var(--text); text-decoration: none; transition: all 0.2s;
  border: 1px solid transparent; background: transparent; width: 100%;
  cursor: pointer;
}
.nav-link:hover { color: var(--text-strong); background: rgba(0,0,0,0.03); }
.theme-dark .nav-link:hover { background: rgba(255,255,255,0.05); }

.nav-link.is-active {
  background: var(--surface-strong);
  color: var(--text-strong);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.nav-link.is-active .nav-link__icon { color: var(--brand); }
.nav-link__icon { display: grid; place-items: center; width: 20px; height: 20px; flex-shrink: 0; }
.nav-link__icon svg { width:20px; height:20px; transition: color 0.2s; }
.nav-link__label { white-space: nowrap; opacity: 1; flex-grow: 1; text-align: left; }
.nav-link__chevron { margin-left:auto; color:var(--text); transition: transform 0.2s; }

/* Collapsible Nav Items */
.nav-item--collapsible .nav-link--parent { width:100%; border:0; background:transparent; cursor:pointer; }
.nav-item--collapsible[aria-expanded="true"] .nav-link__chevron { transform: rotate(90deg); }
.nav-item--collapsible[aria-expanded="false"] .nav-list--nested { display:none; }
.nav-list--nested { margin: 4px 0 8px; padding-left: 16px; border-left: 1px solid var(--border); gap: 0; }
.nav-list--nested .nav-link { padding: 6px 12px; font-size: 0.85rem; font-weight: 400; border: none; background: transparent; box-shadow: none; }
.nav-list--nested .nav-link:hover { color: var(--text-strong); }
.nav-list--nested .nav-link.is-active { color: var(--brand); font-weight: 600; }

/* Sidebar Footer & Theme Icons */
.sidebar__footer { padding-top:1rem; border-top:1px solid var(--divider); display:flex; flex-direction:column; gap:.5rem; }
.sidebar__footer .nav-link { font-weight: 500; font-size: .9rem; }
.theme-icon-light { display: none; }
.theme-icon-dark { display: block; }
.theme-dark .theme-icon-light { display: block; }
.theme-dark .theme-icon-dark { display: none; }

/* 4.2. Sidebar (Collapsed State) */
body[data-sidebar-state="collapsed"] { --sidebar-width: var(--sidebar-width-collapsed); }
body[data-sidebar-state="collapsed"] .sidebar__header { padding-left: 0; justify-content: center; }
body[data-sidebar-state="collapsed"] .sidebar__logo { display: none; }
body[data-sidebar-state="collapsed"] .sidebar__toggle { transform: rotate(180deg); }
body[data-sidebar-state="collapsed"] .band-switcher { display: none; }
body[data-sidebar-state="collapsed"] .band-switcher--collapsed { display: flex; }
body[data-sidebar-state="collapsed"] .popover { left: var(--sidebar-width-collapsed); top: 0; margin-left: 12px; width: 260px; }
body[data-sidebar-state="collapsed"] .nav-group__title,
body[data-sidebar-state="collapsed"] .nav-link__label { opacity: 0; width: 0; pointer-events: none; transition: opacity 0.1s ease-out; }
body[data-sidebar-state="collapsed"] .nav-link { justify-content: center; padding: 12px 0; }
body[data-sidebar-state="collapsed"] .nav-link__icon { margin: 0; }
body[data-sidebar-state="collapsed"] .nav-link__chevron { display: none; }
body[data-sidebar-state="collapsed"] .nav-item--collapsible[aria-expanded="true"] .nav-list--nested { display: none; }

/* Collapsed Flyout Menu */
body[data-sidebar-state="collapsed"] .nav-item--collapsible:hover > .nav-list--nested {
  display: block; position: absolute; left: 100%; top: 0; z-index: 100; width: 220px;
  padding: 8px; margin-left: 12px; border-radius: var(--radius);
  background: var(--surface-strong); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}

/* Collapsed Tooltips */
[data-tooltip] { position: relative; }
body[data-sidebar-state="collapsed"] [data-tooltip]:hover::after {
  content: attr(data-tooltip); position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  margin-left: 1rem; background: var(--text-strong); color: var(--bg);
  border-radius: 6px; padding: 6px 12px; font-size: 0.8rem; font-weight: 600;
  white-space: nowrap; z-index: 999; pointer-events: none;
}

/* 4.3. Topbar & Mobile Header */
.topbar { background: var(--surface); border-bottom: 1px solid var(--divider); position: sticky; top: 0; z-index: 50; }
.topbar .container { display:flex; align-items:center; justify-content:space-between; gap:12px; max-width:1200px; margin:0 auto; padding:10px 16px; }
.brand { font-weight:800; color:var(--text-strong); text-decoration:none; display:inline-flex; gap:10px; align-items:center; }

#mobileHeader {
  display: none; /* Flex in media query */
  position: sticky; top:0; z-index:1000; height:60px;
  align-items:center; justify-content:space-between; padding:0 16px;
  background: var(--surface-glass); backdrop-filter: blur(12px);
  border-bottom:1px solid var(--border);
}
#mobileHeader .brand { font-family: var(--font-heading); font-weight: 700; color: var(--text-strong); text-decoration: none; }
#mobileHeader .menu-btn { background: transparent; border: none; padding: 8px; color: var(--text-strong); cursor:pointer; }
.menu-icon, .menu-icon::before, .menu-icon::after {
  content:""; display:block; width:24px; height:2px; background: currentColor;
  border-radius:1px; transition: all .25s; position:relative;
}
.menu-icon::before { top:-7px; }
.menu-icon::after  { top: 7px; }
.mobile-open .menu-icon { transform: rotate(45deg); }
.mobile-open .menu-icon::before { transform: translateY(7px) rotate(90deg); }
.mobile-open .menu-icon::after  { transform: translateY(-7px) rotate(90deg); }

/* 4.4. Off-canvas Mobile Nav */
.mobile-nav { position: fixed; inset: 0; pointer-events: none; z-index: 999; }
.mobile-nav .scrim { position:absolute; inset:0; background: rgba(0,0,0,.35); opacity:0; transition: opacity .25s ease; }
.mobile-nav .panel {
  position:absolute; top:0; bottom:0; right:0; width: min(85vw, 360px);
  background: var(--bg-accent); color: var(--text-strong);
  transform: translateX(100%); transition: transform .25s ease;
  box-shadow: var(--shadow-lg); padding:20px; overflow-y:auto;
}
.mobile-nav[aria-hidden="false"] { pointer-events:auto; }
.mobile-nav[aria-hidden="false"] .scrim { opacity:1; }
.mobile-nav[aria-hidden="false"] .panel { transform: translateX(0); }
.mobile-menu { display:grid; gap:8px; margin-top:20px; }
.mobile-menu a { display: block; padding: 12px; border-radius: var(--radius); color: var(--text); text-decoration: none; font-weight: 500; }
.mobile-menu a:hover { background: var(--surface-2); color: var(--text-strong); }

/* ==========================================================================
   5. CORE COMPONENTS
   ========================================================================== */

/* 5.1. Buttons & Actions (Updated to Pill Shape & Glow) */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  height: 40px; padding: 0 20px; margin: 0;
  border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--surface-strong); color: var(--text-strong);
  font-weight: 600; text-decoration:none; cursor:pointer; white-space:nowrap;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); 
  font-family: inherit; font-size: 0.9rem;
}
.btn:hover { transform: translateY(-1px); border-color: var(--text); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }

.btn--primary { 
    background: var(--brand); color: var(--brand-contrast) !important; border-color: transparent; 
    box-shadow: 0 4px 12px rgba(107, 26, 26, 0.3);
}
.btn--primary:hover { background: var(--brand-600); box-shadow: 0 8px 20px rgba(107, 26, 26, 0.4); }

.btn--danger  { background: var(--bg); border-color: var(--danger); color: var(--danger) !important; }
.btn--danger:hover  { background: var(--danger); color: white !important; }

.btn--reveal  { background: var(--accent); border-color: var(--divider); color: var(--text-strong); }
.btn--small   { height: 32px; padding: 0 14px; font-size: .8rem; }

/* Legacy alias fallback */
.btn.primary { background:var(--brand); color:white; }
.btn.danger  { background:var(--danger); color:white; }

.header-actions, .profile-header__actions, .form-actions { display:flex; gap:.75rem; flex-wrap:wrap; }
.form-actions--end { justify-content: flex-end; }

/* 5.2. Forms & Inputs (Modernized) */
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="tel"], input[type="url"], select, textarea {
  width: 100%; background: var(--bg-accent); color: var(--text-strong);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px;
  outline: none; transition: all 0.2s ease; font: inherit;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='%23666'%3E%3Cpath d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 10px 6px; padding-right: 36px;
}
.theme-dark select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='%23ffffff'%3E%3Cpath d='M0 0l5 6 5-6z'/%3E%3C/svg%3E"); }

.form-group { display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.form-group > label, label { display:block; font-weight:600; font-size: 0.85rem; color: var(--text-strong); }
.form-grid { display:grid; gap: 1.5rem; grid-template-columns: 1fr 1fr; }
.form-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid--checkboxes { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
.form-grid--catering   { grid-template-columns: 2fr 2fr auto; }
.form-grid--full { grid-column: 1 / -1; }
.form-divider { border:0; height:1px; background-color: var(--divider); margin: 1.5rem 0; }
.form--inline { display:inline; }

.form-label--checkbox {
  display:flex; align-items:center; gap:.75rem; padding:.75rem;
  background-color: var(--bg-accent); border:1px solid var(--divider);
  border-radius: var(--radius); cursor:pointer; transition: background-color var(--transition-speed);
}
.form-label--checkbox:hover { background-color: var(--surface-2); border-color: var(--brand); }
.form-label--checkbox input[type="checkbox"] { width:1.15em; height:1.15em; accent-color: var(--brand); flex-shrink:0; }

/* Search Form */
.search-form { position: relative; }
.search-form svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-form input { padding-left: 36px; width: 260px; }

/* 5.3. Cards, Grids & Key-Value (Glassy & Clean) */
.content-header, .profile-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 40px; border-bottom: none; padding-bottom: 0; gap: 20px; flex-wrap: wrap;
}
.header-subtitle { font-size: 1rem; color: var(--text); margin-top: 6px; }

.content-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 24px; }
.grid-col { display:flex; flex-direction:column; gap: 24px; }
.grid-col--full { grid-column: 1 / -1; }
.content-grid--two { display:grid; grid-template-columns: repeat(2, minmax(360px, 1fr)); gap: 24px; }

.card {
  background: var(--bg-accent); border: 1px solid var(--border); 
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  /* Allow tall forms and long content to show fully */
  overflow: visible;
  transition: transform 0.3s, box-shadow 0.3s;
}

/* Let cards size to their content instead of stretching awkwardly */
.content-grid .card,
.grid-col .card {
  height: auto;
}
.theme-dark .card { background: var(--surface-strong); }

.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand-glow); }
.card__header { 
    padding: 20px 24px; border-bottom: 1px solid var(--border); 
    display: flex; justify-content: space-between; align-items: center; 
}
.card__body   { padding: 24px; flex-grow: 1; }

/* Key-Value Display */
dl, dt, dd { margin: 0; }
.key-value { display: grid; gap: 1rem; }
.key-value__row {
  display: grid; grid-template-columns: 140px 1fr; gap: 1rem; align-items: start;
  padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.key-value__row:last-child { border: 0; padding-bottom: 0; }
.key-value dt { color: var(--text); }
.key-value dd { color: var(--text-strong); font-weight: 500; margin: 0; word-break: normal; }
.key-value--stacked .key-value__row { grid-template-columns: 1fr; }
.key-value--stacked dt { margin-bottom: .5rem; }
.key-value a { color: var(--brand); font-weight: 600; text-decoration: none; }
.key-value a:hover { text-decoration: underline; }

/* 5.4. Tables */
.table, table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--bg-accent); border: 1px solid var(--border); 
  border-radius: var(--radius); overflow: hidden;
  margin: 12px 0; box-shadow: var(--shadow-sm);
}
.table th, .table td, table th, table td { padding: 16px; text-align: left; }
.table thead th, table thead th { 
    background: var(--surface-2); color: var(--text-strong); 
    font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.table tbody tr + tr td, table tbody tr + tr td { border-top: 1px solid var(--border); }
.table tr:hover td, table tr:hover td { background: var(--surface-2); }
.table-responsive { width:100%; overflow-x:auto; border-radius: var(--radius); border:1px solid var(--border); }

/* Travel Party table: clearer, separated rows */
.table--party {
  border-radius: calc(var(--radius) + 2px);
}

.table--party tbody tr td {
  padding-top: 18px;
  padding-bottom: 18px;
}

/* subtle striping so entries feel like distinct people */
.table--party tbody tr:nth-child(odd) td {
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}

.table--party tbody tr:nth-child(even) td {
  background: var(--bg-accent);
}

/* slightly stronger divider between rows */
.table--party tbody tr + tr td {
  border-top-color: color-mix(in srgb, var(--border) 70%, transparent);
}

/* keep hover state obvious but soft */
.table--party tr:hover td {
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
}

/* 5.5. Badges, Status & Lists */
.badge-group { display:flex; flex-wrap:wrap; gap:.5rem; }
.badge { 
    display:inline-block; padding: 4px 10px; border-radius: 99px; 
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; 
}
.badge--subtle { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.badge--role   { background: var(--brand); color:#fff; }
.badge.ok { background: rgba(34, 197, 94, 0.1); color: #15803d; border: 1px solid rgba(34, 197, 94, 0.2); }
.theme-dark .badge.ok { color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.badge.warn { background: rgba(245, 158, 11, 0.1); color: #b45309; border: 1px solid rgba(245, 158, 11, 0.2); }
.theme-dark .badge.warn { color: #fbbf24; background: rgba(251, 191, 36, 0.1); }
.badge.danger { background: rgba(239, 68, 68, 0.1); color: #b91c1c; border: 1px solid rgba(239, 68, 68, 0.2); }
.theme-dark .badge.danger { color: #f87171; background: rgba(248, 113, 113, 0.1); }

.status-display, .status-dot { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.status-dot { width:10px; height:10px; border-radius:50%; background: var(--text); flex-shrink:0; }
.status-dot.ok { background:#22c55e; }
.status-dot.warn { background:#f59e0b; }
.status-dot.danger { background:#ef4444; }

.styled-list, .document-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:1rem; }
.styled-list li span { font-size:.875rem; color: var(--text); }

.document-list li {
  display:flex; justify-content:space-between; align-items:center; gap:1rem;
  background: var(--bg-accent); padding: 16px; border-radius: var(--radius); border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.document-list li:hover { border-color: var(--brand-glow); }
.document-info { display:flex; align-items:center; gap:1rem; }
.document-meta { display:flex; flex-direction:column; line-height:1.3; }
.document-meta small { font-size:.8rem; color: var(--text); }
.document-icon { color: var(--text); }
.document-icon svg { width: 18px; height: 18px; display: block; }
.document-list .btn.btn--small { background:#3f3f3f; color:#fff !important; border-color:transparent; }
.document-list .btn.btn--small:hover { filter: brightness(1.1); }

.fi { margin-right: 6px; vertical-align: -0.1em; }

/* ==========================================================================
   6. DOMAIN MODULES (PRESERVED & STYLED)
   ========================================================================== */

/* 6.1. People */
.person-list { display: flex; flex-direction: column; gap: .75rem; }
.person-row {
  display: grid; grid-template-columns: 56px 2fr 1fr 1fr 1fr auto;
  align-items: center; gap: 1.25rem; padding: 16px;
  border-radius: var(--radius); background: var(--bg-accent); 
  border: 1px solid var(--border); transition: all .2s;
}
.person-row > div { justify-self: start; }
.person-row > .person-actions { justify-self: end; }

.person-row--header {
  padding-top: .7rem; padding-bottom: .8rem; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text-strong); pointer-events: none;
  font-weight: 700; font-size: 0.85rem; text-transform: uppercase;
}
.person-row--header strong { font-size: .875rem; font-weight: 700; color: var(--text); }

.person-row:hover:not(.person-row--header) {
  transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--brand-glow);
}
.theme-dark .person-row { background: var(--surface-strong); border: 1px solid var(--border); }
.theme-dark .person-row:hover:not(.person-row--header) { background: var(--surface-2); box-shadow: 0 4px 20px rgba(0, 0, 0, .2); }

.person-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2);
  color: var(--text-strong); display: grid; place-items: center;
  font-weight: 600; font-size: .9rem; flex-shrink: 0; overflow: hidden; position: relative;
  border: 1px solid var(--border); font-family: var(--font-heading);
}
.person-avatar__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.person-avatar.has-image span { display: none; }
.person-avatar--profile {
  width: 120px; height: 120px; font-size: 2.5rem;
  border: 4px solid var(--bg); box-shadow: var(--shadow-lg);
}
.person-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.person-actions form { margin: 0; }
.person-actions .btn.btn--small { background: #3f3f3f; color: #fff !important; border-color: transparent; }
.person-actions .btn.btn--small:hover { filter: brightness(1.1); }
.person-actions .btn.btn--small.btn--danger { background: var(--brand); }

.person-status { display: flex; align-items: center; gap: .5rem; }
.add-person:hover { filter: none; background: var(--brand); color: #a8a8ad !important; border-color: transparent; transform: none; }
.profile-header { align-items: flex-start; }
.profile-header__main { display: flex; align-items: center; gap: 1.5rem; }
.profile-header__info h1 { font-size: 2.25rem; font-weight: 700; color: var(--text-strong); margin: 0 0 .5rem; }
.profile-header__tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.profile-header__actions .btn { background: #3f3f3f; color:#fff !important; border-color: transparent; }
.profile-header__actions .btn:hover { filter: brightness(1.1); }
.profile-header__actions .btn.btn--danger  { background: var(--brand); }
.notes-box {
  background: var(--bg-accent);
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-strong);
  white-space: pre-wrap;
  line-height: 1.6;
}

/* 6.2. Sheets */
.sheet { background: var(--bg-accent); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.sheet__brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 6px 0 12px; }
.sheet__brand img { height: 58px; width: auto; object-fit: contain; }
.sheet__title {
  text-align: center; font-weight: 800; letter-spacing: .02em; padding: 12px 12px;
  margin: 12px 0 18px; border-radius: 8px; background: var(--brand); color: var(--brand-contrast);
  font-family: var(--font-heading);
}
.sheet__title--subtle { background: var(--surface-2); color: var(--text-strong); border: 1px solid var(--divider); }
.sheet__actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; }
.sheet__strap { margin: 0 0 10px; font-style: italic; text-align: center; color: var(--text-strong); opacity: .9; }
.sheet__helper { margin: 6px 0 12px; text-align: center; color: var(--text); font-size: .9rem; }
.sheet-table th, .sheet-table td { vertical-align: top; }
.sheet-table tfoot td { font-weight: 700; }

/* 6.3. Schedule Editor */
.day-heading { margin-top: 1.5rem; margin-bottom: 0.5rem; }
.schedule-day-group:first-child .day-heading { margin-top: 0; }
.ui-main h4 + .table-responsive { margin-top: 8px; }

/* Drag & Drop Visuals */
.table .drag-handle { cursor: grab; user-select: none; opacity: .5; text-align: center; }
.table .drag-handle:active { cursor: grabbing; }
.table .drag-handle:hover { opacity: 1; color: var(--brand); }
.sched-row.dragging { opacity: .6; background: var(--surface-2); box-shadow: 0 0 0 2px var(--brand); }
.sched-row.editing td { background: color-mix(in srgb, var(--surface) 80%, transparent); }
.table[data-day] tbody:empty::after {
  content: 'Drop items here'; display: block; padding: 1rem;
  text-align: center; color: var(--text); opacity: .7; background: var(--surface);
}

/* Time Focus Visuals */
.schedule-row .row-time { cursor: pointer; user-select: none; }
.schedule-row .time-start, .schedule-row .time-end {
  display: inline-block; padding: 2px 6px; border-radius: 6px;
  transition: background-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.schedule-row.nudge-target-start .time-start, .schedule-row .time-start[data-selected="1"],
.schedule-row.nudge-target-end .time-end, .schedule-row .time-end[data-selected="1"] {
  box-shadow: 0 0 0 2px var(--brand) inset;
}
.schedule-row.nudge-target-start .time-end, .schedule-row.nudge-target-end .time-start { opacity: 0.85; }
.schedule-row .time-badge { font-size: 12px; opacity: 0.8; vertical-align: baseline; margin-left: 2px; }
.time-nudge-controls { margin-top: 4px; --cluster-gap: 6px; }
.time-nudge.btn.btn--small { padding-inline: 8px; }

/* Schedule Overlap (Editor) */
.table .schedule-row.is-overlap td { background: color-mix(in srgb, var(--surface) 70%, transparent); position: relative; }
.table .schedule-row.is-overlap td:first-child { background: inherit; }
.table .schedule-row.is-overlap::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px;
  border-radius: 4px; background: var(--danger); opacity: .9;
}
.badge.badge--concurrent {
  display: inline-block; margin-left: 6px; padding: 2px 6px; font-size: 12px;
  line-height: 1; border-radius: 999px; background: var(--bg); color: var(--text); border: 1px solid var(--divider);
}

/* 6.4. Merch UI (Updated Colors) */
.mch-wrap {
  --mch-bg: var(--bg); --mch-fg: var(--text); --mch-sub: var(--muted); 
  --mch-ac: var(--brand); --mch-mid: var(--bg-accent); --mch-border: var(--border);
  --mch-ok: var(--success); --mch-warn: var(--warning); --mch-bad: var(--danger);
}
.mch { color:var(--mch-fg); }
.mch a { color:var(--mch-ac); text-decoration:none; }
.mch a:hover { text-decoration:underline; }
.mch-page { padding:24px; display:flex; gap:24px; background:var(--mch-bg); min-height:100vh; }
.mch-col { flex:1; }
.mch-h1 { font-size:28px; font-weight:700; letter-spacing:.3px; margin:0 0 12px; font-family: var(--font-heading); color: var(--text-strong); }
.mch-sub { color:var(--mch-sub); font-size:14px; margin-bottom:18px; }
.mch-grid { display:grid; gap:16px; }
.mch-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.mch-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.mch-4 { grid-template-columns:repeat(4,minmax(0,1fr)); }

.mch-card {
  background: var(--bg-accent); border:1px solid var(--mch-border); border-radius:16px; padding:16px; box-shadow: var(--shadow-sm);
}
.mch-card h3 { margin:0 0 8px; font-size:16px; font-weight:600; color: var(--text-strong); }
.mch-metric { font-size:22px; font-weight:700; color: var(--text-strong); }
.mch-muted { color:var(--mch-sub); font-size:12px; }

.mch-table { width:100%; border-collapse:separate; border-spacing:0; overflow:hidden; border-radius:14px; border:1px solid var(--mch-border); }
.mch-table th, .mch-table td { padding:12px 10px; text-align:left; border-bottom:1px solid var(--mch-border); }
.mch-table thead th { background: var(--surface-2); font-size:12px; text-transform:uppercase; letter-spacing:.4px; color:var(--text-strong); }
.mch-table tr:hover td { background: var(--surface-2); }

.mch-badge { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--mch-border); border-radius:999px; padding:6px 10px; font-size:12px; color:var(--mch-sub); }
.mch-badge.ok { border-color:rgba(40,192,139,.35); color: var(--success); background: rgba(34, 197, 94, 0.1); }
.mch-badge.warn { border-color:rgba(255,176,32,.35); color: var(--warning); background: rgba(245, 158, 11, 0.1); }
.mch-badge.bad { border-color:rgba(255,93,93,.4); color: var(--danger); background: rgba(239, 68, 68, 0.1); }

.mch-input, .mch-select { width:100%; background: var(--bg); color: var(--text-strong); border:1px solid var(--mch-border); border-radius:12px; padding:10px 12px; font-size:14px; outline:none; transition:.15s border-color ease; }
.mch-input:focus, .mch-select:focus { border-color:var(--mch-ac); }

.mch-row { display:flex; gap:12px; align-items:center; }
.mch-btn {
  border:1px solid var(--mch-border); background: var(--surface-strong); color: var(--text-strong);
  border-radius:12px; padding:10px 14px; font-weight:600; cursor:pointer; transition:transform .06s ease, border-color .15s;
}
.mch-btn:hover { border-color:var(--mch-ac); }
.mch-btn:active { transform:translateY(1px); }
.mch-btn.primary { background: var(--brand); color: white; border-color: var(--brand); }
.mch-btn.ghost { background:transparent; }

.mch-chip { font-size:11px; padding:4px 8px; border-radius:999px; border:1px solid var(--mch-border); color:var(--mch-sub); }
.mch-qty { display:flex; align-items:center; gap:8px; }
.mch-qty .qbtn { width:36px; height:36px; border-radius:10px; display:inline-grid; place-items:center; border:1px solid var(--mch-border); background: var(--bg); font-weight:800; cursor:pointer; }
.mch-qty input { width:72px; text-align:center; }
.mch-kpi { display:flex; gap:12px; flex-wrap:wrap; }
.mch-kpi .k { flex:1; min-width:140px; background: var(--surface-strong); border:1px solid var(--mch-border); border-radius:12px; padding:12px; }
.mch-kpi .k .v { font-size:18px; font-weight:700; color: var(--text-strong); }
.mch-foot { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:14px; }

/* 6.5. Advance View (Management grid, VIP, Specs, Schedule chips) */

/* Advance Management — Modern Cards */
ul.document-list-grid {
  list-style:none; padding:0; margin:0;
  display:grid; gap:12px;
  grid-template-columns:repeat(5,1fr);
}

ul.document-list-grid li {
  display:flex; flex-direction:column; gap:12px; justify-content:space-between;
  padding:16px;
  border:1px solid var(--divider);
  border-radius:14px;
  /* soft gradient + subtle inner border */
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 60%, transparent) 0%, transparent 70%),
    var(--surface-1);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  position:relative; isolation:isolate;
}

ul.document-list-grid li::after {
  /* top accent hairline that animates on hover */
  content:""; position:absolute; inset:0; border-radius:14px;
  pointer-events:none;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--accent-strong) 16%, transparent);
  opacity:.6;
}

ul.document-list-grid li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent-strong) 28%, var(--divider));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 70%),
    var(--surface-1);
}

/* icon pod */
ul.document-list-grid .document-info { display:flex; gap:12px; align-items:center; }
ul.document-list-grid .document-icon {
  flex-shrink:0; width:42px; height:42px; display:grid; place-items:center;
  border-radius:12px;
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--divider) 70%, transparent);
  color: var(--text-strong);
}
ul.document-list-grid .document-icon svg { width:22px; height:22px; opacity:.9; }

/* title + tiny stat pill */
ul.document-list-grid .document-meta span {
  display:flex; align-items:center; gap:8px;
  font-weight:700; font-size:1.05rem; color:var(--text-strong);
}
ul.document-list-grid .document-meta small {
  display:block; margin-top:2px; font-size:.86rem; color:var(--text); opacity:.9;
}

/* nicer stat badge inside title row */
ul.document-list-grid .badge.badge--subtle {
  border-radius:999px;
  padding:.25rem .55rem;
  background: color-mix(in srgb, var(--accent) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--divider) 85%, transparent);
  font-weight:700; font-size:.72rem;
}

/* actions row — first button becomes primary, second is ghost */
ul.document-list-grid .document-actions {
  display:flex; gap:8px; justify-content:flex-end; padding-top:10px;
  border-top:1px solid color-mix(in srgb, var(--divider) 85%, transparent);
}
ul.document-list-grid .document-actions .btn.btn--small {
  height:34px; padding:0 12px; border-radius:10px; box-shadow:none;
}
/* primary (Edit) */
ul.document-list-grid .document-actions .btn.btn--small:first-child {
  background: var(--brand); color: var(--brand-contrast) !important; border-color: transparent;
}
ul.document-list-grid .document-actions .btn.btn--small:first-child:hover {
  filter:brightness(1.06); transform: translateY(-1px);
}
/* ghost (View) */
ul.document-list-grid .document-actions .btn.btn--small:last-child {
  background: transparent; color: var(--text-strong);
  border-color: color-mix(in srgb, var(--divider) 80%, transparent);
}
ul.document-list-grid .document-actions .btn.btn--small:last-child:hover {
  background: color-mix(in srgb, var(--accent) 60%, transparent);
  border-color: var(--accent-strong);
}

/* theme light tweaks (keeps DOM the same) */
.theme-light ul.document-list-grid li {
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 40%, var(--surface)) 0%, var(--surface-1) 100%);
}
.theme-light ul.document-list-grid li:hover {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 20%, transparent) 0%, var(--surface-1) 100%);
}
.theme-light ul.document-list-grid .document-icon {
  background: color-mix(in srgb, #fff 70%, var(--surface-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--divider) 60%, transparent);
}

/* ====== VIP Card Styles ====== */
.vip-card {
    margin-top:14px;
    padding:14px 14px 12px;
    border:1px solid color-mix(in srgb, var(--accent, #6cf) 40%, var(--divider, #2a2a2a));
    border-left-width:4px;
    border-radius:10px;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--accent, #6cf) 10%, transparent) 0%, transparent 80%),
      var(--surface-2, #1e1e1e);
}
@supports not (color-mix(in srgb, red 10%, transparent)) {
    .vip-card { background: linear-gradient(180deg, rgba(108,204,255,.08) 0%, transparent 80%), var(--surface-2, #1e1e1e); }
}
.vip-head {
    display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px;
}
.vip-pill {
    font-weight:700; font-size:.85rem; letter-spacing:.02em;
    padding:4px 10px; border-radius:999px;
    color: var(--text-on-accent, #000);
    background: var(--accent, #6cf);
    mix-blend: normal;
}
.vip-source { color: var(--muted, #9aa0a6); font-size:.8rem; }
.vip-metric {
    display:flex; align-items:baseline; gap:10px; margin:2px 0 6px;
}
.vip-num {
    font-size:1.65rem; font-weight:800; line-height:1;
}
.vip-sub { color: var(--muted, #9aa0a6); font-size:.9rem; }
.vip-bar {
    width:100%; height:10px; border-radius:999px; overflow:hidden;
    background: var(--surface-1, #111);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, #6cf) 25%, transparent);
    margin-top:6px;
}
.vip-bar > span {
    display:block; height:100%;
    background: var(--accent, #6cf);
    width: 0%;
    transition: width .3s ease;
}
.vip-foot { color: var(--muted, #9aa0a6); font-size:.8rem; margin-top:6px; }

/* ====== Specs Lightbox Styles ====== */
#specsOverlay iframe.specs-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #111;
}
#specsOverlay img.specs-img {
    max-width: 96%;
    max-height: 92%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,.45);
}
#specsOverlay .no-preview {
    color: #ddd;
    text-align: center;
    max-width: 780px;
    padding: 24px;
    line-height: 1.5;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
}

/* Schedule / Timeline inline time chip visuals (Advance View summary) */
.av-time-inline {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-strong);
}
.av-time-inline .tr-dash { opacity: .7; }
.av-time-inline .tr-badge {
    display: inline-block;
    font-size: 12px;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
}
.av-time-col { width: 200px; text-align: right; }

@media print {
    .av-time-col { width: 180px; }
}

/* Overlapping items — subtle amber styling (Advance View summary) */
.table tr.is-concurrent td {
    background:
        linear-gradient(90deg, rgba(255,215,0,.06), transparent 55%),
        color-mix(in srgb, #f6b93b 10%, transparent);
    box-shadow: inset 4px 0 0 0 #f6b93b; /* left rail */
}
.theme-light .table tr.is-concurrent td {
    background:
        linear-gradient(90deg, rgba(255,215,0,.08), transparent 55%),
        color-mix(in srgb, #f6b93b 12%, transparent);
}
.av-overlap-pill {
    display:inline-block;
    margin-left:8px;
    padding:2px 8px;
    font-size:12px;
    font-weight:700;
    letter-spacing:.03em;
    text-transform:uppercase;
    border-radius:999px;
    background: color-mix(in srgb, #f6b93b 15%, var(--surface, #222));
    border: 1px solid color-mix(in srgb, #f6b93b 40%, var(--divider, #333));
    color: var(--text, #fff);
    opacity:.9;
}

/* ==========================================================================
   7. OVERLAYS & MODALS
   ========================================================================== */
/* Standard Modal */
.modal-overlay {
  position: fixed; inset: 0; background-color: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display:flex; align-items:center; justify-content:center; z-index: 1000;
  opacity:0; visibility:hidden; transition: opacity .3s, visibility .3s;
}
.modal-overlay.is-open { opacity:1; visibility:visible; }
.modal-content {
  background: var(--bg-accent); border-radius: var(--radius-lg); padding:32px;
  max-width: 90vw; max-height: 90vh; width: 800px; display:flex; flex-direction:column;
  transform: scale(.95); transition: transform .3s; box-shadow: var(--shadow-lg);
}
.modal-overlay.is-open .modal-content { transform: scale(1); }
.modal-header {
  display:flex; justify-content:space-between; align-items:center;
  border-bottom:1px solid var(--divider); padding-bottom:1rem; margin-bottom:1rem;
  color: var(--text-strong); font-size:1.25rem; font-weight:600; font-family: var(--font-heading);
}
.modal-close-btn { background:none; border:none; color:var(--text); font-size:2rem; line-height:.5; cursor:pointer; }
.modal-close-btn:hover { color: var(--text-strong); }
.modal-body { flex-grow:1; overflow-y:auto; text-align:center; }
.modal-body img { max-width:100%; max-height:100%; height:auto; object-fit:contain; }
.modal-body iframe, .modal-body embed { width:100%; height:100%; min-height:70vh; border:none; }
.modal-body .download-link { display:inline-block; margin-top:2rem; font-size:1.2rem; }
body.body--modal-open { overflow:hidden; }

/* Upload Overlay */
.upload-overlay {
  position: fixed; inset: 0; display:none; z-index: 9999;
  align-items:center; justify-content:center; background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
}
.upload-overlay__content {
  width: min(520px, 92vw); background: var(--bg-accent); color: var(--text-strong);
  border:1px solid var(--divider); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.progress-bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.progress-bar__inner { height:100%; width:0%; background: var(--brand); transition: width .15s ease; border-radius: 99px; }

/* Legacy Image Lightbox (posters/specs hooks use this too) */
.img-overlay {
  position:fixed; inset:0; background: rgba(0,0,0,.9); display:none; align-items:center; justify-content:center; z-index:9999;
}
.img-overlay.is-open { display:flex; }
.img-overlay__img {
  max-width:95vw; max-height:95vh; width:auto; height:auto; display:block;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
}
.img-overlay__close {
  position:absolute; top:12px; right:16px; font-size:28px; line-height:1; padding:6px 10px;
  border-radius:8px; border:1px solid #444; background: rgba(0,0,0,.35); color:#fff; cursor:pointer;
}

/* ==========================================================================
   8. UTILITIES
   ========================================================================== */
.container { max-width: 1200px; margin:0 auto; padding: 16px; }
.stack > * + * { margin-top: var(--stack-gap, 12px); }
.cluster { display:flex; align-items:center; flex-wrap:wrap; gap: var(--cluster-gap, 8px); }

.hide { display:none !important; }
.only-mobile { display:none; }
.hide-mobile { display: initial; }

.flex { display:flex; }
.items-center { align-items:center; }
.justify-between { justify-content:space-between; }
.justify-end { justify-content: flex-end; }
.gap-8 { gap:8px; } .gap-12 { gap:12px; } .gap-16 { gap:16px; }
.w-100 { width:100%; } .max-w-800 { max-width:800px; }
.w-56px { width: 56px; } .w-100px { width: 100px; } .w-120px { width: 120px; }
.rounded { border-radius: var(--radius); }
.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Poster utilities */
.poster-box {
  width:180px; flex:0 0 180px; border-radius:10px; background:#202026;
  padding:8px; text-align:center;
}
.poster-area { max-width:400px; width:100%; flex:0 0 auto; }
.poster-frame {
  width:100%; border:1px solid #e5e7eb; border-radius:10px; background:#fff;
  padding:8px; display:flex; align-items:center; justify-content:center; text-align:center;
}
.poster-frame img,
.poster-box img,
.poster-area img,
img[alt="Event Poster"] {
  width:100%; height:auto; max-width:400px; max-height:500px;
  object-fit:contain; display:block; border-radius:6px;
}
.poster-placeholder {
  width:100%; max-width:400px; height:500px; border:1px dashed #cbd5e1; border-radius:6px;
  color:#64748b; font-size:12px; display:flex; align-items:center; justify-content:center;
}
.js-poster { cursor: zoom-in; }
.poster-edit { max-width: 500px; width: 100%; }
.poster-edit .poster-frame {
  width: 100%; border: 1px solid var(--divider); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; display: grid; place-items: center;
}
.poster-edit .poster-frame img {
  width: 100%; height: auto; display: block; object-fit: contain; cursor: zoom-in;
}

/* Make band-name links a touch more obvious */
.band-name-link { text-decoration: underline; text-underline-offset: 2px; }
.band-name-link:hover { opacity: .9; }

/* ==========================================================================
   9. RESPONSIVE & PRINT GLOBAL
   ========================================================================== */

/* Tablet & Mobile (< 1200px) */
@media (max-width: 1200px) {
  .person-row { grid-template-columns: 48px 2fr 1fr 1fr 1fr auto; gap: 1rem; padding-inline: 1rem; }
  ul.document-list-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

/* Tablet & Mobile (< 960px) */
@media (max-width: 960px) {
  :root { --sidebar-width: 0px; } /* Effectively hide desktop sidebar space */
  #mobileHeader { display: flex; }
  .sidebar { display: none; }
  .ui-shell { grid-template-columns: 1fr; }
  .ui-main { padding: 20px; }

  /* Stack Grids */
  .content-grid, .content-grid--two, .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
  .key-value__row { grid-template-columns: 1fr; }
  .key-value dt { margin-bottom: 0.25rem; }
  .person-row { grid-template-columns: 48px 1fr; align-items: start; gap: 8px; }
  .person-row > div:nth-child(n+3) { display: none; } /* Simplify rows on mobile */
  .person-actions { justify-self: start; margin-top: 8px; }

  ul.document-list-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
  /* Stack Tables option */
  table.stack-mobile { width:100%; border-collapse:collapse; }
  table.stack-mobile thead { display:none; }
  table.stack-mobile tr {
    display:block; background: var(--bg-accent); margin-bottom:12px;
    border-radius: var(--radius); border:1px solid var(--divider); overflow:hidden;
  }
  table.stack-mobile td {
    display:flex; justify-content:space-between; gap:12px; padding:10px 12px;
    border:none; border-top:1px solid var(--divider);
  }
  table.stack-mobile td:first-child { border-top:none; }
  table.stack-mobile td::before { content: attr(data-label); font-weight:600; color: var(--text); }

  ul.document-list-grid { grid-template-columns: 1fr; }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
  .ui-main { padding: 16px; }
  .profile-header { flex-direction: column; align-items: flex-start; }
  .profile-header__info h1 { font-size: 1.5rem; }
  .person-avatar--profile { width: 90px; height: 90px; font-size: 2rem; }
}

/* ======================================================================
   10. SUPPORT LIVECHAT (Operator Console)
   ====================================================================== */

.support-chat-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
}

.support-chat-messages {
  flex: 1;
  min-height: 140px;
  max-height: 320px;
  padding: 8px 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-1) 80%, transparent);
  overflow-y: auto;
}

.support-chat-messages::-webkit-scrollbar {
  width: 6px;
}
.support-chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.support-chat-empty {
  font-size: 0.85rem;
  padding: 8px;
}

.support-chat-row {
  margin-bottom: 8px;
  max-width: 80%;
}

.support-chat-row--user {
  text-align: left;
}
.support-chat-row--op {
  margin-left: auto;
  text-align: right;
}

.support-chat-bubble {
  display: inline-block;
  padding: 8px 11px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: var(--shadow-sm);
  background: var(--surface-2);
  color: var(--text-strong);
}

.support-chat-row--op .support-chat-bubble {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--brand) 85%, #f97373) 0%,
      color-mix(in srgb, var(--brand) 65%, #f97373) 70%);
  color: #fff;
}

.support-chat-meta {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
}

.support-chat-row--op .support-chat-meta {
  text-align: right;
}

.support-chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.support-chat-input {
  flex: 1;
  min-height: 34px;
  max-height: 80px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-accent);
  padding: 8px 12px;
  font-size: 0.85rem;
  line-height: 1.3;
  resize: none;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.support-chat-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-glow);
}

/* ===========================================================
   GLOBAL NOTIFICATION TOASTS (Improved, AdvancingBud-themed)
   =========================================================== */

.ab-support-toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
  pointer-events: none;
}

.ab-support-toast {
  min-width: 280px;
  max-width: 380px;
  background: linear-gradient(145deg,
      rgba(107, 26, 26, 0.15) 0%,
      var(--surface-strong) 55%);
  border: 1px solid rgba(107, 26, 26, 0.35);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-strong);
  opacity: 0;
  transform: translateY(-12px) scale(.98);
  transition:
    opacity .25s ease,
    transform .25s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: auto;
  cursor: pointer;
  box-shadow:
    0 8px 20px rgba(0,0,0,0.25),
    0 0 10px rgba(107, 26, 26, 0.18);
}

.ab-support-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ab-support-toast-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.ab-support-toast-title {
  font-size: 0.92rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-strong);
}

.ab-support-toast-ticket {
  font-size: 0.78rem;
  color: var(--brand);
  font-weight: 600;
}

.ab-support-toast-body {
  font-size: 0.82rem;
  color: var(--text);
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}




/* Print Styles */
@media print {
  .print-hide, .sidebar, #mobileHeader, .ui-sidebar, .footer, .btn { display:none !important; }
  .ui-main { padding: 0 !important; }
  body, .card { background:#fff !important; color:#000 !important; }
  .card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  .content-grid { grid-template-columns: 1fr; }
  .profile-header { border-bottom: 2px solid #000; padding-bottom: 1rem; }
  a { text-decoration:none; color:inherit; }

  /* Sheet specific print overrides */
  .sheet { border: none; border-radius: 0; padding: 0; }
  .sheet__title { border-radius: 0; margin: 0 0 10mm; background: #fff; color: #000; border: 2px solid #000; }
  .table { border: 1px solid #000; }
  .table th, .table td { border-top: 1px solid #000; }
}
