/**
 * PhotoTouch Admin — style.css
 * Single consolidated stylesheet.
 * Bootstrap 5 + Font Awesome 5 required.
 * Light / dark themes via data-theme="dark|light" on <html>.
 * OS preference honoured automatically; localStorage persists the toggle.
 *
 * Sections:
 *  1.  Design Tokens – dark (default)
 *  2.  Light theme overrides
 *  3.  OS preference fallback
 *  4.  Base / body / typography
 *  5.  Login / auth layout
 *  6.  Premium card (glassmorphism)
 *  7.  Form controls
 *  8.  Buttons
 *  9.  Sticky nav (.siteMessage)
 * 10.  Footer (#footer)
 * 11.  Content cards (.card, .dspBox, .toolBar, .card-toolbar)
 * 12.  Tables
 * 13.  Alerts & messages
 * 14.  Modals & popups
 * 15.  Utility / layout helpers
 * 16.  Notification boxes
 * 17.  Views-clean utilities (migrated)
 * 18.  Animations
 * 19.  Responsive / media queries
 * 20.  Content view utilities (migrated inline styles)
 * 21.  Marketing — Media Library + Template Gallery
 * 22.  Components — status badges, .important, empty states, nav links
 * 23.  Layout Shell — #topbar + #sidebar + #app-shell
 * 30.  Dashboard — nav cards + stat cards
 * 41.  Registration — CSV preview, search result, stat skeleton
 */


/* ═══════════════════════════════════════════════════════════════════
   0. SELF-HOSTED FONT — Plus Jakarta Sans (replaces Google Fonts CDN)
   ═══════════════════════════════════════════════════════════════════ */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/plus-jakarta-sans-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/plus-jakarta-sans-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}


/* ═══════════════════════════════════════════════════════════════════
   1. DESIGN TOKENS — DARK (DEFAULT)
   ═══════════════════════════════════════════════════════════════════ */
:root {
  /* Brand */
  --brand:          #7c3aed;
  --brand-shadow:   rgba(124, 58, 237, 0.30);
  --brand-glow:     rgba(124, 58, 237, 0.16);

  /* Background layers */
  --bg-top:         #071a2c;
  --bg-mid:         #061525;
  --bg-bot:         #030a12;

  /* Surfaces */
  --surface:        rgba(11, 11, 11, 0.82);
  --surface-hover:  rgba(255, 255, 255, 0.04);
  --border:         rgba(255, 255, 255, 0.08);

  /* Text */
  --text:           #ffffff;
  --muted:          rgba(255, 255, 255, 0.58);

  /* Semantic */
  --color-success:  #86efac;
  --color-danger:   #fca5a5;
  --color-warning:  #fbbf24;
  --color-info:     #67e8f9;
  --bg-success:     rgba(34, 197, 94, 0.15);
  --bg-danger:      rgba(239, 68, 68, 0.15);
  --border-success: rgba(34, 197, 94, 0.30);
  --border-danger:  rgba(239, 68, 68, 0.30);

  /* Misc */
  --radius-card:    16px;
  --radius-premium: 32px;
  --shadow-card:    0 8px 32px rgba(0, 0, 0, 0.40);
  --shadow-premium: 0 18px 50px rgba(0, 0, 0, 0.55);

  /* Component geometry */
  --radius-btn:     8px;
  --radius-btn-sm:  6px;
  --radius-input:   8px;

  /* Brand interaction */
  --brand-hover:    #6d28d9;
}


/* ═══════════════════════════════════════════════════════════════════
   2. LIGHT THEME OVERRIDES  [data-theme="light"] on <html>
   ═══════════════════════════════════════════════════════════════════ */
[data-theme="light"] {
  --bg-top:         #eef2ff;
  --bg-mid:         #e0e7ff;
  --bg-bot:         #dbeafe;

  --surface:        rgba(255, 255, 255, 0.80);
  --surface-hover:  rgba(0, 0, 0, 0.04);
  --border:         rgba(0, 0, 0, 0.10);

  --text:           #0f172a;
  --muted:          rgba(15, 23, 42, 0.55);

  --color-success:  #166534;
  --color-danger:   #991b1b;
  --color-warning:  #92400e;
  --color-info:     #0e7490;
  --bg-success:     rgba(34, 197, 94, 0.12);
  --bg-danger:      rgba(239, 68, 68, 0.10);
  --border-success: rgba(34, 197, 94, 0.25);
  --border-danger:  rgba(239, 68, 68, 0.25);

  --shadow-card:    0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-premium: 0 12px 40px rgba(0, 0, 0, 0.12);
}


/* ═══════════════════════════════════════════════════════════════════
   3. OS PREFERENCE FALLBACK
   Applied when user has NOT manually set a theme via the toggle.
   ═══════════════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-top:         #eef2ff;
    --bg-mid:         #e0e7ff;
    --bg-bot:         #dbeafe;
    --surface:        rgba(255, 255, 255, 0.80);
    --surface-hover:  rgba(0, 0, 0, 0.04);
    --border:         rgba(0, 0, 0, 0.10);
    --text:           #0f172a;
    --muted:          rgba(15, 23, 42, 0.55);
    --color-success:  #166534;
    --color-danger:   #991b1b;
    --color-warning:  #92400e;
    --color-info:     #0e7490;
    --bg-success:     rgba(34, 197, 94, 0.12);
    --bg-danger:      rgba(239, 68, 68, 0.10);
    --border-success: rgba(34, 197, 94, 0.25);
    --border-danger:  rgba(239, 68, 68, 0.25);
    --shadow-card:    0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-premium: 0 12px 40px rgba(0, 0, 0, 0.12);
  }
}


/* ═══════════════════════════════════════════════════════════════════
   4. BASE / BODY / TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════ */
html, body {
  min-height: 100%;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 15% 10%, rgba(124, 58, 237, 0.14), transparent 45%),
    radial-gradient(circle at 80%  0%, rgba(0, 255, 180, 0.06),  transparent 40%),
    radial-gradient(circle at 50% 120%, rgba(0, 140, 255, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 45%, var(--bg-bot) 100%) !important;
  transition: background 0.3s ease, color 0.2s ease;
}

/* Light theme adjusts radial glow opacity */
[data-theme="light"] body {
  background:
    radial-gradient(circle at 15% 10%, rgba(124, 58, 237, 0.08), transparent 45%),
    radial-gradient(circle at 80%  0%, rgba(0, 200, 140, 0.06),  transparent 40%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 45%, var(--bg-bot) 100%) !important;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) body {
    background:
      radial-gradient(circle at 15% 10%, rgba(124, 58, 237, 0.08), transparent 45%),
      radial-gradient(circle at 80%  0%, rgba(0, 200, 140, 0.06),  transparent 40%),
      linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 45%, var(--bg-bot) 100%) !important;
  }
}

h1, h2, h3, h4, h5, h6 { color: var(--text); }

h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: 1rem; }
h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.75rem; }
h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.65rem; }
h4 { font-size: 1.0rem;  font-weight: 700; margin-bottom: 0.5rem; }
h5 { font-size: 0.9rem;  font-weight: 700; margin-bottom: 0.5rem; }
h6 { font-size: 0.8rem;  font-weight: 600; color: var(--muted);   margin-bottom: 0.4rem; }

/* Section label — #title div placed inside .toolBar cards */
#title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

#subtitle { color: var(--muted); font-size: 0.9rem; }

/* Legacy selector aliases kept for backwards compat with content views */
.subtitle    { color: var(--muted); font-size: 0.85rem; }
.tinyfont    { font-size: 10px; color: var(--muted); }
.text-small  { font-size: 0.8rem; opacity: 0.8; }
.redprint    { color: #f87171; }

a { color: var(--muted); transition: color 0.2s; }
a:hover { color: var(--text); }

pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text);
}

hr {
  border-color: var(--border);
  margin-top: 10px;
  margin-bottom: 10px;
}

/* ── 4b. Bootstrap utility overrides — theme-aware ─────────────── */
/* BS 5.0.2 hard-codes these with !important in light-mode colours. */
.text-muted       { color: var(--muted) !important; }
.text-success     { color: var(--color-success) !important; }
.text-danger      { color: var(--color-danger) !important; }
.text-warning     { color: var(--color-warning) !important; }
.text-info        { color: var(--color-info) !important; }

/* Border utilities — use theme border colour */
.border,
.border-top,
.border-bottom,
.border-start,
.border-end        { border-color: var(--border) !important; }


/* ═══════════════════════════════════════════════════════════════════
   5. LOGIN / AUTH LAYOUT
   ═══════════════════════════════════════════════════════════════════ */
body.login-page #maincontent {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  background: transparent !important;
  position: relative;
  z-index: 2;
}

body.login-page #maincontent > .container {
  width: 100%;
}

.login-shell {
  margin: 0 auto;
}

@media (min-width: 992px) {
  .login-shell { max-width: 520px; }
}

.login-form-wrap {
  max-width: 420px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  text-align: left;
}

.help-links {
  margin-top: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

[data-theme="light"] .help-links { color: var(--muted); }

.help-links a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-weight: 900;
}

[data-theme="light"] .help-links a { color: var(--brand); }

.help-links a:hover { color: #fff; }
[data-theme="light"] .help-links a:hover { color: var(--text); }

/* ── Password reset: input icon sizing (replaces inline style) ─── */
.premium-card .input-group-text i.fas,
.premium-card .input-group-text i.far {
  font-size: 18px;
}

/* ── Password reset: account disambiguation buttons ────────────── */
.reset-account-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s;
}
.reset-account-btn:hover,
.reset-account-btn:focus {
  background: rgba(124, 58, 237, 0.10);
  border-color: var(--brand);
  color: var(--text);
}
[data-theme="light"] .reset-account-btn {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .reset-account-btn:hover,
[data-theme="light"] .reset-account-btn:focus {
  background: rgba(124, 58, 237, 0.08);
  border-color: var(--brand);
}
.reset-account-type { font-size: 0.82em; }
.reset-hint-text { font-size: 0.9em; }

/* ── Password reset: success alert on login page ─────────────── */
.premium-card .alert-success {
  border-radius: 16px;
  border: 1px solid rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.10);
  color: #4ade80;
}
[data-theme="light"] .premium-card .alert-success {
  color: #166534;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.25);
}


/* ═══════════════════════════════════════════════════════════════════
   6. PREMIUM CARD (GLASSMORPHISM)
   ═══════════════════════════════════════════════════════════════════ */
.premium-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-premium);
  padding: 34px 34px 30px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), var(--shadow-premium);
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.premium-card::before {
  content: "";
  position: absolute;
  top: -25%;
  left: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, var(--brand-glow) 0%, transparent 60%);
  pointer-events: none;
}

.card-icon {
  position: relative;
  z-index: 1;
  font-size: 42px;
  color: var(--brand);
  margin-bottom: 10px;
}

.card-title {
  position: relative;
  z-index: 1;
  font-weight: 900;
  font-size: 26px;
  margin: 0 0 6px 0;
  color: var(--text);
}

.card-subtitle {
  position: relative;
  z-index: 1;
  color: var(--muted);
  margin-bottom: 18px;
}

@media (max-width: 480px) {
  .premium-card {
    padding: 26px 20px 22px;
    border-radius: 26px;
  }
}


/* ═══════════════════════════════════════════════════════════════════
   7. FORM CONTROLS
   ═══════════════════════════════════════════════════════════════════ */

/* Premium card inputs */
.premium-card .input-group {
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
}

.premium-card .input-group-text {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-right: 0;
  color: rgba(255, 255, 255, 0.65);
  padding: 0 12px;
  min-width: 46px;
}

[data-theme="light"] .premium-card .input-group-text {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--muted);
}

.premium-card .form-control {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #fff;
  height: 48px;
  padding: 12px 14px;
  box-shadow: none;
}

[data-theme="light"] .premium-card .form-control {
  background: rgba(255, 255, 255, 0.70);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text);
}

.premium-card .input-group-text + .form-control {
  border-left: 0;
}

.premium-card .form-control:focus {
  border-color: rgba(124, 58, 237, 0.55);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.18);
  outline: none;
}

.premium-card .alert {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] .premium-card .alert {
  border-color: rgba(0, 0, 0, 0.10);
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

/* General form controls (admin views) */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
select,
textarea {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-input);
  padding: 0.5rem 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

/* Bootstrap form-control inside dark/light contexts */
.form-control,
.form-select {
  background-color: var(--surface-hover);
  border-color: var(--border);
  color: var(--text);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--surface-hover);
  border-color: rgba(124, 58, 237, 0.5);
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.form-control::placeholder { color: var(--muted); }

/* Input size helpers (from views-clean) */
.input-wide  { width: 180px; }
.input-small { width: 80px; }
.select-large { width: 190px; height: 40px; }

/* Larger text input used in settings/main popup forms */
.biginput { width: 100%; max-width: 400px; }

/* Real-time validation indicator span (admin create/edit forms) */
.fieldCheck {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  vertical-align: middle;
}
.fieldCheck.ok    { color: var(--color-success); }
.fieldCheck.error { color: var(--color-danger); }


/* ═══════════════════════════════════════════════════════════════════
   8. BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

/* ── 8a. CTA Brand Button (login, major CTAs — pill shape) ───── */
.btn-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 999px;
  padding: 13px 24px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: var(--brand);
  box-shadow: 0 6px 20px var(--brand-shadow);
  color: #fff;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-brand:hover,
.btn-brand:focus {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px var(--brand-shadow);
  color: #fff;
  outline: none;
}
.btn-brand:active { transform: translateY(0); filter: brightness(0.97); }

/* ── 8b. Bootstrap overrides ──────────────────────────────────── */
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  border-radius: var(--radius-btn);
  font-weight: 600;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  box-shadow: 0 4px 12px var(--brand-shadow);
}

.btn-secondary {
  background: var(--surface-hover);
  border-color: var(--border);
  color: var(--text);
  border-radius: var(--radius-btn);
  font-weight: 600;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.20);
  color: var(--text);
}
[data-theme="light"] .btn-secondary:hover {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.18);
}

.btn-outline-secondary {
  border-color: var(--border);
  color: var(--muted);
  border-radius: var(--radius-btn);
  font-weight: 600;
}
.btn-outline-secondary:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: rgba(255,255,255,0.20);
}
[data-theme="light"] .btn-outline-secondary:hover {
  border-color: rgba(0,0,0,0.18);
}

.btn-danger  { border-radius: var(--radius-btn); font-weight: 600; }
.btn-sm      { border-radius: calc(var(--radius-btn) - 2px); }
.btn-link    { text-decoration: none; }

/* ── 8c. Native input/button base (not Bootstrap .btn) ───────── */
input[type="submit"],
input[type="button"],
button:not([class*="btn"]) {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-btn);
  padding: 0.38rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
  vertical-align: middle;
}
input[type="submit"]:hover,
input[type="button"]:hover,
button:not([class*="btn"]):hover {
  background: rgba(124, 58, 237, 0.10);
  border-color: rgba(124, 58, 237, 0.45);
  color: var(--text);
}
input[type="submit"]:active,
input[type="button"]:active,
button:not([class*="btn"]):active {
  background: rgba(124, 58, 237, 0.16);
}
input[type="submit"]:disabled,
input[type="button"]:disabled,
button:not([class*="btn"]):disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

[data-theme="light"] input[type="submit"],
[data-theme="light"] input[type="button"],
[data-theme="light"] button:not([class*="btn"]) {
  background: rgba(255,255,255,0.75);
  border-color: rgba(0,0,0,0.14);
  color: var(--text);
}
[data-theme="light"] input[type="submit"]:hover,
[data-theme="light"] input[type="button"]:hover,
[data-theme="light"] button:not([class*="btn"]):hover {
  background: rgba(124, 58, 237, 0.07);
  border-color: rgba(124, 58, 237, 0.40);
}

/* ── 8d. .button – legacy alias for form action buttons ──────── */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-btn);
  padding: 0.38rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
  white-space: nowrap;
}
.button:hover {
  background: rgba(124, 58, 237, 0.10);
  border-color: rgba(124, 58, 237, 0.45);
  color: var(--text);
}

/* ── 8e. .smallbutton – compact contextual buttons (New, Share…) */
.smallbutton {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-btn-sm);
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
}
.smallbutton:hover {
  background: rgba(124, 58, 237, 0.10);
  border-color: var(--brand);
  color: var(--text);
}
[data-theme="light"] .smallbutton {
  border-color: rgba(0,0,0,0.16);
  color: var(--muted);
}
[data-theme="light"] .smallbutton:hover {
  background: rgba(124, 58, 237, 0.07);
  border-color: var(--brand);
  color: var(--brand);
}

/* ── 8f. Admin badge / warning button ────────────────────────── */
.adm-btn {
  display: inline-flex;
  align-items: center;
  padding: 2px 12px;
  border-radius: var(--radius-btn-sm);
  border: 1px solid var(--color-warning);
  background: transparent;
  color: var(--color-warning) !important;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.adm-btn:hover {
  background: rgba(251, 191, 36, 0.15);
  color: #fff !important;
}

/* ── 8g. Theme toggle ─────────────────────────────────────────── */
button#theme-toggle {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
button#theme-toggle:hover {
  background: none !important;
  border: none !important;
  color: var(--text);
}


/* ═══════════════════════════════════════════════════════════════════
   9. STICKY NAV (.siteMessage)
   ═══════════════════════════════════════════════════════════════════ */
.siteMessage {
  display: block;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  text-align: left;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .siteMessage {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.siteMessage .wrapper {
  padding: 16px 20px;
}

.siteMessage .top.wrapper {
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.siteMessage a {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none !important;
  transition: color 0.2s;
}
.siteMessage a:hover { color: var(--text); }

.siteMessage a.important       { color: #f87171; }
.siteMessage a.important:hover { color: #fca5a5; }

[data-theme="light"] .siteMessage a.important       { color: #dc2626; }
[data-theme="light"] .siteMessage a.important:hover { color: #991b1b; }

.siteMessage .btn-outline-warning {
  color: var(--color-warning) !important;
  border-color: var(--color-warning);
}
.siteMessage .btn-outline-warning:hover {
  background: rgba(251, 191, 36, 0.15);
  color: var(--text) !important;
}

/* Underline hover animation */
.underline {
  display: inline-block;
  position: relative;
  color: var(--muted);
  transition: color 0.2s;
}
.underline:hover { color: var(--text); }
.underline::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--text);
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}
.underline:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}
a.important.underline::after {
  background-color: #f87171;
}
[data-theme="light"] a.important.underline::after {
  background-color: #dc2626;
}

#greeting { color: var(--muted); }

/* Scroll-float class applied by JS */
.navbar-fixed {
  position: fixed;
  top: 0;
  z-index: 998;
  width: 100%;
  transition: all 0.3s ease-in;
}


/* ═══════════════════════════════════════════════════════════════════
   10. FOOTER (#footer)
   ═══════════════════════════════════════════════════════════════════ */
#footer {
  background: rgba(3, 3, 3, 0.72);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.70);
  padding: 26px 0 14px;
  transition: background 0.3s ease;
}

[data-theme="light"] #footer {
  background: rgba(240, 244, 255, 0.85);
  color: var(--muted);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

#footer,
#footer * { text-shadow: none; }

#footer .bottomtext { padding-left: 0; padding-right: 0; }
#footer .row        { margin-left: 0; margin-right: 0; }

#footer a {
  color: rgba(255, 255, 255, 0.70);
  text-decoration: none !important;
  font-weight: 900;
  letter-spacing: 0.6px;
}
#footer a:hover { color: #fff; }

[data-theme="light"] #footer a       { color: var(--muted); }
[data-theme="light"] #footer a:hover { color: var(--text); }

#footer i { color: rgba(255, 255, 255, 0.50); margin-right: 8px; }
[data-theme="light"] #footer i { color: var(--muted); }

#footer .border-start { border-color: var(--border) !important; }

#footer .status-wrap {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

#footer iframe { display: block; max-width: 100%; }

#footer .poweredby,
#footer .text-muted {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.8px;
}

[data-theme="light"] #footer .poweredby,
[data-theme="light"] #footer .text-muted {
  color: var(--muted) !important;
}

/* Modal backdrop height fix (was inline in footer_view) */
.modal-backdrop { height: 100%; }

/* Legacy footer classes from global.css */
.bottom {
  background-color: var(--surface);
  text-align: center;
  width: 100%;
}
.bottomtext {
  color: var(--text);
  text-align: center;
  margin: 0 auto;
  width: 100%;
  padding: 20px;
}


/* ═══════════════════════════════════════════════════════════════════
   11. CONTENT AREA CARDS
   ═══════════════════════════════════════════════════════════════════ */
#maincontent {
  position: relative;
  /* z-index removed — it created a stacking context that trapped Bootstrap modals
     below the modal-backdrop. position:relative alone is fine. */
  padding: 1.5rem 0 2rem;
  background: transparent !important;
  min-height: calc(100vh - 360px);
}

.container     { max-width: 1140px; margin-left: auto; margin-right: auto; padding-left: 12px; padding-right: 12px; }
.pagecontainer { max-width: 100%; }
/* .sizecontainer is an alias for .container */
.sizecontainer { max-width: 1140px; margin-left: auto; margin-right: auto; padding-left: 12px; padding-right: 12px; }

/* Bootstrap .card – dark/light adaptation */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  color: var(--text);
  /* overflow:visible so dropdown menus can escape the card boundary.
     Table cards use .table-responsive for their own overflow clipping. */
  overflow: visible;
  transition: background 0.3s ease, border-color 0.3s ease;
}
/* Re-clip cards that wrap tables so corner cells don't poke out */
.card.p-0 { overflow: hidden; }

.card-body { color: var(--text); padding: 1.25rem 1.5rem; }

.card-header {
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  padding: 0.75rem 1.5rem;
}

/* card-toolbar, toolBar, dspBox — legacy + new aliases */
.card-toolbar,
.card-content,
.toolBar,
.dspBox {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  color: var(--text);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.card-toolbar,
.toolBar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-toolbar input[type="button"],
.card-toolbar .btn,
.toolBar input[type="button"],
.toolBar .btn {
  border-radius: var(--radius-btn);
  font-weight: 600;
}

/* Settings page tab strip — toolbar nav between sub-pages */
.settingTab {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

/* Inactive tab — ghost outline style */
.settingTab input[type="button"],
.settingTab .btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-btn-sm);
  padding: 0.28rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.settingTab input[type="button"]:hover,
.settingTab .btn:hover {
  background: var(--surface-hover);
  border-color: rgba(255,255,255,0.20);
  color: var(--text);
}
[data-theme="light"] .settingTab input[type="button"]:hover {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.18);
}

/* Active tab — DISABLED attribute marks the current page */
.settingTab input[type="button"]:disabled,
.settingTab input[type="button"][disabled] {
  opacity: 1 !important;
  pointer-events: none;
  cursor: default;
  background: rgba(124, 58, 237, 0.15) !important;
  border-color: rgba(124, 58, 237, 0.40) !important;
  color: var(--brand) !important;
  font-weight: 700;
}
[data-theme="light"] .settingTab input[type="button"]:disabled,
[data-theme="light"] .settingTab input[type="button"][disabled] {
  background: rgba(124, 58, 237, 0.08) !important;
  border-color: rgba(124, 58, 237, 0.30) !important;
  color: var(--brand) !important;
}

.v-page-wrap { padding: 10px; }

/* Section helpers */
.sectionBlock    { margin-top: 15px; }
.editpayment     { border-left: 10px solid orange; margin-bottom: 50px; }
.greybgbox       { border-radius: 2px; background: var(--surface-hover); border: 1px solid var(--border); }
.whitebgbox      { background: var(--surface); }

/* ── Settings section container ──────────────────────────────── */
.settingsbox {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* Section heading inside .settingsbox (e.g. "Slideshow Settings") */
.settingsbox > h5,
.settingsbox > h4 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden; /* clearfix for .fright children */
}

/* Form row — label + input side by side */
.settingsrow {
  display: flex;
  align-items: flex-start;
  padding: 0.6rem 0;
  gap: 1rem;
}

/* Separator variant */
.settingsborder {
  border-bottom: 1px solid var(--border);
}
.settingsrow.settingsborder:last-child {
  border-bottom: none;
}

/* Label column */
.settingsfieldname {
  flex: 0 0 200px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--muted);
  padding-top: 0.3rem;
  line-height: 1.4;
}

/* Value / input column */
.settingsfield {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text);
  min-width: 0;
}

/* Account/admin label/entry fields */
.labelfield           { font-weight: 800; color: var(--text); }
.entryfield           { font-weight: 400; color: var(--muted); }
.labelfieldDescription { font-weight: 400; color: var(--muted); }
.sectionexplination   { font-weight: 400; color: var(--muted); font-size: 1em; padding: 15px; }
.test-account         { color: var(--muted); font-weight: 800; }

/* Payment section spacing */
#PAYPAL, #STRIPE, #WORLDPAY { margin-top: 25px; margin-bottom: 25px; }

/* Popular link style */
a.popularLink {
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 400;
  font-size: 0.9em;
  border-bottom: 1px dotted var(--muted);
  transition: all 0.3s ease-in;
}
a.popularLink:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}


/* ═══════════════════════════════════════════════════════════════════
   12. TABLES
   ═══════════════════════════════════════════════════════════════════ */
.table {
  color: var(--text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border);
  --bs-table-color: var(--text);
  --bs-table-striped-color: var(--text);
  --bs-table-hover-color: var(--text);
}

.table th,
.table td {
  border-color: var(--border);
  padding: 0.6rem 0.75rem;
  color: var(--text);
}

.table thead th {
  background: var(--surface-hover);
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

th { text-align: left; }

/* Legacy border table */
.tableBorder {
  border-collapse: collapse;
  width: 100%;
  color: var(--text);
}
.tableBorder td,
.tableBorder th {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}
.tableBorder .tableTitle { background: var(--surface-hover); color: var(--muted); font-weight: 700; }

/* tableWithColor */
.tableWithColor td,
.tableWithColor th { vertical-align: middle; }

/* Section heading rows */
.tableTitle {
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  line-height: 16px;
  font-weight: bold;
}
.tableSubTitle,
.tableSubTitleTop {
  border-bottom: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--muted);
  font-size: 12px;
  line-height: 14px;
  font-weight: bold;
}
.tableSubTitleTop { border-top: 1px solid var(--border); border-bottom: none; }

#sideTitle { padding: 5px; color: var(--text); font-size: 16px; font-weight: bold; line-height: 18px; }

/* Table row styles */
.tablerow td      { border-bottom: 1px solid var(--border); padding: 3px; }
.tablerow         { border-bottom: 1px solid var(--border); padding: 3px; }
.tablerowtitle    { display: inline-block; width: 200px; line-height: 40px; }
.tablerowcontent  { padding: 5px; }

/* Location row – gradient hover */
.locationRow {
  border-left: rgba(0, 0, 0, 0) 8px solid;
  border-right: var(--surface) 12px solid;
}
.locationRow:hover {
  border-left: #ff8f00 8px solid;
  border-right: var(--surface) 12px solid;
  background: linear-gradient(to right, rgba(255, 143, 0, 1) 0%, rgba(254, 164, 1, 1) 4%, rgba(255, 233, 0, 0) 75%);
}

/* table-centered helper (from views-clean) */
.table-centered   { margin: 0 auto; border-collapse: collapse; width: 100%; }
.table-head-row   { font-weight: bold; border-top: 1px solid var(--border); }
.table-heading    { width: 100%; border-bottom: 1px solid var(--border); }
.row-border-bottom { border-bottom: 1px solid var(--border); }
.cell-border-right { border-right: 1px solid var(--border); }
.cell-pad-right    { padding-right: 5px; }

/* .h3-border-bottom — used as thead <th> class in tableWithColor tables */
.h3-border-bottom {
  border-bottom: 2px solid var(--border);
  background: var(--surface-hover);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.55rem 0.75rem;
}

/* Soft bottom border for two-column data rows (admin_view, etc.) */
.tableBorderBottomSoft {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
}

/* Row hover highlight — modern admin feel */
.table tbody tr:hover > td,
.tableWithColor tbody tr:hover > td {
  background: var(--surface-hover);
  transition: background 0.12s;
}
[data-theme="light"] .table tbody tr:hover > td,
[data-theme="light"] .tableWithColor tbody tr:hover > td {
  background: rgba(0,0,0,0.025);
}

/* Clickable rows (.chk class used on <tr> elements) */
tr.chk { cursor: pointer; }

/* Bootstrap equivalents: prefer d-table, border-* utilities over the above in new views */


/* ═══════════════════════════════════════════════════════════════════
   13. ALERTS & MESSAGES
   ═══════════════════════════════════════════════════════════════════ */
.msg,
.errmsg {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.msg {
  background: var(--bg-success);
  border: 1px solid var(--border-success);
  color: var(--color-success);
}

.errmsg {
  background: var(--bg-danger);
  border: 1px solid var(--border-danger);
  color: var(--color-danger);
}

.alert { border-radius: 12px; }

/* Padded message utility */
.padded-message { padding: 2px; margin: 10px auto; }


/* ═══════════════════════════════════════════════════════════════════
   14. MODALS & POPUPS
   ═══════════════════════════════════════════════════════════════════ */
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  color: var(--text);
  transition: background 0.3s ease;
}

[data-theme="light"] .modal-content {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.modal-header { border-bottom: 1px solid var(--border); color: var(--text); }
.modal-footer { border-top:    1px solid var(--border); }

.modal .btn-close        { filter: invert(1); opacity: 0.8; }
[data-theme="light"] .modal .btn-close { filter: none; }

.modal .btn-secondary {
  background: var(--surface-hover);
  border-color: var(--border);
  color: var(--text);
}
.modal .btn-primary { background: var(--brand); border-color: var(--brand); }

/* Legacy popup window */
#backgroundPopup {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 10;
}
.popupWindow {
  display: none;
  position: fixed;
  width: 600px;
  z-index: 9999;
  padding: 0;
  font-size: 0.875rem;
  text-align: left;
  overflow: visible;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  color: var(--text);
}
.popupWindowFull {
  display: none;
  position: fixed;
  width: 100%; height: 100%;
  z-index: 9999;
  padding: 0; margin: 0;
  font-size: 0.875rem;
  text-align: left;
  overflow: visible;
  color: var(--text);
}
.popupWindowClose {
  position: absolute;
  right: -8px; top: -8px;
  font-size: 0.875rem;
  line-height: 1;
  font-weight: 700;
  display: block;
}
.popupWindowClose a       { color: var(--muted); }
.popupWindowClose a:hover { color: var(--text); }
.popupWindowCookie {
  display: none;
  position: fixed;
  bottom: 0; left: 0;
  width: 100%;
  min-height: 120px;
  z-index: 9999;
  margin: 0;
  padding: 20px;
  font-size: 0.875rem;
  text-align: center;
  overflow: visible;
  color: var(--muted);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}


/* ═══════════════════════════════════════════════════════════════════
   15. UTILITY / LAYOUT HELPERS
   ═══════════════════════════════════════════════════════════════════ */

/* .hidden keeps display:none for JS; use Bootstrap d-none in new views */
.hidden {
  display: none !important;
  visibility: hidden !important;
}

.loading { display: none; text-align: center; }

/* Collapse icon rotation (Bootstrap data-bs-toggle) */
[data-bs-toggle="collapse"][aria-expanded="true"] > .js-rotate-if-collapsed {
  transition: transform 0.3s ease-in-out;
  transform: rotate(359deg);
  color: #f87171;
}

/* Back-to-top button */
#back-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 20;
}
#back-top a {
  width: 56px;
  display: block;
  text-align: center;
  font-size: 11px;
  border-radius: 50%;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.3s, background 0.3s;
}
#back-top a:hover { color: var(--text); }

/* Section / block layout (legacy .block used in some admin views) */
.block {
  display: inline-block;
  text-align: left;
  padding-left: 10px;
  margin-left: 10px;
  width: 45%;
  vertical-align: top;
}
@media only screen and (max-width: 960px) {
  .block { width: 100%; }
}

.blockContainer { margin: 20% auto; }
@media only screen and (max-width: 960px) {
  .blockContainer { margin: 25px auto; }
}

.wrapper { padding: 20px; padding-bottom: 30px; }

/* JS-toggled visibility */
.thidden { display: none !important; }

/* Float helper (used by .smallbutton inside h5 headings, etc.) */
.fright { float: right; }

/* Form button containers inside legacy popups/forms */
.subnavbutton,
.navbutton {
  display: block;
  margin-top: 0.5rem;
}

/* Linked actions inside .navbutton */
.navbutton a {
  display: inline-block;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-btn-sm);
  text-decoration: none;
  transition: color 0.18s, background 0.18s;
}
.navbutton a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* Popup content wrapper */
.popupwindowcontent {
  padding: 0.5rem 0;
}

/* Section */
.section {
  width: 95%;
  margin: 0 auto;
  padding: 10px 0;
  overflow: hidden;
}

/* Legacy view-subtitle helpers (from views-clean) */
.view-subtitle  { text-align: left; margin-left: 10px; }
.subtitle-pad   { padding: 5px; }


/* ═══════════════════════════════════════════════════════════════════
   16. NOTIFICATION BOXES
   ═══════════════════════════════════════════════════════════════════ */
.notificationBox,
.warningBox {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 10px;
  transition: box-shadow 0.3s, background 0.3s;
}

.notificationBox:hover,
.warningBox:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.30);
}

[data-theme="light"] .notificationBox:hover,
[data-theme="light"] .warningBox:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
}


/* ═══════════════════════════════════════════════════════════════════
   17. VIEWS-CLEAN UTILITIES (MIGRATED)
   These were previously in views-clean.css. Prefer Bootstrap 5
   equivalents in new views (e.g. .overflow-hidden → Bootstrap's class).
   ═══════════════════════════════════════════════════════════════════ */

/* Image preview grid item */
.image-preview-wrapper {
  position: relative;
  width: 230px;
  height: 280px;
  float: left;        /* Consider flex/grid in new views */
  padding: 2px;
  margin: 5px;
}

.img-max { max-width: 200px; max-height: 200px; }

/* button wrapper */
.button-wrapper { width: 200px; }

.btn-search {
  position: relative;
  float: left;        /* Use float-start in new views */
  width: 200px;
}

/* dspBox position reset (admin content wrapper) */
.dspBox { margin-top: 20px; position: relative; }


/* ═══════════════════════════════════════════════════════════════════
   18. ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */

/* Greeting fade – used in all navbar views */
@keyframes text-fade {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  50%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { opacity: 0; }
}

#greeting {
  opacity: 0;
  transition: opacity 1s ease;
  animation: text-fade 7.5s ease-in-out infinite;
}

/* Dropzone passing-through (retained from dropzone context) */
@keyframes passing-through {
  0%   { opacity: 0;   transform: translateY(40px);  }
  30%  { opacity: 1;   transform: translateY(0px);   }
  70%  { opacity: 1;   transform: translateY(0px);   }
  100% { opacity: 0;   transform: translateY(-40px); }
}

@keyframes slide-in {
  0%   { opacity: 0;   transform: translateY(40px);  }
  30%  { opacity: 1;   transform: translateY(0px);   }
}

@keyframes pulse-glow {
  0%   { box-shadow: 0 0 0 0 var(--brand-shadow); }
  70%  { box-shadow: 0 0 0 8px rgba(124, 58, 237, 0); }
  100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}


/* ═══════════════════════════════════════════════════════════════════
   19. RESPONSIVE / MEDIA QUERIES
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  #footer .border-start {
    border-left: 0 !important;
    text-align: left !important;
  }
  .tablerowtitle { width: 140px; }
}

@media (max-width: 480px) {
  .premium-card {
    padding: 26px 20px 22px;
    border-radius: 26px;
  }
  .siteMessage .wrapper { padding: 10px 14px; }
}

@media (max-width: 960px) {
  .block { width: 100%; }
  .blockContainer { margin: 25px auto; }
}


/* ═══════════════════════════════════════════════════════════════════
   20. CONTENT VIEW UTILITIES
   Styles extracted from inline <style> blocks in content views.
   ═══════════════════════════════════════════════════════════════════ */

/* Customer search — scrollable result tables (customer_view.php) */
.table-wrapper { position: relative; }
.table-scroll  { height: 150px; overflow: auto; margin-top: 20px; }

::-webkit-scrollbar { -webkit-appearance: none; width: 7px; }
::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

/* File upload view (uploadimages_view.php) */
#uploadImages { padding: 20px; }

#upload-settings,
#my-dropzone {
  max-width: 800px;
  margin-left: 0;
}

.settings-row         { display: flex; align-items: center; margin-bottom: 15px; }
.settings-label       { flex: 0 0 80px; font-weight: bold; }
.settings-input-group { flex: 1; display: flex; gap: 10px; }

/* Scoped form-control for upload form only (avoids overriding global .form-control) */
#uploadImages .form-control {
  display: block;
  width: 100%;
  height: 28px;
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-sizing: border-box;
}

/* Dropzone widget */
#my-dropzone {
  border: 2px dashed #0087F7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  min-height: 180px;
  padding: 20px;
}
[data-theme="light"] #my-dropzone { background: rgba(0, 135, 247, 0.03); }

/* Print template preview (printing_view.php) */
#sampleFrame {
  background-color: black;
  position: relative;
  z-index: 1;
  margin: 0 auto;
}

#layerFrame {
  position: absolute;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center center;
}

#layerImage {
  min-width: 100px;
  min-height: 100px;
  background-image: url('/assets/img/shadow_LS.png');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center center;
  overflow: hidden;
  opacity: 0.8;
}

/* Gallery login access admin table (galleryloginaccess_view.php) */
#gla-bootstrap-scope table { font-size: 12px; text-align: left; }

/* Event image file browser thumbnails (event_image_view.php) */
#files { --thumb-size: 180px; }

.thumb {
  position: relative;
  width: calc(var(--thumb-size) + 50px);
  min-height: calc(var(--thumb-size) + 90px);
  float: left;
  padding: 2px;
  margin: 5px;
  background: var(--surface-hover);
}
.thumb input[type="checkbox"] { margin-bottom: 6px; }
.thumb img {
  display: block;
  max-width: var(--thumb-size);
  max-height: var(--thumb-size);
  margin: 5px auto;
}

.thumb-size-control {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 12px;
  font-size: 12px;
}
.thumb-size-control input[type="range"] { width: 180px; vertical-align: middle; }
.thumb-size-value {
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}


/* ═══════════════════════════════════════════════════════════════════
   21. MARKETING — Media Library + Template Gallery
   Styles for marketing/media_view.php and marketing/templates_view.php
   ═══════════════════════════════════════════════════════════════════ */

/* --- Media Library grid --- */
.mkt-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.mkt-media-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow 0.2s;
}
.mkt-media-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.25); }

.mkt-media-thumb {
  width: 100%;
  height: 130px;
  overflow: hidden;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
[data-theme="dark"] .mkt-media-thumb { background: rgba(255,255,255,0.06); }

.mkt-media-meta {
  padding: 8px 10px 10px;
}
.mkt-media-name {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.mkt-media-info {
  font-size: 0.72rem;
  margin-top: 2px;
}
.mkt-media-actions {
  margin-top: 6px;
  display: flex;
  gap: 4px;
}

/* Dropzone area for Media Library */
.dropzone-area {
  border: 2px dashed var(--brand);
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.04);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: pointer;
  transition: background 0.2s;
}
.dropzone-area:hover,
.dropzone-area.dz-drag-hover { background: rgba(124, 58, 237, 0.09); }
.dropzone-area .dz-message { text-align: center; color: var(--muted); }

/* Extra-small button variant */
.btn-xs {
  padding: 2px 7px;
  font-size: 0.72rem;
  line-height: 1.4;
  border-radius: 4px;
}

/* --- Email Template Gallery grid --- */
.mkt-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.mkt-template-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow 0.2s, transform 0.15s;
}
.mkt-template-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

.mkt-template-preview {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f8f8f8;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .mkt-template-preview { background: rgba(255,255,255,0.06); }

.mkt-template-no-preview {
  text-align: center;
  padding: 20px;
}

/* Hover overlay on preview */
.mkt-template-overlay {
  position: absolute;
  inset: 0;
  background: rgba(124, 58, 237, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}
.mkt-template-preview:hover .mkt-template-overlay { opacity: 1; }

.mkt-template-info {
  padding: 12px 14px 14px;
}

/* Marketing dashboard stat badges */
.mkt-stat-badge {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.95rem;
  font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════════════
   22. COMPONENTS — STATUS BADGES, INLINE LABELS, EMPHASIS
   ═══════════════════════════════════════════════════════════════════ */

/* .important — inline warning/critical text (popups, notices) */
.important {
  color: var(--color-warning);
  font-weight: 600;
}
[data-theme="light"] .important { color: #92400e; }

/* ── Inline status badges ─────────────────────────────────────── */
/* Use: <span class="status-badge status-active">Active</span>    */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status-active,
.status-enabled {
  background: var(--bg-success);
  border-color: var(--border-success);
  color: var(--color-success);
}
.status-inactive,
.status-disabled {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
  color: var(--muted);
}
.status-warning,
.status-pending {
  background: rgba(251,191,36,0.12);
  border-color: rgba(251,191,36,0.30);
  color: var(--color-warning);
}
.status-danger,
.status-error {
  background: var(--bg-danger);
  border-color: var(--border-danger);
  color: var(--color-danger);
}

/* ── Main event/location list table — location row badge ─────── */
/* (used in main_view.php location rows) */
.locationRow td { padding: 0.5rem 0.75rem; font-size: 0.875rem; }

/* ── Keyboard / code tag ──────────────────────────────────────── */
kbd {
  display: inline-block;
  padding: 0.1em 0.4em;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8em;
  font-family: monospace;
  color: var(--text);
}

/* ── Card/dspBox inner header row ─────────────────────────────── */
/* A common pattern: <div class="d-flex align-items-center mb-3"> */
.card-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.65rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  overflow: hidden;
}

/* ── Data value emphasis ──────────────────────────────────────── */
.data-value {
  font-weight: 600;
  color: var(--text);
}
.data-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Empty state ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.empty-state i.fa-3x {
  opacity: 0.35;
}
.empty-state i {
  font-size: 2rem;
  opacity: 0.35;
  display: block;
  margin-bottom: 0.75rem;
}
.empty-state h3 {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.empty-state p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* ── Nav link active indicator (admin sticky nav) ─────────────── */
.siteMessage .nav-link {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: var(--radius-btn-sm);
  transition: color 0.18s, background 0.18s;
}
.siteMessage .nav-link:hover {
  color: var(--text);
  background: var(--surface-hover);
}
/* link-body-emphasis in dark/light mode — sync with our theme vars */
.siteMessage .link-body-emphasis {
  color: var(--muted) !important;
}
.siteMessage .link-body-emphasis:hover {
  color: var(--text) !important;
}


/* ═══════════════════════════════════════════════════════════════════
   23. LAYOUT SHELL — top bar + side rail
   Replaces .siteMessage two-row horizontal nav with a fixed top bar
   and a sticky left sidebar (220px).
   ═══════════════════════════════════════════════════════════════════ */

/* Geometry tokens */
:root {
  --topbar-h:   48px;
  --sidebar-w: 220px;
}

/* ── Top bar ──────────────────────────────────────────────────── */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 1000;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
}

/* Brand: "FYP. • Admin" */
.topbar-brand a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none !important;
  line-height: 1;
}
.brand-fyp {
  font-size: 1rem;
  font-weight: 900;
  color: var(--brand);
  letter-spacing: -0.5px;
}
.brand-sep {
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.45;
  margin: 0 0.1rem;
}
.brand-ctx {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

/* Greeting (center, desktop only) */
.topbar-greeting {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.75;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 1.25rem;
}

/* Right-side actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.topbar-link {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted) !important;
  text-decoration: none !important;
  transition: color 0.18s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.topbar-link:hover          { color: var(--text) !important; }
.topbar-link.signout:hover  { color: var(--color-danger) !important; }

/* BACK badge (shown when platform admin is masquerading as a tenant) */
.topbar-back-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 2px 9px;
  border-radius: var(--radius-btn-sm);
  border: 1px solid rgba(251, 191, 36, 0.40);
  color: var(--color-warning) !important;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: background 0.18s;
}
.topbar-back-badge:hover { background: rgba(251, 191, 36, 0.10) !important; }

/* Hamburger (mobile only — shown via media query) */
#sidebar-toggle {
  display: none;
  background: none;
  border: none;
  padding: 4px 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  border-radius: var(--radius-btn-sm);
  flex-shrink: 0;
  transition: color 0.18s, background 0.18s;
}
#sidebar-toggle:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* ── App shell (topbar-offset flex row) ───────────────────────── */
#app-shell {
  display: flex;
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

/* ── Side rail ────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0 1rem;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.3s ease,
              border-color 0.3s ease;
  scrollbar-width: none;
}
#sidebar::-webkit-scrollbar { display: none; }

/* Nav group container */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.5rem;
  flex: 1;
}

/* Optional section label */
.sidebar-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--muted);
  opacity: 0.55;
  padding: 0.75rem 0.75rem 0.2rem;
}

/* Individual nav link */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-btn-sm);
  color: var(--muted) !important;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-link i {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  opacity: 0.65;
  transition: opacity 0.15s;
}
.sidebar-link:hover {
  background: var(--surface-hover);
  color: var(--text) !important;
}
.sidebar-link:hover i { opacity: 1; }

/* Active state */
.sidebar-link.active {
  background: rgba(124, 58, 237, 0.12);
  color: var(--brand) !important;
  font-weight: 700;
}
.sidebar-link.active i {
  opacity: 1;
  color: var(--brand);
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%; bottom: 20%;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--brand);
}
[data-theme="light"] .sidebar-link.active {
  background: rgba(124, 58, 237, 0.08);
}

/* Thin separator */
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0.75rem;
}

/* Sidebar tail — pushes footer links + collapse button to bottom */
.sidebar-tail {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

/* Sidebar footer (de-emphasised admin/platform links) */
.sidebar-footer {
  padding: 0.5rem;
  border-top: 1px solid var(--border);
}
.sidebar-link-admin {
  color: rgba(251, 191, 36, 0.60) !important;
  font-size: 0.78rem;
}
.sidebar-link-admin i {
  opacity: 0.65;
  color: var(--color-warning);
}
.sidebar-link-admin:hover {
  color: var(--color-warning) !important;
  background: rgba(251, 191, 36, 0.07);
}

/* ── Content pane ─────────────────────────────────────────────── */
#app-shell > #maincontent {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1.5rem 2rem;
  background: transparent !important;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Sidebar overlay (mobile tap-to-close backdrop) ───────────── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 998;
  cursor: pointer;
}

/* ── Responsive: collapse sidebar ≤ 768px ─────────────────────── */
@media (max-width: 768px) {
  #sidebar-toggle { display: inline-flex; }

  #sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    z-index: 999;
    transform: translateX(calc(-1 * var(--sidebar-w)));
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
  }
  #sidebar.sidebar-open       { transform: translateX(0); }
  #sidebar-overlay.active     { display: block; }

  #app-shell > #maincontent {
    padding: 1rem 0.75rem 2rem;
  }

  .topbar-greeting { display: none; }
}

@media (min-width: 769px) {
  #sidebar-overlay { display: none !important; }
}

/* ── Sidebar collapse (desktop toggle) ───────────────────────── */
:root { --sidebar-w-collapsed: 52px; }

/* Collapse/expand button at the bottom of the rail */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-collapse-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.sidebar-collapse-btn i {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  font-size: 0.78rem;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed state */
#sidebar.sidebar-collapsed { width: var(--sidebar-w-collapsed); }

#sidebar.sidebar-collapsed .sidebar-link span,
#sidebar.sidebar-collapsed .sidebar-label,
#sidebar.sidebar-collapsed .sidebar-footer span,
#sidebar.sidebar-collapsed .sidebar-collapse-btn span {
  display: none;
}

#sidebar.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 0.5rem 0;
  gap: 0;
}
#sidebar.sidebar-collapsed .sidebar-link i { width: auto; font-size: 0.95rem; }

#sidebar.sidebar-collapsed .sidebar-collapse-btn {
  justify-content: center;
  padding: 0.5rem 0;
}
#sidebar.sidebar-collapsed .sidebar-collapse-btn i {
  width: auto;
}

#sidebar.sidebar-collapsed .sidebar-divider { margin: 0.35rem 0.5rem; }
#sidebar.sidebar-collapsed .sidebar-footer  { padding: 0.25rem; }

/* Hide collapse button on mobile (hamburger handles it there) */
@media (max-width: 768px) {
  .sidebar-collapse-btn { display: none; }
}

/* ── Sidebar collapsible submenu ───────────────────────────── */
.sidebar-parent-row {
  display: flex;
  align-items: center;
}
.sidebar-parent-row > .sidebar-link {
  flex: 1;
  min-width: 0;
}

/* Chevron toggle */
.sidebar-submenu-toggle {
  background: none;
  border: none;
  color: var(--muted);
  padding: 0.45rem;
  cursor: pointer;
  font-size: 0.58rem;
  opacity: 0.4;
  transition: opacity 0.15s, background 0.15s;
  flex-shrink: 0;
  border-radius: var(--radius-btn-sm);
  line-height: 1;
}
.sidebar-submenu-toggle:hover {
  opacity: 1;
  background: var(--surface-hover);
}
.sidebar-submenu-toggle i {
  transition: transform 0.25s ease;
  display: block;
}
.sidebar-submenu-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

/* Collapsible container */
.sidebar-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-submenu.open {
  max-height: 220px;
}

/* Indented sub-links */
.sidebar-link.sidebar-sublink {
  padding-left: 2rem;
  font-size: 0.78rem;
}
.sidebar-link.sidebar-sublink i {
  font-size: 0.72rem;
}

/* Collapsed sidebar: hide submenu + chevron */
#sidebar.sidebar-collapsed .sidebar-submenu,
#sidebar.sidebar-collapsed .sidebar-submenu-toggle {
  display: none;
}

/* ── 24. Page-level slide transitions ──────────────────────── */
@keyframes slideInFromRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInFromLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}

.page-slide-in-right { animation: slideInFromRight 0.22s cubic-bezier(0.4,0,0.2,1) forwards; }
.page-slide-in-left  { animation: slideInFromLeft  0.22s cubic-bezier(0.4,0,0.2,1) forwards; }

.page-exit-left {
  transition: opacity 0.18s ease, transform 0.18s ease;
  opacity: 0;
  transform: translateX(-28px);
}

/* ── 25. Photographer list: account type + feature badges ───── */
.acct-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 0.65rem;
  margin-right: 0.4rem;
  vertical-align: middle;
  flex-shrink: 0;
}
.acct-type-badge.orders {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}
.acct-type-badge.downloads {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  opacity: 0.6;
}
.feature-badge {
  font-size: 0.75rem;
  margin-inline: 0.18rem;
}
.feature-badge.on  { color: var(--brand); opacity: 1; }
.feature-badge.off { color: var(--muted); opacity: 0.35; }

.quick-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: none;
}
.quick-link-btn:hover {
  background: var(--surface);
  color: var(--text);
}

/* ── 26. Settings form (editdefaults) tabs ──────────────────── */
.nav-tabs .nav-link {
  color: var(--muted);
  border-color: transparent;
}
.nav-tabs .nav-link.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border) var(--border) var(--surface);
}
.nav-tabs .nav-link:hover:not(.active) {
  color: var(--text);
  border-color: transparent;
}
/* Card directly below tabs — merge top border */
.rounded-top-0 { border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }
.border-top-0  { border-top: none !important; }

/* ── Dropdown (Bootstrap) — dark/light adaptation ─────────────── */
.dropdown-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.40);
  padding: 0.35rem;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.dropdown-item {
  color: var(--muted);
  border-radius: calc(var(--radius-card) - 4px);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  transition: background 0.15s, color 0.15s;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--surface-hover);
  color: var(--text);
}
.dropdown-item.active,
.dropdown-item:active {
  background: rgba(255, 255, 255, 0.13);
  color: var(--text);
}
.dropdown-divider { border-color: var(--border); margin: 0.25rem 0; }
[data-theme="light"] .dropdown-menu {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
}
[data-theme="light"] .dropdown-item:hover,
[data-theme="light"] .dropdown-item:focus { background: rgba(0, 0, 0, 0.04); }
[data-theme="light"] .dropdown-item.active { background: rgba(0, 0, 0, 0.07); }

/* ── Nav pills — neutral frosted-glass active (replaces Bootstrap #0d6efd) */
.nav-pills .nav-link {
  color: var(--muted);
  transition: background 0.18s, color 0.18s;
}
.nav-pills .nav-link:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background: rgba(255, 255, 255, 0.13);
  color: var(--text);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.07);
}
[data-theme="light"] .nav-pills .nav-link.active,
[data-theme="light"] .nav-pills .show > .nav-link {
  background: rgba(0, 0, 0, 0.07);
  color: var(--text);
  box-shadow: none;
}

/* ── Dashboard quick-link cards ──────────────────────────────── */
.dashboard-link-card {
  color: var(--text) !important;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
  cursor: pointer;
}
.dashboard-link-card:hover {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
}
[data-theme="light"] .dashboard-link-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.10);
  border-color: rgba(0, 0, 0, 0.14);
}
.dashboard-link-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--muted);
  transition: color 0.18s, background 0.18s;
}
.dashboard-link-card:hover .dashboard-link-icon {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}
[data-theme="light"] .dashboard-link-card:hover .dashboard-link-icon {
  background: rgba(0, 0, 0, 0.05);
}

/* ── 27. Audit log table ──────────────────────────────────────────────
 * Risk-level row highlighting and badge colours.
 * Works in both light and dark themes using semi-transparent tints.    */

.audit-row-critical td { border-left: 3px solid var(--bs-danger, #dc3545); }
.audit-row-elevated td { border-left: 3px solid var(--bs-warning, #ffc107); }

[data-theme="dark"]  .audit-row-critical,
[data-theme="dark"]  .audit-row-critical:hover { background: rgba(220,53,69,.12)  !important; }
[data-theme="dark"]  .audit-row-elevated,
[data-theme="dark"]  .audit-row-elevated:hover { background: rgba(255,193,7,.10)  !important; }
[data-theme="light"] .audit-row-critical,
[data-theme="light"] .audit-row-critical:hover { background: rgba(220,53,69,.07)  !important; }
[data-theme="light"] .audit-row-elevated,
[data-theme="light"] .audit-row-elevated:hover { background: rgba(255,193,7,.10)  !important; }

/* Risk badges */
.audit-badge-critical { background: #c0392b; color: #fff; }
.audit-badge-elevated { background: #d35400; color: #fff; }
.audit-badge-routine  { background: rgba(120,120,120,.35); color: inherit; }

/* Compact table font */
.audit-log-table { font-size: .85rem; }
.audit-log-table thead th { white-space: nowrap; }

/* ── 28. Role selector cards (.role-card-group) ──────────────────────
 * Used on admin add/edit forms for visual role selection.
 * Adapts to light and dark themes via CSS variables.              */

.role-card-group  { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.role-card-label  { flex: 1; min-width: 150px; cursor: pointer; }
.role-card-label input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

.role-card-inner {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 1.1rem 1rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.role-card-label:hover .role-card-inner {
  border-color: rgba(255,255,255,0.18);
  background: var(--surface-hover);
}
.role-card-label input:checked + .role-card-inner {
  border-color: var(--brand);
  background: var(--brand-glow);
  box-shadow: 0 0 0 1px var(--brand);
}
.role-card-icon {
  font-size: 1.4rem; margin-bottom: 0.45rem;
  color: var(--muted); transition: color 0.15s;
}
.role-card-label input:checked + .role-card-inner .role-card-icon { color: var(--brand); }
.role-card-name { font-weight: 600; font-size: 0.875rem; color: var(--text); }
.role-card-desc { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }
[data-theme="light"] .role-card-label:hover .role-card-inner { border-color: rgba(0,0,0,0.15); }

/* ── 29. System Messages — type badges ───────────────────────────────
 * Soft tinted badges that adapt to dark and light themes.
 * .badge-msg-info / -notice / -alert                              */

.badge-msg-info,
.badge-msg-notice,
.badge-msg-alert {
  display: inline-flex;
  align-items: center;
  padding: .2em .55em;
  border-radius: .35rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
}

/* Dark (default) */
.badge-msg-info   { background: rgba(255,255,255,0.09); color: var(--muted); }
.badge-msg-notice { background: rgba(245,158, 11,0.18); color: #f59e0b; }
.badge-msg-alert  { background: rgba(239, 68, 68,0.18); color: #f87171; }

/* Light */
[data-theme="light"] .badge-msg-info   { background: rgba(0,0,0,0.06);         color: var(--muted); }
[data-theme="light"] .badge-msg-notice { background: rgba(217,119,  6,0.12);   color: #92400e; }
[data-theme="light"] .badge-msg-alert  { background: rgba(220, 38, 38,0.12);   color: #b91c1c; }

/* ── 30. Dashboard — nav cards + stat cards ────────────────────────── */

.dash-nav-card {
  transition: transform .12s ease, box-shadow .12s ease;
  cursor: pointer;
  color: var(--text);
}
.dash-nav-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .375rem .75rem rgba(0,0,0,.25);
  color: var(--text);
}
[data-theme="light"] .dash-nav-card:hover {
  box-shadow: 0 .375rem .75rem rgba(0,0,0,.10);
}
.dash-nav-icon-primary {
  color: var(--brand);
}
.dash-nav-desc {
  font-size: .72rem;
  line-height: 1.3;
}

/* Skeleton placeholder — shimmer while stats load */
.skeleton-text {
  display: inline-block;
  min-width: 3em;
  height: .85em;
  border-radius: 4px;
  background: var(--surface-hover);
  background-image: linear-gradient(
    90deg,
    var(--surface-hover) 0%,
    rgba(255,255,255,0.06) 50%,
    var(--surface-hover) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  vertical-align: middle;
  color: transparent !important;
}
[data-theme="light"] .skeleton-text {
  background-image: linear-gradient(
    90deg,
    rgba(0,0,0,0.06) 0%,
    rgba(0,0,0,0.02) 50%,
    rgba(0,0,0,0.06) 100%
  );
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ── 31. Locations page ──────────────────────────────────────────────── */

/* Location table — row hover */
#loc-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.04);
}
[data-theme="light"] #loc-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.06);
}

/* Tool action links — compact icon buttons */
.loc-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  color: var(--muted);
  font-size: .8rem;
  text-decoration: none;
  transition: color .15s ease, background .15s ease;
}
.loc-tool:hover {
  color: var(--text);
  background: var(--surface-hover, rgba(255,255,255,0.06));
}
[data-theme="light"] .loc-tool:hover {
  background: rgba(0,0,0,0.06);
}
.loc-tool.text-danger:hover {
  color: var(--color-danger, #ef4444);
  background: rgba(239, 68, 68, 0.08);
}

/* Location ID code styling */
#loc-table code {
  color: var(--muted);
  font-size: .78rem;
}

/* Infinite scroll sentinel */
#loc-sentinel .spinner-border {
  width: 1.2rem;
  height: 1.2rem;
}


/* ── 32. Photographer Activity Log ─────────────────────────────────── */
/* Role badges for per-photographer audit trail.
   Reuses .audit-log-table, .audit-row-elevated, .audit-badge-* from section 27. */

.paudit-role-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 500;
  padding: .2em .55em;
  border-radius: 4px;
  line-height: 1.4;
  white-space: nowrap;
}
.paudit-role-account_owner    { background: var(--brand); color: #fff; }
.paudit-role-manager          { background: rgba(99,102,241,.75); color: #fff; }
.paudit-role-admin            { background: rgba(99,102,241,.75); color: #fff; }
.paudit-role-triprism_admin   { background: #c0392b; color: #fff; }
.paudit-role-padmin           { background: #d35400; color: #fff; }
.paudit-role-location         { background: rgba(16,185,129,.6); color: #fff; }
.paudit-role-regional         { background: rgba(59,130,246,.6); color: #fff; }
.paudit-role-area             { background: rgba(59,130,246,.6); color: #fff; }
.paudit-role-customer_service { background: rgba(245,158,11,.6); color: #fff; }
.paudit-role-reports          { background: rgba(120,120,120,.5); color: #fff; }

/* Light theme — slightly more opaque badges */
[data-theme="light"] .paudit-role-account_owner  { background: var(--brand); }
[data-theme="light"] .paudit-role-manager,
[data-theme="light"] .paudit-role-admin          { background: rgba(99,102,241,.85); }
[data-theme="light"] .paudit-role-triprism_admin { background: #e74c3c; }
[data-theme="light"] .paudit-role-padmin         { background: #e67e22; }
[data-theme="light"] .paudit-role-location       { background: rgba(16,185,129,.75); }
[data-theme="light"] .paudit-role-regional,
[data-theme="light"] .paudit-role-area           { background: rgba(59,130,246,.75); }
[data-theme="light"] .paudit-role-customer_service { background: rgba(245,158,11,.75); }
[data-theme="light"] .paudit-role-reports        { background: rgba(120,120,120,.65); }

/* CSV export button */
.paudit-export-btn {
  font-size: .8rem;
  padding: .3em .75em;
}


/* ── 33. Account Section — toolbar, accordion, profile ──────────────── */

/* Account tab toolbar — nav pills */
.account-toolbar .nav-pills {
  gap: .35rem;
}
.account-toolbar .nav-pills .nav-link {
  font-size: .82rem;
  font-weight: 500;
  padding: .4rem .85rem;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  transition: background .15s, color .15s, border-color .15s;
}
.account-toolbar .nav-pills .nav-link:hover {
  color: var(--text);
  border-color: var(--brand);
}
.account-toolbar .nav-pills .nav-link.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Platform Settings — accordion theming */
.platform-accordion .accordion-item {
  background: var(--surface);
  border-color: var(--border);
}
.platform-accordion .accordion-button {
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: .88rem;
}
.platform-accordion .accordion-button::after {
  filter: var(--accordion-chevron-filter, none);
}
.platform-accordion .accordion-button:not(.collapsed) {
  background: var(--brand-glow);
  color: var(--text);
  box-shadow: none;
}
.platform-accordion .accordion-body {
  border-top: 1px solid var(--border);
}

/* Dark theme accordion chevron needs inversion */
:root {
  --accordion-chevron-filter: invert(1);
}
[data-theme="light"] {
  --accordion-chevron-filter: none;
}

/* Profile definition list */
.profile-field dt {
  font-weight: 500;
  font-size: .85rem;
  color: var(--muted);
  padding-top: .4rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}
.profile-field dd {
  font-size: .88rem;
  padding-top: .4rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}
.profile-field dt:last-of-type,
.profile-field dd:last-of-type {
  border-bottom: none;
}

/* Finance role badge for audit log */
.paudit-role-finance { background: rgba(34,197,94,.6); color: #fff; }
[data-theme="light"] .paudit-role-finance { background: rgba(34,197,94,.75); }


/* ── 34. Account Switcher — Orders / Downloads pairing ────────────────
   Compact inline switcher: [ORD badge] [Switch to Downloads →]
   Green = ORDERS account, Blue = DOWNLOADS account.
   ──────────────────────────────────────────────────────────────────── */

/* Single-row inline container */
.sidebar-account-switcher {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.35rem 0.5rem 0;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: background 0.2s, border-color 0.2s;
}

/* Compact type badge (ORD / DL) */
.sidebar-account-badge {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Switch button link */
.sidebar-switch-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-switch-btn:hover { color: var(--text); }
.sidebar-switch-btn i { font-size: 0.65rem; flex-shrink: 0; }

/* ── ORDERS (green) ──────────────────────────────────────────── */
body[data-account-type="orders"] .sidebar-account-switcher {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.25);
}
body[data-account-type="orders"] .sidebar-account-badge {
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
}
body[data-account-type="orders"] .sidebar-switch-btn:hover {
  background: rgba(34, 197, 94, 0.10);
}
body[data-account-type="orders"] #topbar {
  border-bottom: 2px solid rgba(34, 197, 94, 0.50);
}

/* ── DOWNLOADS (blue) ────────────────────────────────────────── */
body[data-account-type="downloads"] .sidebar-account-switcher {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.25);
}
body[data-account-type="downloads"] .sidebar-account-badge {
  background: rgba(59, 130, 246, 0.18);
  color: #3b82f6;
}
body[data-account-type="downloads"] .sidebar-switch-btn:hover {
  background: rgba(59, 130, 246, 0.10);
}
body[data-account-type="downloads"] #topbar {
  border-bottom: 2px solid rgba(59, 130, 246, 0.50);
}

/* ── Light theme variants */
[data-theme="light"] body[data-account-type="orders"] .sidebar-account-switcher {
  background: rgba(34, 197, 94, 0.06);
  border-color: rgba(34, 197, 94, 0.20);
}
[data-theme="light"] body[data-account-type="downloads"] .sidebar-account-switcher {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.20);
}
[data-theme="light"] body[data-account-type="orders"] #topbar {
  border-bottom: 2px solid rgba(34, 197, 94, 0.40);
}
[data-theme="light"] body[data-account-type="downloads"] #topbar {
  border-bottom: 2px solid rgba(59, 130, 246, 0.40);
}

/* ── Collapsed sidebar: badge-only ───────────────────────────── */
#sidebar.sidebar-collapsed .sidebar-account-switcher {
  justify-content: center;
  margin: 0.25rem 0.2rem 0;
  padding: 0.25rem;
}
#sidebar.sidebar-collapsed .sidebar-switch-btn { display: none; }

/* ═══════════════════════════════════════════════════════════════
   29. Location Architecture — Toolbar Tabs, Filter Bar, Badges
   ═══════════════════════════════════════════════════════════════ */

/* Toolbar tabs row */
.loc-toolbar-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.loc-toolbar-tab {
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.loc-toolbar-tab:hover {
  color: var(--text);
}
.loc-toolbar-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* Filter bar */
.loc-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.loc-filter-bar .form-select {
  min-width: 140px;
  max-width: 200px;
}

/* Metadata badges under location name in table */
.loc-meta {
  margin-top: 2px;
  line-height: 1.3;
}
.loc-meta-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}
.loc-meta-badge.bg {
  background: rgba(124, 58, 237, 0.15);
  color: var(--brand);
}
.loc-meta-badge.pf {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}
[data-theme="light"] .loc-meta-badge.bg {
  background: rgba(124, 58, 237, 0.1);
}
[data-theme="light"] .loc-meta-badge.pf {
  background: rgba(59, 130, 246, 0.1);
}
.loc-meta-badge.qc {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
}
[data-theme="light"] .loc-meta-badge.qc {
  background: rgba(234, 179, 8, 0.15);
  color: #a16207;
}

/* Tag chips */
.loc-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  margin: 1px 2px;
}
[data-theme="light"] .loc-tag {
  background: rgba(0, 0, 0, 0.06);
}

/* Responsive: stack filter bar on small screens */
@media (max-width: 576px) {
  .loc-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .loc-filter-bar .form-select,
  .loc-filter-bar .input-group {
    max-width: 100%;
  }
  .loc-toolbar-tab {
    padding: 0.45rem 0.6rem;
    font-size: 0.75rem;
  }
}


/* ── 35. ACL Permission Override UI + Readonly Badge ─────────────────
   Permission grid in subuser edit form.
   Readonly badge in sidebar for admin masquerade.
   Client role badge in audit log.
   ──────────────────────────────────────────────────────────────────── */

/* Permission override table */
.acl-override-table {
  font-size: 0.82rem;
}
.acl-override-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
}
.acl-override-table td {
  vertical-align: middle;
  padding: 0.35rem 0.5rem;
}
.acl-override-table .form-check-input {
  cursor: pointer;
}
.acl-tier-badge {
  font-size: 0.6rem;
  padding: 0.15em 0.4em;
  vertical-align: middle;
}

/* Readonly badge (shared pattern for admin + photographer sidebars) */
.sidebar-readonly-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.5rem 0.5rem 0;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.sidebar-readonly-badge i {
  font-size: 0.72rem;
}

/* Collapsed sidebar: hide text, keep icon */
.sidebar-collapsed .sidebar-readonly-badge span {
  display: none;
}
.sidebar-collapsed .sidebar-readonly-badge {
  justify-content: center;
  padding: 0.4rem;
  margin: 0.5rem 0.25rem 0;
}

/* Light theme readonly badge */
[data-theme="light"] .sidebar-readonly-badge {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: #dc2626;
}

/* Client role badge in photographer audit log */
.paudit-role-client {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}
[data-theme="light"] .paudit-role-client {
  background: rgba(168, 85, 247, 0.12);
  color: #7c3aed;
}

/* ═══════════════════════════════════════════════════════════════
   35. ACL Permission Grid — Collapsible Groups & Action Toggles
   ═══════════════════════════════════════════════════════════════ */

/* Group header row — parent feature with expand/collapse chevron */
.acl-group-header {
  background: rgba(124, 58, 237, 0.06);
  border-bottom: 1px solid var(--border);
}
.acl-group-header td {
  font-weight: 600;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}
[data-theme="light"] .acl-group-header {
  background: rgba(124, 58, 237, 0.05);
}

/* Chevron toggle button */
.acl-group-toggle {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0.35rem;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  display: inline-block;
}
.acl-group-toggle.collapsed {
  transform: rotate(-90deg);
}

/* Collapsible children container — max-height transition */
.acl-group-children tr {
  transition: opacity 0.15s ease;
}
.acl-group-children.acl-collapsed {
  display: none;
}

/* Indentation for nested rows */
.acl-indent-1 { padding-left: 1.5rem !important; }
.acl-indent-2 { padding-left: 2.8rem !important; }
.acl-indent-3 { padding-left: 4.0rem !important; }

/* Action sub-key rows — lighter background */
.acl-action-row {
  background: rgba(255, 255, 255, 0.02);
}
.acl-action-row td:first-child {
  font-size: 0.85rem;
  color: var(--muted);
}
[data-theme="light"] .acl-action-row {
  background: rgba(0, 0, 0, 0.015);
}

/* Action toggle — Allowed / No Access pill buttons */
.acl-action-toggle {
  display: inline-flex;
  gap: 0;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.acl-action-toggle label {
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
  margin: 0;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.acl-action-toggle input[type="radio"] {
  display: none;
}
.acl-action-toggle input[type="radio"]:checked + label {
  background: var(--brand);
  color: #fff;
}
.acl-action-toggle .acl-deny-label {
  border-left: 1px solid var(--border);
}
.acl-action-toggle input[type="radio"].acl-deny-radio:checked + label {
  background: rgba(239, 68, 68, 0.75);
  color: #fff;
}

/* ACL table compact styling */
#acl-grid-table {
  font-size: 0.85rem;
  margin-bottom: 0;
}
#acl-grid-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
#acl-grid-table td {
  vertical-align: middle;
  padding: 0.35rem 0.5rem;
}
#acl-grid-table .form-check-input {
  cursor: pointer;
}

/* Tier explanation footer */
.acl-tier-help {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
}

/* Reset to Defaults button */
.acl-reset-btn {
  font-size: 0.78rem;
}

/* ═══════════════════════════════════════════════════════════════
   36. Model Releases — Dashboard, Status Badges, Template Builder
   ═══════════════════════════════════════════════════════════════ */

/* Stat cards on dashboard */
.mr-stat-card {
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.mr-stat-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.12);
}
.mr-stat-icon {
  font-size: 2.2rem;
  color: var(--brand);
  margin-bottom: 0.75rem;
}
.mr-stat-icon.mr-stat-pending { color: #f59e0b; }
.mr-stat-icon.mr-stat-approved { color: #22c55e; }
.mr-stat-count {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

/* Quick action cards */
.mr-quick-action-card {
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, transform 0.15s ease;
  color: var(--text);
}
.mr-quick-action-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  color: var(--text);
}
.mr-quick-icon {
  font-size: 1.4rem;
  color: var(--brand);
  width: 2.5rem;
  text-align: center;
  flex-shrink: 0;
}

/* Status badges */
.mr-status { font-size: 0.78rem; padding: 0.25em 0.65em; border-radius: 4px; font-weight: 600; }
.mr-status-pending   { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.mr-status-approved  { background: rgba(34, 197, 94, 0.15);  color: #22c55e; }
.mr-status-cancelled { background: rgba(239, 68, 68, 0.15);  color: #ef4444; }
.mr-status-deleted   { background: rgba(107, 114, 128, 0.15); color: #6b7280; }
.mr-status-revoked   { background: rgba(239, 68, 68, 0.25); color: #ef4444; border: 1px dashed rgba(239, 68, 68, 0.4); }
[data-theme="light"] .mr-status-pending   { background: rgba(245, 158, 11, 0.12); color: #d97706; }
[data-theme="light"] .mr-status-approved  { background: rgba(34, 197, 94, 0.12);  color: #16a34a; }
[data-theme="light"] .mr-status-cancelled { background: rgba(239, 68, 68, 0.10);  color: #dc2626; }
[data-theme="light"] .mr-status-revoked   { background: rgba(239, 68, 68, 0.15); color: #dc2626; border: 1px dashed rgba(239, 68, 68, 0.3); }
[data-theme="light"] .mr-status-deleted   { background: rgba(107, 114, 128, 0.10); color: #4b5563; }

/* Consent method badges */
.mr-consent { font-size: 0.78rem; padding: 0.2em 0.55em; border-radius: 4px; font-weight: 500; }
.mr-consent-verbal  { background: rgba(59, 130, 246, 0.15);  color: #3b82f6; }
.mr-consent-written { background: rgba(168, 85, 247, 0.15);  color: #a855f7; }
.mr-consent-digital { background: rgba(124, 58, 237, 0.15);  color: #7c3aed; }
[data-theme="light"] .mr-consent-verbal  { background: rgba(59, 130, 246, 0.10);  color: #2563eb; }
[data-theme="light"] .mr-consent-written { background: rgba(168, 85, 247, 0.10);  color: #7c3aed; }
[data-theme="light"] .mr-consent-digital { background: rgba(124, 58, 237, 0.10);  color: #6d28d9; }

/* Template builder — field config grid */
.mr-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.mr-field-row:last-child { border-bottom: none; }
.mr-field-label {
  font-weight: 500;
  min-width: 160px;
}
.mr-field-toggle .btn-group .btn {
  font-size: 0.78rem;
  padding: 0.2rem 0.65rem;
}
.mr-field-toggle .btn-check:checked + .btn-outline-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* Legal text display */
.mr-legal-box {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  background: rgba(255,255,255,0.03);
  font-size: 0.85rem;
  line-height: 1.5;
}
[data-theme="light"] .mr-legal-box {
  background: rgba(0,0,0,0.02);
}

/* Release list filter bar */
.mr-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
  margin-bottom: 1rem;
}
.mr-filter-bar .form-control,
.mr-filter-bar .form-select {
  max-width: 180px;
  font-size: 0.85rem;
}

/* Release list table */
#mr-releases-table {
  font-size: 0.85rem;
}
#mr-releases-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
#mr-releases-table td {
  vertical-align: middle;
}
#mr-releases-table tbody tr {
  transition: background 0.15s ease;
}
#mr-releases-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.04);
}
[data-theme="light"] #mr-releases-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.05);
}

/* Sentinel for infinite scroll */
#mr-sentinel {
  text-align: center;
  padding: 1.5rem 0;
}

/* Template cards grid */
.mr-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.mr-template-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.2s ease;
}
.mr-template-card:hover {
  border-color: var(--brand);
}
.mr-template-card.mr-template-default {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}


/* ═══════════════════════════════════════════════════════════════
   37. Gallery Codes — Overview Page, Inline Card, Company Codes
   ═══════════════════════════════════════════════════════════════ */

/* Code display — monospace with copy button */
.gc-code-display {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
}
.gc-code-display code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--brand);
}
.gc-copy-btn {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

/* Inline card (per-location partial) */
.gc-inline-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

/* Type badge */
.gc-type-all {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}
.gc-type-released {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

/* Access mode badge */
.gc-access-unrestricted {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}
.gc-access-restricted {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

/* Status badge (enabled / disabled) */
.gc-status-active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}
.gc-status-disabled {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

/* Company code cards */
.gc-company-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  transition: border-color 0.2s ease;
}
.gc-company-card:hover {
  border-color: var(--brand);
}
.gc-company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* Gallery codes table — overview page */
#gc-table tbody tr {
  transition: background 0.15s ease;
}
#gc-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.04);
}
[data-theme="light"] #gc-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.06);
}

/* Gallery codes filter bar */
.gc-filter-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.gc-filter-bar .form-control,
.gc-filter-bar .form-select {
  max-width: 200px;
}

/* Infinite scroll sentinel */
#gc-sentinel {
  text-align: center;
  padding: 1.5rem 0;
}
#gc-sentinel .spinner-border {
  width: 1.5rem;
  height: 1.5rem;
}

/* Light theme overrides for gallery code badges */
[data-theme="light"] .gc-type-all {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}
[data-theme="light"] .gc-type-released {
  background: rgba(168, 85, 247, 0.12);
  color: #7c3aed;
}
[data-theme="light"] .gc-access-unrestricted {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}
[data-theme="light"] .gc-access-restricted {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
[data-theme="light"] .gc-status-active {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}
[data-theme="light"] .gc-status-disabled {
  background: rgba(148, 163, 184, 0.12);
  color: #64748b;
}

/* Responsive: stack filter bar on small screens */
@media (max-width: 576px) {
  .gc-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .gc-filter-bar .form-control,
  .gc-filter-bar .form-select {
    max-width: 100%;
  }
}


/* ═══════════════════════════════════════════════════════════════
   38. Registration — Dashboard, Search, Upload Form
   ═══════════════════════════════════════════════════════════════ */

/* Search result table — compact */
#search-result .table {
  font-size: 0.85rem;
}
#search-result .table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
#search-result code {
  color: var(--brand);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Upload form — section spacing */
#uploadForm hr {
  border-color: var(--border);
  opacity: 0.5;
}

/* Upload form — import option help text indentation */
#uploadForm .form-text code {
  color: var(--brand);
  font-size: 0.82em;
}

/* CSV preview table */
#csv-preview .table-responsive {
  border: 1px solid var(--border);
  border-radius: 6px;
}
#csv-table {
  font-size: 0.8rem;
  margin-bottom: 0;
}
#csv-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
#csv-table td {
  vertical-align: middle;
}
#csv-table .table-warning {
  background: rgba(245, 158, 11, 0.08) !important;
}
[data-theme="light"] #csv-table .table-warning {
  background: rgba(245, 158, 11, 0.10) !important;
}

/* Skeleton loading placeholders */
.skeleton-text {
  display: inline-block;
  min-width: 40px;
  height: 1em;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.06) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}
[data-theme="light"] .skeleton-text {
  background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.02) 50%, rgba(0,0,0,0.06) 75%);
  background-size: 200% 100%;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Confirmation page — stat lines */
.page-content .fa-check-circle.fa-3x {
  color: #22c55e;
}
[data-theme="light"] .page-content .fa-check-circle.fa-3x {
  color: #16a34a;
}


/* ═══════════════════════════════════════════════════════════════
   39. Changelog / Release Notes
   ═══════════════════════════════════════════════════════════════ */

/* Sidebar changelog link — small font, muted, separator */
.sidebar-changelog {
  border-top: 1px solid var(--border);
  padding: 0.5rem 0 0.25rem;
  margin-top: 0.25rem;
}
.sidebar-changelog-link {
  font-size: 0.72rem !important;
  opacity: 0.7;
}
.sidebar-changelog-link:hover,
.sidebar-changelog-link.active {
  opacity: 1;
}
.sidebar-changelog-link .badge {
  font-size: 0.62rem;
  vertical-align: middle;
}

/* Badge — brand-colored pill */
.changelog-badge {
  background: var(--brand) !important;
  color: #fff !important;
  font-weight: 700;
}

/* Badge — amber pill for unpaid invoices */
.billing-badge {
  background: #f59e0b !important;
  color: #000 !important;
  font-weight: 700;
  font-size: 0.62rem;
  vertical-align: middle;
}

/* Collapsed sidebar — hide text + badge, icon only */
.sidebar-collapsed .sidebar-changelog-link span {
  display: none;
}
.sidebar-collapsed .sidebar-changelog {
  padding: 0.35rem 0 0.15rem;
}

/* Date group — card-like section with separator */
.changelog-date-group {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}
.changelog-date-group:last-child {
  border-bottom: none;
}

/* Date header row */
.changelog-date-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.changelog-date {
  font-weight: 700;
  color: var(--text);
}
.changelog-date-header .badge {
  font-size: 0.7rem;
  font-weight: 600;
}

/* Executive summary */
.changelog-summary {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

/* Entry row — flex with hover accent */
.changelog-entry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-left: 3px solid transparent;
  border-radius: 4px;
  transition: border-color 0.15s, background-color 0.15s;
}
.changelog-entry:hover {
  border-left-color: var(--brand);
  background: rgba(124, 58, 237, 0.04);
}
[data-theme="light"] .changelog-entry:hover {
  background: rgba(124, 58, 237, 0.06);
}

/* Entry title */
.changelog-entry-title {
  font-size: 0.9rem;
  color: var(--text);
}

/* Type badge — colored pill */
.changelog-type-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15em 0.55em;
  border-radius: 999px;
  white-space: nowrap;
  min-width: 5.2em;
  text-align: center;
}
.changelog-type-feature {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}
.changelog-type-enhancement {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}
.changelog-type-bug {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Light theme badge variants */
[data-theme="light"] .changelog-type-feature {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}
[data-theme="light"] .changelog-type-enhancement {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
}
[data-theme="light"] .changelog-type-bug {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

/* Detail toggle chevron */
.changelog-detail-toggle {
  color: var(--muted);
  font-size: 0.72rem;
  transition: transform 0.2s;
  text-decoration: none !important;
  flex-shrink: 0;
}
.changelog-detail-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

/* Collapse content — indented past badge width */
.changelog-detail {
  margin-left: calc(5.2em + 1rem + 0.5rem);
  padding: 0.25rem 0 0.5rem;
}
.changelog-detail p {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

/* Filter buttons — brand active state */
.page-content .btn-brand {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Responsive — stack on mobile */
@media (max-width: 576px) {
  .changelog-entry {
    flex-wrap: wrap;
  }
  .changelog-detail {
    margin-left: 0.5rem;
  }
}


/* =========================================================================
   40. AI Template Generation
   ========================================================================= */

/* --- Prompt Builder Modal --- */
.ai-prompt-field {
  margin-bottom: 1rem;
}
.ai-prompt-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.875rem;
}
.ai-prompt-field .form-text {
  color: var(--muted);
  font-size: 0.78rem;
}
.ai-prompt-field .form-select,
.ai-prompt-field .form-control {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
}
.ai-prompt-field .form-select:focus,
.ai-prompt-field .form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(124,58,237,0.2);
}
[data-theme="light"] .ai-prompt-field .form-select,
[data-theme="light"] .ai-prompt-field .form-control {
  background: rgba(0,0,0,0.03);
}

/* Elements checkbox grid */
.ai-elements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 12px;
}
.ai-elements-grid .form-check {
  padding: 6px 8px 6px 2rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.ai-elements-grid .form-check:hover {
  background: rgba(124,58,237,0.08);
}
[data-theme="light"] .ai-elements-grid .form-check {
  background: rgba(0,0,0,0.02);
}
[data-theme="light"] .ai-elements-grid .form-check:hover {
  background: rgba(124,58,237,0.06);
}

/* Remaining badge (compact, in toolbar) */
#ai-remaining-compact {
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}
#ai-remaining-badge {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(124,58,237,0.15);
  color: var(--brand);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ai-depleted {
  background: rgba(239,68,68,0.15) !important;
  color: #ef4444 !important;
}

/* Generation spinner */
.ai-gen-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: ai-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

/* --- AI Usage Page --- */

/* Stat cards row */
.ai-stat-card {
  text-align: center;
  padding: 1.25rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
}
[data-theme="light"] .ai-stat-card {
  background: rgba(0,0,0,0.02);
}
.ai-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.ai-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Usage progress bar */
.ai-usage-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.ai-usage-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.ai-usage-bar-fill.green  { background: #22c55e; }
.ai-usage-bar-fill.amber  { background: #f59e0b; }
.ai-usage-bar-fill.red    { background: #ef4444; }

/* Log table */
.ai-log-table {
  font-size: 0.82rem;
}
.ai-log-table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.ai-log-table td {
  padding: 8px 10px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
[data-theme="light"] .ai-log-table td {
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* Status badges */
.ai-log-status-success {
  color: #22c55e;
  font-weight: 600;
  font-size: 0.75rem;
}
.ai-log-status-error {
  color: #ef4444;
  font-weight: 600;
  font-size: 0.75rem;
}
.ai-log-status-rate_limited {
  color: #f59e0b;
  font-weight: 600;
  font-size: 0.75rem;
}

/* Expandable prompt block */
.ai-log-prompt {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.78rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  margin: 8px 0;
}
[data-theme="light"] .ai-log-prompt {
  background: rgba(0,0,0,0.04);
}

/* Prompt expand toggle */
.ai-log-expand {
  cursor: pointer;
  color: var(--muted);
  transition: color 0.15s;
  padding: 2px 6px;
  border: none;
  background: none;
}
.ai-log-expand:hover {
  color: var(--brand);
}
.ai-log-expand[aria-expanded="true"] i {
  transform: rotate(90deg);
}

/* Responsive */
@media (max-width: 768px) {
  .ai-elements-grid {
    grid-template-columns: 1fr;
  }
  .ai-stat-value {
    font-size: 1.4rem;
  }
}


/* ── 40. Sending Hours + AI Plan Builder ──────────────────────────────
   Sending hours day grid, override table, status badges.
   AI plan builder review cards, step rows, segment pills.
   ───────────────────────────────────────────────────────────────────── */

/* --- Sending Hours --- */
.sh-day-table {
  border-collapse: separate;
  border-spacing: 0;
}
.sh-day-row td {
  vertical-align: middle;
  padding: 6px 8px;
}
.sh-day-row label {
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
}
.sh-time-select {
  width: auto;
  min-width: 110px;
  display: inline-block;
}
.sh-override-table {
  font-size: 0.9rem;
}
.sh-override-table th {
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}
.sh-override-table td {
  vertical-align: middle;
}
.sh-status-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  font-weight: 500;
}
.sh-status-inherited {
  background: rgba(124,58,237,0.15);
  color: var(--brand);
}
.sh-status-custom {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}
.sh-status-disabled {
  background: rgba(255,255,255,0.1);
  color: var(--muted);
}
[data-theme="light"] .sh-status-inherited {
  background: rgba(124,58,237,0.1);
}
[data-theme="light"] .sh-status-custom {
  background: rgba(34,197,94,0.1);
  color: #16a34a;
}
[data-theme="light"] .sh-status-disabled {
  background: rgba(0,0,0,0.06);
}
.sh-inline-editor > td {
  padding: 0 !important;
  border-top: none !important;
}

/* --- AI Plan Builder --- */
.ai-plan-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
  background: var(--surface);
  transition: border-color 0.15s;
}
.ai-plan-card:hover {
  border-color: var(--brand);
}
.ai-plan-step {
  padding: 6px 0 6px 20px;
  border-left: 2px solid var(--border);
  margin-left: 8px;
  font-size: 0.9rem;
}
.ai-plan-step i {
  color: var(--brand);
  width: 16px;
  text-align: center;
}
.ai-plan-template-brief {
  font-style: italic;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
  line-height: 1.4;
}
.ai-plan-segment-pill {
  display: inline-block;
  background: rgba(124,58,237,0.12);
  color: var(--brand);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 500;
}
[data-theme="light"] .ai-plan-segment-pill {
  background: rgba(124,58,237,0.08);
}

/* Responsive */
@media (max-width: 576px) {
  .sh-time-select {
    min-width: 90px;
    font-size: 0.8rem;
  }
  .sh-day-row label {
    font-size: 0.85rem;
  }
}


/* ── 41. Registration — CSV preview, search result, stat skeleton ────
   Dashboard stats, search result table, CSV upload preview/validation.
   ───────────────────────────────────────────────────────────────────── */

/* Stat card skeleton shimmer */
#reg-stats .skeleton-text {
  display: inline-block;
  min-width: 2.5em;
  height: 1em;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}
[data-theme="light"] #reg-stats .skeleton-text {
  background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.10) 50%, rgba(0,0,0,0.06) 75%);
  background-size: 200% 100%;
}
@keyframes skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Search type selector */
.reg-search-type {
  width: auto;
}

/* Search result code display */
#search-result code {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand);
}

/* CSV preview table */
#csv-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  background: rgba(255,255,255,0.02);
}
[data-theme="light"] #csv-preview {
  background: rgba(0,0,0,0.015);
}
#csv-table {
  font-size: 0.82rem;
}
#csv-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
#csv-table td {
  vertical-align: middle;
}

/* CSV preview scrollable container */
#csv-preview .table-responsive {
  max-height: 320px;
  overflow-y: auto;
  border-radius: 4px;
}
#csv-table .csv-cell {
  max-width: 180px;
}

/* Scheduling section — sendafter picker */
#sendafter-picker {
  max-width: 320px;
}

/* Photo pass QR code centering */
#qrcodeimg {
  min-height: 240px;
}
#qrcodeimg canvas,
#qrcodeimg img {
  border-radius: 8px;
}

/* Responsive: stack search controls on small screens */
@media (max-width: 576px) {
  #search-result .table-responsive {
    font-size: 0.8rem;
  }
  #csv-preview .table-responsive {
    max-height: 240px;
  }
}


/* =========================================================================
   41 — Ticket Management: List + Filter Bar
   ========================================================================= */

/* --- Filter bar --- */
.ticket-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: flex-end;
}
.ticket-filter-bar > div {
  flex: 1 1 140px;
  min-width: 120px;
}
.ticket-filter-bar > div:first-child {
  flex: 2 1 220px;
}

/* --- Ticket table --- */
#tickets-table {
  font-size: 0.88rem;
}
#tickets-table thead th {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
#tickets-table tbody .ticket-row {
  transition: background 0.15s ease;
}
#tickets-table tbody .ticket-row:hover {
  background: rgba(124, 58, 237, 0.06);
}
[data-theme="light"] #tickets-table tbody .ticket-row:hover {
  background: rgba(124, 58, 237, 0.04);
}
.ticket-subject {
  font-weight: 500;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ticket-customer-name {
  font-weight: 500;
}

/* --- Status badges --- */
.ticket-status-new       { background: #3b82f6; color: #fff; }
.ticket-status-progress  { background: #f59e0b; color: #1a1a2e; }
.ticket-status-answered  { background: #22c55e; color: #fff; }
.ticket-status-replied   { background: #8b5cf6; color: #fff; }
.ticket-status-solved    { background: #64748b; color: #fff; }
.ticket-status-closed    { background: #475569; color: #fff; }

/* --- AI triage badge --- */
.ticket-ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
  font-size: 0.75rem;
}

/* --- Skeleton loading --- */
.ticket-skeleton-row td {
  padding: 10px 8px;
}
.ticket-skeleton-row .skeleton-text {
  display: inline-block;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.08) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}
[data-theme="light"] .ticket-skeleton-row .skeleton-text {
  background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.02) 50%, rgba(0,0,0,0.06) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

/* --- Sidebar ticket badge --- */
.sidebar-ticket-badge {
  font-size: 0.65rem;
  padding: 2px 5px;
  vertical-align: middle;
  margin-left: 4px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .ticket-filter-bar { flex-direction: column; }
  .ticket-filter-bar > div { flex: 1 1 100%; }
}


/* =========================================================================
   42 — Ticket Detail: Thread, Reply, Triage Panel
   ========================================================================= */

/* --- Message thread --- */
.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-msg {
  border-radius: 10px;
  padding: 14px 18px;
  border-left: 4px solid var(--border);
  background: var(--surface);
}

.ticket-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 4px;
}

.ticket-msg-sender {
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ticket-msg-sender i {
  font-size: 0.82rem;
  opacity: 0.7;
}

.ticket-msg-time {
  font-size: 0.78rem;
  color: var(--muted);
}

.ticket-msg-body {
  font-size: 0.92rem;
  line-height: 1.55;
  word-break: break-word;
}

/* Customer messages */
.ticket-msg-customer {
  border-left-color: #64748b;
}

/* Tech support (TriPrism admin) */
.ticket-msg-tech {
  border-left-color: #1e293b;
  background: rgba(30, 41, 59, 0.08);
}
[data-theme="light"] .ticket-msg-tech {
  background: rgba(30, 41, 59, 0.05);
}

/* Account staff (photographer team) */
.ticket-msg-staff {
  border-left-color: #7c3aed;
  background: rgba(124, 58, 237, 0.06);
}
[data-theme="light"] .ticket-msg-staff {
  background: rgba(124, 58, 237, 0.04);
}

/* Internal notes */
.ticket-msg-internal {
  border-left: 4px dashed #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}
[data-theme="light"] .ticket-msg-internal {
  background: rgba(245, 158, 11, 0.04);
}

/* System messages */
.ticket-msg-system {
  border-left-color: #64748b;
  background: rgba(100, 116, 139, 0.06);
  font-style: italic;
}

/* AI triage messages */
.ticket-msg-ai {
  border-left-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.06);
}
[data-theme="light"] .ticket-msg-ai {
  background: rgba(139, 92, 246, 0.04);
}

/* --- Message type badges --- */
.ticket-badge-internal {
  background: #f59e0b;
  color: #1a1a2e;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.ticket-badge-ai {
  background: #8b5cf6;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
}

/* --- Triage panel --- */
.ticket-triage-panel {
  border-left: 4px solid #8b5cf6;
}
.ticket-triage-confidence {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ticket-triage-action {
  padding: 4px 0;
  font-size: 0.88rem;
  color: var(--text);
}
.ticket-triage-action i {
  color: #8b5cf6;
  margin-right: 6px;
  font-size: 0.72rem;
}

/* --- Reply form --- */
#reply_message {
  min-height: 100px;
  resize: vertical;
}

/* --- Responsive --- */
@media (max-width: 576px) {
  .ticket-msg { padding: 10px 12px; }
  .ticket-msg-header { flex-direction: column; align-items: flex-start; }
}


/* =========================================================================
   43 — Two-Factor Authentication (2FA)
   ========================================================================= */

/* --- Method selection cards --- */
.twofa-method-card {
  cursor: pointer;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--surface);
}
.twofa-method-card:hover {
  border-color: var(--brand);
}
.twofa-method-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}
.twofa-method-card .method-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--brand);
}
.twofa-method-card .method-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}
.twofa-method-card .method-desc {
  font-size: 0.82rem;
  color: var(--muted);
}
.twofa-method-card .method-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.15);
  color: var(--brand);
  margin-top: 6px;
}

/* --- Code input --- */
.twofa-code-input {
  font-family: 'Courier New', monospace;
  font-size: 1.6rem;
  letter-spacing: 0.5em;
  text-align: center;
  max-width: 240px;
  margin: 0 auto;
  padding: 10px;
}

/* --- QR code container --- */
.twofa-qr-container {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  display: inline-block;
}
.twofa-qr-container canvas {
  display: block;
}

/* --- Secret key display --- */
.twofa-secret-key {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  word-break: break-all;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
}

/* --- Backup code grid --- */
.twofa-backup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}
.twofa-backup-code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.twofa-backup-num {
  color: var(--muted);
  font-size: 0.8rem;
  min-width: 20px;
}

/* --- Setup panel sections --- */
.twofa-panel {
  display: none;
}
.twofa-panel.active {
  display: block;
}

/* --- Resend countdown --- */
.twofa-resend-countdown {
  font-size: 0.85rem;
  color: var(--muted);
}

/* --- 2FA status badge in team table --- */
.twofa-badge-enabled {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* --- Light theme adjustments --- */
[data-theme="light"] .twofa-method-card {
  background: rgba(255,255,255,0.80);
}
[data-theme="light"] .twofa-method-card .method-badge {
  background: rgba(124, 58, 237, 0.10);
}
[data-theme="light"] .twofa-code-input {
  background: rgba(255,255,255,0.90);
}

/* --- Responsive --- */
@media (max-width: 576px) {
  .twofa-backup-grid { grid-template-columns: 1fr; }
  .twofa-code-input { font-size: 1.3rem; letter-spacing: 0.3em; }
}


/* =========================================================================
   44 — AI Triage Dashboard
   ========================================================================= */

/* Triage table */
.triage-table { font-size: 0.875rem; }
.triage-table td { vertical-align: middle; }

/* Classification badges */
.triage-classification-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25em 0.6em;
  border-radius: 0.25rem;
}
.triage-badge-missing_entitlements { background: rgba(239, 68, 68, 0.20); color: #ef4444; }
.triage-badge-cannot_find_photos   { background: rgba(245, 158, 11, 0.20); color: #f59e0b; }
.triage-badge-billing_issue        { background: rgba(168, 85, 247, 0.20); color: #a855f7; }
.triage-badge-general_question     { background: rgba(59, 130, 246, 0.20); color: #3b82f6; }
.triage-badge-technical_issue      { background: rgba(107, 114, 128, 0.20); color: #6b7280; }
.triage-badge-refund_request       { background: rgba(236, 72, 153, 0.20); color: #ec4899; }
.triage-badge-needs_human_review   { background: rgba(251, 191, 36, 0.20); color: #fbbf24; }
.triage-badge-error                { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Light theme classification badges */
[data-theme="light"] .triage-badge-missing_entitlements { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
[data-theme="light"] .triage-badge-cannot_find_photos   { background: rgba(245, 158, 11, 0.12); color: #d97706; }
[data-theme="light"] .triage-badge-billing_issue        { background: rgba(168, 85, 247, 0.12); color: #9333ea; }
[data-theme="light"] .triage-badge-general_question     { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
[data-theme="light"] .triage-badge-technical_issue      { background: rgba(107, 114, 128, 0.12); color: #4b5563; }
[data-theme="light"] .triage-badge-refund_request       { background: rgba(236, 72, 153, 0.12); color: #db2777; }
[data-theme="light"] .triage-badge-needs_human_review   { background: rgba(251, 191, 36, 0.12); color: #b45309; }
[data-theme="light"] .triage-badge-error                { background: rgba(239, 68, 68, 0.10); color: #dc2626; }

/* Confidence bar */
.triage-confidence-bar {
  position: relative;
  width: 80px;
  height: 20px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
  display: inline-block;
}
.triage-confidence-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--brand);
  border-radius: 10px;
  transition: width 0.3s ease;
}
.triage-confidence-text {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 20px;
  color: var(--text);
}
[data-theme="light"] .triage-confidence-bar {
  background: rgba(0,0,0,0.06);
}

/* Review status badges */
.triage-status-pending      { background: rgba(251, 191, 36, 0.20); color: #fbbf24; }
.triage-status-approved     { background: rgba(34, 197, 94, 0.20); color: #22c55e; }
.triage-status-rejected     { background: rgba(239, 68, 68, 0.20); color: #ef4444; }
.triage-status-reversed     { background: rgba(168, 85, 247, 0.20); color: #a855f7; }
.triage-status-auto_executed { background: rgba(59, 130, 246, 0.20); color: #3b82f6; }

[data-theme="light"] .triage-status-pending      { background: rgba(251, 191, 36, 0.12); color: #b45309; }
[data-theme="light"] .triage-status-approved     { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
[data-theme="light"] .triage-status-rejected     { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
[data-theme="light"] .triage-status-reversed     { background: rgba(168, 85, 247, 0.12); color: #9333ea; }
[data-theme="light"] .triage-status-auto_executed { background: rgba(59, 130, 246, 0.12); color: #2563eb; }

/* Action badges in triage detail */
.triage-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  padding: 0.25em 0.5em;
  border-radius: 0.25rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
}
.triage-action-badge i { font-size: 0.65rem; }

/* Case file display */
.triage-casefile pre {
  font-size: 0.8rem;
  max-height: 400px;
  overflow-y: auto;
  background: rgba(0,0,0,0.15);
  border-radius: 0.375rem;
  padding: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
}
[data-theme="light"] .triage-casefile pre {
  background: rgba(0,0,0,0.04);
}

/* Triage sidebar badge */
.sidebar-triage-badge {
  font-size: 0.65rem;
  vertical-align: middle;
  margin-left: 4px;
}

/* Run Triage Now results table */
#triageRunResults .table { font-size: 0.8rem; }
#triageRunResults .table td { vertical-align: middle; }

/* Triage log filter bar */
.triage-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.triage-filter-bar .form-select,
.triage-filter-bar .form-control {
  max-width: 180px;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .triage-filter-bar .form-select,
  .triage-filter-bar .form-control { max-width: 100%; }
  .triage-confidence-bar { width: 60px; }
}


/* =========================================================================
   45 — Canned Responses & Signatures
   ========================================================================= */

/* Canned response list */
.canned-response-row {
  transition: background 0.15s ease;
}
.canned-response-row:hover {
  background: rgba(124, 58, 237, 0.04);
}
[data-theme="light"] .canned-response-row:hover {
  background: rgba(124, 58, 237, 0.06);
}

/* Category badges */
.canned-category-badge {
  font-size: 0.7rem;
  padding: 0.2em 0.5em;
  border-radius: 0.2rem;
  background: rgba(124, 58, 237, 0.15);
  color: var(--brand);
}
[data-theme="light"] .canned-category-badge {
  background: rgba(124, 58, 237, 0.10);
}

/* Merge tag reference */
.merge-tag-ref {
  font-size: 0.8rem;
}
.merge-tag-ref code {
  font-size: 0.75rem;
  padding: 0.15em 0.35em;
  background: rgba(124, 58, 237, 0.10);
  border-radius: 0.2rem;
  color: var(--brand);
}

/* Signature preview in table */
.signature-preview {
  max-height: 80px;
  overflow: hidden;
  font-size: 0.8rem;
  white-space: pre-wrap;
  color: var(--muted);
}

/* Location badge on canned responses */
.canned-location-badge {
  font-size: 0.65rem;
  padding: 0.15em 0.4em;
  border-radius: 0.2rem;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}
[data-theme="light"] .canned-location-badge {
  background: rgba(59, 130, 246, 0.10);
  color: #2563eb;
}


/* =========================================================================
   46 — Smart Suggestions / Quick Context (Ticket Detail)
   ========================================================================= */

/* Quick Context card on ticket detail */
.ticket-quick-context {
  border-left: 3px solid var(--brand);
}
.ticket-quick-context .card-header {
  cursor: pointer;
  user-select: none;
}

/* Suggestion rows */
.qc-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.85rem;
}
.qc-row + .qc-row {
  border-top: 1px solid var(--border);
}

/* Status icons */
.qc-icon-ok     { color: #22c55e; }
.qc-icon-warn   { color: #f59e0b; }
.qc-icon-error  { color: #ef4444; }
.qc-icon-info   { color: #3b82f6; }

[data-theme="light"] .qc-icon-ok     { color: #16a34a; }
[data-theme="light"] .qc-icon-warn   { color: #d97706; }
[data-theme="light"] .qc-icon-error  { color: #dc2626; }
[data-theme="light"] .qc-icon-info   { color: #2563eb; }

/* Gap analysis alert */
.qc-gap-alert {
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}
[data-theme="light"] .qc-gap-alert {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.20);
}

/* One-click action buttons in ticket detail */
.ticket-quick-actions .btn {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
}

/* Canned response dropdown on reply form */
.canned-response-select {
  max-width: 300px;
  font-size: 0.8rem;
}

/* Suggested code highlight */
.qc-suggested-code {
  display: inline-block;
  padding: 0.2em 0.5em;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 0.25rem;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--brand);
}

/* AI triage panel on ticket */
.ticket-triage-panel {
  border-left: 3px solid #3b82f6;
}

/* Signature notice */
.signature-notice {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

@media (max-width: 576px) {
  .qc-row { flex-wrap: wrap; }
  .canned-response-select { max-width: 100%; }
}


/* =========================================================================
   47 — Ticket View: Thread, Sidebar, Summernote, Badges, Quick Context
   Two-column layout, message thread, reply card, hold badge, timer badges,
   status badges, quick-context items, Summernote dark/light theming.
   ========================================================================= */

/* --- Two-column layout --- */
.ticket-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.ticket-reply-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 16px;
}

/* --- Message thread --- */
.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ticket-message {
  border-radius: 10px;
  padding: 14px 18px;
  border-left: 4px solid var(--border);
  background: var(--surface);
}
.ticket-message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.85rem;
}
.ticket-message-header strong {
  font-weight: 600;
}
.ticket-message-header .text-muted {
  font-size: 0.78rem;
}
.ticket-message-body {
  font-size: 0.92rem;
  line-height: 1.55;
  word-break: break-word;
}

/* Staff messages — brand accent, slightly tinted */
.ticket-message-staff {
  border-left-color: #7c3aed;
  background: rgba(124, 58, 237, 0.06);
}
[data-theme="light"] .ticket-message-staff {
  background: rgba(124, 58, 237, 0.04);
}

/* Customer messages — default surface */
.ticket-message-customer {
  border-left-color: #64748b;
  background: var(--surface);
}

/* Internal notes — dashed amber border, amber tint */
.ticket-message-internal {
  border-left: 4px dashed #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}
[data-theme="light"] .ticket-message-internal {
  background: rgba(245, 158, 11, 0.04);
}

/* --- Summernote dark/light theming --- */
.note-editor {
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  overflow: hidden;
}
.note-toolbar {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 4px 8px !important;
}
.note-toolbar .note-btn {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  font-size: 0.8rem !important;
}
.note-toolbar .note-btn:hover {
  background: rgba(124, 58, 237, 0.10) !important;
}
.note-toolbar .note-btn.active {
  background: rgba(124, 58, 237, 0.15) !important;
  color: var(--brand) !important;
}
.note-editing-area {
  background: var(--surface) !important;
}
.note-editing-area .note-editable {
  background: var(--surface) !important;
  color: var(--text) !important;
  min-height: 120px;
  padding: 10px 14px !important;
  font-size: 0.9rem;
}
.note-editing-area .note-editable:focus {
  outline: none;
}
.note-statusbar {
  background: var(--surface) !important;
  border-top: 1px solid var(--border) !important;
}
.note-statusbar .note-resizebar {
  border-top: none !important;
}

/* Light theme Summernote overrides */
[data-theme="light"] .note-editor {
  border-color: rgba(0,0,0,0.12) !important;
}
[data-theme="light"] .note-toolbar {
  background: rgba(255,255,255,0.85) !important;
  border-bottom-color: rgba(0,0,0,0.08) !important;
}
[data-theme="light"] .note-toolbar .note-btn {
  border-color: rgba(0,0,0,0.10) !important;
  color: #1e293b !important;
}
[data-theme="light"] .note-editing-area,
[data-theme="light"] .note-editing-area .note-editable {
  background: rgba(255,255,255,0.90) !important;
  color: #0f172a !important;
}
[data-theme="light"] .note-statusbar {
  background: rgba(255,255,255,0.85) !important;
}

/* --- Hold badge (amber dashed, matches model-release revoked pattern) --- */
.ticket-hold-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px dashed #f59e0b;
  background: rgba(245, 158, 11, 0.10);
  color: #f59e0b;
}
[data-theme="light"] .ticket-hold-badge {
  background: rgba(245, 158, 11, 0.08);
  color: #b45309;
  border-color: #d97706;
}

/* --- Timer badges --- */
.ticket-timer-followup {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}
[data-theme="light"] .ticket-timer-followup {
  background: rgba(59, 130, 246, 0.10);
  color: #2563eb;
}

.ticket-timer-closing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
[data-theme="light"] .ticket-timer-closing {
  background: rgba(239, 68, 68, 0.10);
  color: #dc2626;
}

/* --- Status badge classes (pill-style) --- */
.ticket-status-new {
  background: #3b82f6;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.ticket-status-progress {
  background: #f59e0b;
  color: #1a1a2e;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.ticket-status-answered {
  background: #22c55e;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.ticket-status-replied {
  background: #8b5cf6;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.ticket-status-solved {
  background: #64748b;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.ticket-status-closed {
  background: #475569;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

/* --- Quick context item classes --- */
.qc-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0;
  font-size: 0.84rem;
}
.qc-item + .qc-item {
  border-top: 1px solid var(--border);
}

.qc-good {
  color: #22c55e;
}
.qc-good i { color: #22c55e; }

.qc-bad {
  color: #ef4444;
}
.qc-bad i { color: #ef4444; }

.qc-warn {
  color: #f59e0b;
}
.qc-warn i { color: #f59e0b; }

.qc-alert {
  color: #ef4444;
  font-weight: 700;
}
.qc-alert i { color: #ef4444; }

.qc-suggest {
  color: #3b82f6;
}
.qc-suggest i { color: #3b82f6; }

/* Light theme quick context overrides */
[data-theme="light"] .qc-good,
[data-theme="light"] .qc-good i { color: #16a34a; }
[data-theme="light"] .qc-bad,
[data-theme="light"] .qc-bad i { color: #dc2626; }
[data-theme="light"] .qc-warn,
[data-theme="light"] .qc-warn i { color: #d97706; }
[data-theme="light"] .qc-alert,
[data-theme="light"] .qc-alert i { color: #dc2626; }
[data-theme="light"] .qc-suggest,
[data-theme="light"] .qc-suggest i { color: #2563eb; }

/* --- Responsive: sidebar stacks above thread below lg --- */
@media (max-width: 991.98px) {
  .ticket-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
    margin-bottom: 16px;
  }
}
@media (max-width: 576px) {
  .ticket-message { padding: 10px 12px; }
  .ticket-message-header { flex-direction: column; align-items: flex-start; }
  .ticket-reply-card { padding: 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   47. SUPPORT TICKETS (Photographer → TriPrism)
   ═══════════════════════════════════════════════════════════════ */

/* --- Ticket table --- */
.sup-ticket-table { font-size: 0.875rem; }
.sup-ticket-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.sup-ticket-row:hover {
  background: rgba(124, 58, 237, 0.04);
}
[data-theme="light"] .sup-ticket-row:hover {
  background: rgba(124, 58, 237, 0.06);
}
.sup-ticket-number {
  font-size: 0.8rem;
  color: var(--brand);
  background: rgba(124, 58, 237, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}
.sup-ticket-subject {
  font-weight: 500;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sup-subject-cell {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Status badges --- */
.sup-status-new {
  background: #3b82f6;
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
}
.sup-status-progress {
  background: #f59e0b;
  color: #1a1a2e;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
}
.sup-status-awaiting {
  background: #8b5cf6;
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
}
.sup-status-resolved {
  background: #22c55e;
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
}
.sup-status-closed {
  background: #6b7280;
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
}

/* --- Priority badges --- */
.sup-priority-normal {
  background: rgba(107, 114, 128, 0.15);
  color: var(--muted);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: capitalize;
}
.sup-priority-high {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: capitalize;
}
.sup-priority-urgent {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

/* --- Category badge --- */
.sup-cat-badge {
  background: rgba(124, 58, 237, 0.1);
  color: var(--brand);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
}

/* --- Sidebar badge --- */
.sup-sidebar-badge {
  background: #7c3aed;
  color: #fff;
  font-size: 0.65rem;
  min-width: 18px;
}

/* --- Conversation thread --- */
.sup-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sup-message {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.sup-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.sup-message-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

/* Customer message */
.sup-message-customer {
  background: rgba(107, 114, 128, 0.06);
  border-left: 3px solid #6b7280;
}
[data-theme="light"] .sup-message-customer {
  background: rgba(107, 114, 128, 0.05);
}

/* Admin/staff message */
.sup-message-admin {
  background: rgba(124, 58, 237, 0.06);
  border-left: 3px solid #7c3aed;
}
[data-theme="light"] .sup-message-admin {
  background: rgba(124, 58, 237, 0.05);
}

/* Internal note */
.sup-message-internal {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #f59e0b;
  border-style: dashed;
  border-left-style: solid;
}
[data-theme="light"] .sup-message-internal {
  background: rgba(245, 158, 11, 0.06);
}

/* Forward record */
.sup-message-forward {
  background: rgba(217, 119, 6, 0.06);
  border-left: 3px solid #d97706;
  border-style: dashed;
  border-left-style: solid;
}
[data-theme="light"] .sup-message-forward {
  background: rgba(217, 119, 6, 0.04);
}

/* Author badges */
.sup-author-admin {
  background: #7c3aed;
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 3px;
}
.sup-author-internal {
  background: #f59e0b;
  color: #1a1a2e;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 3px;
}
.sup-author-forward {
  background: #d97706;
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 3px;
}

/* --- Email chips (quick-pick) --- */
.sup-email-chip {
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 20px;
}
.sup-email-chip:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* --- Satisfaction rating buttons --- */
.sup-rate-btn {
  font-size: 0.85rem;
  padding: 4px 16px;
  border-radius: 20px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .sup-ticket-subject { max-width: 180px; }
  .sup-subject-cell { max-width: 150px; }
  .sup-message-header { font-size: 0.8rem; }
}


/* =========================================================================
   48 — Ticket Features: Collision Detection, Merge/Split, Manual Create
   ========================================================================= */

/* --- Agent Collision Banner --- */
.collision-banner {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  background: rgba(59, 130, 246, 0.10);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #3b82f6;
}
.collision-banner.collision-has-typing {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.25);
  color: #22c55e;
}
[data-theme="light"] .collision-banner {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.18);
  color: #2563eb;
}
[data-theme="light"] .collision-banner.collision-has-typing {
  background: rgba(34, 197, 94, 0.06);
  border-color: rgba(34, 197, 94, 0.18);
  color: #16a34a;
}
.collision-viewing {
  color: #3b82f6;
}
.collision-typing {
  color: #22c55e;
}
[data-theme="light"] .collision-viewing { color: #2563eb; }
[data-theme="light"] .collision-typing  { color: #16a34a; }

/* --- Agent Count Badge (ticket list) --- */
.ticket-agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}
[data-theme="light"] .ticket-agent-badge {
  background: rgba(59, 130, 246, 0.10);
  color: #2563eb;
}

/* --- Merged Ticket Badge (ticket list + detail) --- */
.ticket-merged-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(107, 114, 128, 0.20);
  color: #9ca3af;
  border: 1px dashed rgba(107, 114, 128, 0.40);
}
[data-theme="light"] .ticket-merged-badge {
  background: rgba(107, 114, 128, 0.10);
  color: #6b7280;
  border-color: rgba(107, 114, 128, 0.30);
}

/* Dimmed row for merged tickets */
.ticket-row-merged td {
  opacity: 0.55;
}
.ticket-row-merged:hover td {
  opacity: 0.8;
}

/* --- Agent-Created Badge (ticket list) --- */
.ticket-agent-created-badge {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(124, 58, 237, 0.15);
  color: var(--brand);
  vertical-align: middle;
  margin-left: 4px;
}
[data-theme="light"] .ticket-agent-created-badge {
  background: rgba(124, 58, 237, 0.10);
}

/* --- Duplicate Cluster Badge (ticket list row) --- */
.ticket-dup-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.30);
  white-space: nowrap;
}
[data-theme="light"] .ticket-dup-badge {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.25);
}

/* --- Duplicate Summary Bar (above ticket table) --- */
.dup-summary-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin-bottom: 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  background: rgba(245, 158, 11, 0.10);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.20);
}
[data-theme="light"] .dup-summary-bar {
  background: rgba(245, 158, 11, 0.08);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.18);
}

/* --- Duplicate Detection Card --- */
#duplicates-card .badge.bg-secondary {
  font-size: 0.65rem;
  font-weight: 500;
}

/* --- Split Mode --- */
.split-checkbox {
  cursor: pointer;
  accent-color: var(--brand);
}
.ticket-message:has(.split-checkbox:checked) {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* Split sticky bar */
.split-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  padding: 12px 24px;
  background: rgba(124, 58, 237, 0.95);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.25);
}
[data-theme="light"] .split-sticky-bar {
  background: rgba(124, 58, 237, 0.92);
}

/* --- Merge Modal --- */
#mergeModalBody dl {
  font-size: 0.85rem;
}
#mergeModalBody dt {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 0.5rem;
}
#mergeModalBody dd {
  margin-bottom: 0.25rem;
}

/* --- Ticket Filter Bar (for tickets list) --- */
.ticket-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.ticket-filter-bar .form-control,
.ticket-filter-bar .form-select {
  max-width: 200px;
  font-size: 0.8rem;
}

/* --- Ticket Row hover (list) --- */
.ticket-row:hover {
  background: rgba(124, 58, 237, 0.04);
}
[data-theme="light"] .ticket-row:hover {
  background: rgba(124, 58, 237, 0.06);
}

/* AI badge in ticket list */
.ticket-ai-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  color: #3b82f6;
}

/* Customer name in ticket list */
.ticket-customer-name {
  font-weight: 500;
}
.ticket-subject {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Customer info DL in ticket detail sidebar */
.ticket-customer-dl dt {
  float: left;
  width: 110px;
  font-weight: 500;
  color: var(--muted);
  clear: left;
}
.ticket-customer-dl dd {
  margin-left: 115px;
  margin-bottom: 0.35rem;
  word-break: break-word;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .ticket-filter-bar .form-control,
  .ticket-filter-bar .form-select { max-width: 100%; }
  .ticket-subject { max-width: 160px; }
  .collision-banner { font-size: 0.78rem; }
}
@media (max-width: 576px) {
  .split-sticky-bar { padding: 10px 16px; font-size: 0.8rem; }
}


/* =========================================================================
   49 — Customer 360° Lookup
   Search bar card, stat card grid, detail tables, loading states,
   photo count highlight, wave-2 label, dark + light theme variants.
   ========================================================================= */

/* --- Search card --- */
.cs360-search-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 1rem;
}
.cs360-search-card .card-body {
  padding: 1.25rem;
}
.cs360-advanced-warning {
  font-size: 0.84rem;
  color: #f59e0b;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.18);
}
[data-theme="light"] .cs360-advanced-warning {
  color: #b45309;
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.15);
}

/* --- Stat card grid --- */
.cs360-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (max-width: 992px) {
  .cs360-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .cs360-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .cs360-grid { grid-template-columns: 1fr; }
}

/* --- Individual stat card --- */
.cs360-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  position: relative;
}
.cs360-card:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.12);
  transform: translateY(-1px);
}
.cs360-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Card with results — brand left accent */
.cs360-card.has-results {
  border-left: 3px solid var(--brand);
}
/* Card with error — red left accent */
.cs360-card.has-error {
  border-left: 3px solid #ef4444;
}
/* Card active (expanded detail) */
.cs360-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.20);
}

/* Inner layout */
.cs360-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* Icon */
.cs360-icon {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.cs360-card.has-results .cs360-icon {
  color: var(--brand);
}

/* Count number */
.cs360-count {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}
.cs360-card.has-results .cs360-count {
  color: var(--brand);
}

/* Channel label */
.cs360-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Loading spinner inside count */
.cs360-count .spinner-border {
  width: 1.2rem;
  height: 1.2rem;
  border-width: 2px;
  color: var(--muted);
}

/* Error display in count */
.cs360-count .cs360-error-icon {
  color: #ef4444;
  font-size: 1.1rem;
}

/* Wave 2 "via code" label */
.cs360-wave2-label {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 2px;
  font-style: italic;
}
.cs360-wave2-label i {
  font-size: 0.6rem;
}

/* --- Detail tables --- */
.cs360-detail {
  margin-bottom: 1.25rem;
}
.cs360-detail h6 {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cs360-detail-count {
  font-size: 0.72rem;
  font-weight: 600;
}

/* Table styling */
.cs360-table {
  font-size: 0.84rem;
}
.cs360-table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.cs360-table tbody td {
  vertical-align: middle;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
[data-theme="light"] .cs360-table tbody td {
  border-bottom-color: rgba(0,0,0,0.04);
}
.cs360-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.04);
}
[data-theme="light"] .cs360-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.06);
}

/* Code column styling */
.cs360-table code {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
}

/* Photo count highlight */
.cs360-photo-count {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand);
}
[data-theme="light"] .cs360-photo-count {
  color: #6d28d9;
}

/* Truncation warning */
.cs360-truncated {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.5rem;
  padding: 4px 0;
}

/* Status badges in results */
.cs360-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.cs360-status-sent    { background: rgba(34, 197, 94, 0.20); color: #22c55e; }
.cs360-status-queued  { background: rgba(59, 130, 246, 0.20); color: #3b82f6; }
.cs360-status-error   { background: rgba(239, 68, 68, 0.20); color: #ef4444; }
.cs360-status-pending { background: rgba(245, 158, 11, 0.20); color: #f59e0b; }

[data-theme="light"] .cs360-status-sent    { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
[data-theme="light"] .cs360-status-queued  { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
[data-theme="light"] .cs360-status-error   { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
[data-theme="light"] .cs360-status-pending { background: rgba(245, 158, 11, 0.12); color: #b45309; }

/* Star rating in feedback */
.cs360-stars {
  color: #f59e0b;
  letter-spacing: 1px;
}
[data-theme="light"] .cs360-stars {
  color: #d97706;
}

/* --- Error message in detail area --- */
.cs360-detail .cs360-error-msg {
  font-size: 0.84rem;
  color: #ef4444;
  padding: 8px 0;
}
[data-theme="light"] .cs360-detail .cs360-error-msg {
  color: #dc2626;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .cs360-table { font-size: 0.8rem; }
  .cs360-detail h6 { font-size: 0.88rem; }
}
@media (max-width: 576px) {
  .cs360-search-card .card-body { padding: 1rem; }
  .cs360-count { font-size: 1.3rem; }
  .cs360-card { padding: 0.75rem; }
  .cs360-table { font-size: 0.76rem; }
}


/* =========================================================================
   50 — Email Analytics, Suppressions & A/B Testing
   Campaign analytics delivery funnel, CSS bar charts, suppression badges,
   A/B variant editor, winner badge, dark + light theme variants.
   ========================================================================= */

/* --- Analytics stat card (reuses ai-stat-value/label from marketing) --- */
.analytics-stat-card {
  text-align: center;
  padding: 1rem 0.5rem;
}
.analytics-stat-card .ai-stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
}
.analytics-stat-card .ai-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

/* --- Delivery funnel (horizontal bar visualization) --- */
.analytics-funnel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 1.5rem;
}
.analytics-funnel-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.analytics-funnel-label {
  min-width: 90px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
  color: var(--muted);
}
.analytics-funnel-bar-bg {
  flex: 1;
  height: 28px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.analytics-funnel-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
  min-width: 2px;
}
.analytics-funnel-bar.bar-sent      { background: var(--brand); }
.analytics-funnel-bar.bar-delivered { background: #3b82f6; }
.analytics-funnel-bar.bar-opened    { background: #22c55e; }
.analytics-funnel-bar.bar-clicked   { background: #f59e0b; }
.analytics-funnel-count {
  min-width: 60px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* --- CSS bar chart (timeline, no JS library needed) --- */
.analytics-bar {
  display: inline-block;
  min-width: 4px;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
}
.analytics-bar.bar-opens   { background: #22c55e; }
.analytics-bar.bar-clicks  { background: #f59e0b; }
.analytics-bar-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
}

/* --- Rate display (large number) --- */
.analytics-rate {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}
.analytics-rate-label {
  font-size: 0.78rem;
  color: var(--muted);
}

/* --- Campaign analytics table --- */
.analytics-campaign-table {
  font-size: 0.84rem;
}
.analytics-campaign-table th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.analytics-campaign-table td {
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.analytics-campaign-table tr:hover td {
  background: rgba(124, 58, 237, 0.04);
}

/* --- Suppression reason badges --- */
.suppression-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.suppression-badge-hard_bounce {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.suppression-badge-spam_report {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.3);
}
.suppression-badge-unsubscribe {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
}
.suppression-badge-dropped {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}
.suppression-badge-manual {
  background: rgba(107, 114, 128, 0.15);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Light theme suppression badges */
[data-theme="light"] .suppression-badge-hard_bounce {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}
[data-theme="light"] .suppression-badge-spam_report {
  background: rgba(249, 115, 22, 0.1);
  color: #ea580c;
}
[data-theme="light"] .suppression-badge-unsubscribe {
  background: rgba(234, 179, 8, 0.1);
  color: #ca8a04;
}
[data-theme="light"] .suppression-badge-dropped {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}
[data-theme="light"] .suppression-badge-manual {
  background: rgba(107, 114, 128, 0.08);
  color: #4b5563;
}

/* --- Suppression table --- */
.suppression-table {
  font-size: 0.84rem;
}
.suppression-table th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
}
.suppression-table td {
  vertical-align: middle;
}
.suppression-detail-truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- A/B test variant editor --- */
.variant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.variant-row:last-child {
  border-bottom: none;
}
.variant-label-input {
  width: 100px;
  font-weight: 600;
}
.variant-subject-input {
  flex: 1;
}

/* --- A/B test winner badge --- */
.variant-winner {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
[data-theme="light"] .variant-winner {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

/* --- A/B test status badges --- */
.abtest-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}
.abtest-status-draft      { background: rgba(107,114,128,0.15); color: #9ca3af; }
.abtest-status-running    { background: rgba(59,130,246,0.15); color: #3b82f6; }
.abtest-status-evaluating { background: rgba(234,179,8,0.15); color: #eab308; }
.abtest-status-completed  { background: rgba(34,197,94,0.15); color: #22c55e; }
.abtest-status-cancelled  { background: rgba(239,68,68,0.15); color: #ef4444; }

[data-theme="light"] .abtest-status-draft      { color: #6b7280; }
[data-theme="light"] .abtest-status-running    { color: #2563eb; }
[data-theme="light"] .abtest-status-evaluating { color: #ca8a04; }
[data-theme="light"] .abtest-status-completed  { color: #16a34a; }
[data-theme="light"] .abtest-status-cancelled  { color: #dc2626; }

/* --- A/B variant comparison table --- */
.variant-compare-table {
  font-size: 0.84rem;
}
.variant-compare-table th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
}
.variant-compare-table tr.variant-winner-row td {
  background: rgba(34, 197, 94, 0.06);
}

/* --- Filter bar (shared between analytics and suppressions) --- */
.analytics-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  margin-bottom: 1rem;
}
.analytics-filter-bar .form-select,
.analytics-filter-bar .form-control {
  max-width: 200px;
  font-size: 0.84rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .analytics-funnel-label { min-width: 70px; font-size: 0.76rem; }
  .analytics-funnel-count { min-width: 40px; font-size: 0.76rem; }
  .analytics-filter-bar { flex-direction: column; align-items: stretch; }
  .analytics-filter-bar .form-select,
  .analytics-filter-bar .form-control { max-width: none; }
  .variant-row { flex-direction: column; align-items: stretch; }
  .variant-label-input { width: 100%; }
}
@media (max-width: 576px) {
  .analytics-stat-card .ai-stat-value { font-size: 1.4rem; }
  .analytics-rate { font-size: 1.5rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   49. Canned Responses Management
   ═══════════════════════════════════════════════════════════════════ */
.canned-body-preview {
  max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.canned-scope-global {
  font-size: 0.7rem; padding: 2px 7px; border-radius: 4px;
  background: rgba(59, 130, 246, 0.15); color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.canned-scope-location {
  font-size: 0.7rem; padding: 2px 7px; border-radius: 4px;
  background: rgba(34, 197, 94, 0.15); color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.25);
}
[data-theme="light"] .canned-scope-global {
  background: rgba(59, 130, 246, 0.10); color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.20);
}
[data-theme="light"] .canned-scope-location {
  background: rgba(34, 197, 94, 0.10); color: #15803d;
  border-color: rgba(34, 197, 94, 0.20);
}
#editorModal .note-editor { border-radius: 6px; }
#editorModal .note-toolbar { border-radius: 6px 6px 0 0; }
