/* Futuristic theme (optional, third option on the theme button: light -> dark -> futuristic).
   It sits on top of the dark theme: <html class="dark fx">, so every html.dark rule in style.css still applies and
   this file only changes tokens and adds effects. Plain CSS, no frameworks, no web fonts: it uses fonts Windows already has.
   Delete this file and its <link> in base.html (plus the 'futuristic' step in app.js) to remove the theme. */

html.fx {
  --maroon: #e0364a;            /* glowing crimson: borders, dots and accents on the dark ink background */
  --btn: #b91c2c;
  --btn-hover: #d12a3a;
  --gold: #fbbf24;
  --gold-soft: rgba(251, 191, 36, .22);
  --crimson-glow: rgba(224, 54, 74, .45);

  --bg: #070b1a;
  --surface: rgba(16, 23, 46, .74);
  --surface-2: rgba(6, 10, 24, .62);
  --text: #dbe4f5;
  --heading: #ffffff;
  --muted: #9fb0cc;
  --faint: #8396b8;
  --border: rgba(148, 163, 255, .18);
  --border-soft: rgba(148, 163, 255, .11);
  --hover: rgba(251, 191, 36, .07);
  --link: var(--gold);
  --nav-bg: rgba(7, 11, 26, .78);
  --glow-a: rgba(185, 28, 44, .26);
  --glow-b: rgba(251, 191, 36, .07);
  --red-50: rgba(224, 54, 74, .14);
  --red-100: rgba(224, 54, 74, .38);

  --radius-card: 1rem;
  --radius-inner: .75rem;
  --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 8px 30px -14px rgba(0, 0, 0, .8);
  --shadow-lift: 0 0 0 1px var(--gold-soft), 0 16px 44px -14px var(--crimson-glow);

  --fx-display: 'Bahnschrift', 'Segoe UI Variable Display', 'Segoe UI', 'Inter', 'Inter Fallback', system-ui, sans-serif;
  --fx-mono: 'Cascadia Mono', 'Cascadia Code', 'JetBrains Mono', Consolas, ui-monospace, monospace;
}

/* ---- backdrop: ink + crimson/gold glow + a faint grid that fades out toward the edges ---- */
html.fx body { background-image:
    radial-gradient(60rem 36rem at 0% -10%, var(--glow-a), transparent 60%),
    radial-gradient(48rem 30rem at 100% 105%, var(--glow-b), transparent 60%); }
html.fx body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(148, 163, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 255, .06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 15%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 20%, #000 15%, transparent 75%); }
html.fx ::selection { background: rgba(251, 191, 36, .35); color: #fff; }
html.fx { scrollbar-color: rgba(148, 163, 255, .35) transparent; }

/* ---- type ---- */
html.fx h1, html.fx h2, html.fx h3, html.fx .stat-n, html.fx .brand-text strong { font-family: var(--fx-display); }
html.fx h1 { font-weight: 700; letter-spacing: .005em; }
html.fx h2 { font-weight: 700; letter-spacing: .02em; }
html.fx .mono, html.fx time.running, html.fx .kv dd .mono { font-family: var(--fx-mono); font-size: .84em; }
html.fx .table td .mono { color: var(--gold); text-shadow: 0 0 14px rgba(251, 191, 36, .35); font-weight: 600; letter-spacing: .02em; }
html.fx .page-head h1 { position: relative; padding-left: 16px; }
html.fx .page-head h1::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 4px; border-radius: 4px;
  background: linear-gradient(180deg, var(--gold), var(--maroon)); box-shadow: 0 0 14px rgba(251, 191, 36, .55); }
html.fx .crumb { font-family: var(--fx-mono); letter-spacing: .1em; }

/* ---- header ---- */
html.fx .topbar { border-bottom-color: var(--border); box-shadow: 0 10px 40px -20px rgba(0, 0, 0, .9); }
html.fx .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--maroon) 18%, var(--gold) 50%, var(--maroon) 82%, transparent); opacity: .7; }
html.fx .brand-logo { filter: drop-shadow(0 0 10px rgba(224, 54, 74, .5)); }
html.fx .nav a, html.fx .nav-menu-btn { font-family: var(--fx-display); letter-spacing: .1em; }
html.fx .nav a:hover, html.fx .nav a.active, html.fx .nav-menu-btn:hover, html.fx .nav-menu.open .nav-menu-btn, html.fx .nav-menu.active .nav-menu-btn {
  text-shadow: 0 0 14px rgba(251, 191, 36, .55); }
html.fx .nav a.nav-cta, html.fx .nav a.nav-cta:hover, html.fx .nav a.nav-cta.active { background: linear-gradient(135deg, #d12a3a, #8f1422); box-shadow: 0 0 22px -4px var(--crimson-glow); text-shadow: none; }
html.fx .nav a.nav-cta:hover { box-shadow: 0 0 30px -2px rgba(224, 54, 74, .8); }
html.fx .nav-menu-list { background: rgba(10, 15, 34, .97); border-color: var(--border); box-shadow: 0 24px 60px -18px #000, 0 0 0 1px var(--gold-soft);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
html.fx .nav-user-btn { background: var(--surface); }
html.fx .avatar { background: linear-gradient(135deg, #d12a3a, #7f1d1d); box-shadow: 0 0 14px -2px var(--crimson-glow); }
html.fx .nav-toggle, html.fx .theme-toggle { background: var(--surface); }
html.fx .theme-toggle { color: var(--gold); border-color: var(--gold-soft); }
html.fx .theme-toggle:hover { box-shadow: 0 0 18px -4px rgba(251, 191, 36, .6); border-color: var(--gold); }
/* the button shows the theme a click switches to: light -> moon, dark -> star, futuristic -> sun */
.theme-toggle .fxi { display: none; }
html.dark .theme-toggle .fxi { display: inline; }
html.dark.fx .theme-toggle .fxi { display: none; }
html.dark:not(.fx) .theme-toggle .sun { display: none; }
html.dark.fx .theme-toggle .sun { display: inline; }

/* ---- glass surfaces ---- */
html.fx .card, html.fx .stat, html.fx .item, html.fx .comment, html.fx .picked, html.fx .notice {
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); }
html.fx .card { border-color: var(--border); box-shadow: var(--shadow); }
html.fx .card-head a { font-family: var(--fx-mono); letter-spacing: .08em; }
html.fx .footer { background: rgba(7, 11, 26, .6); border-top-color: var(--border); }
html.fx .footer-copy { border-top-color: var(--border); }

/* ---- stat tiles ---- */
html.fx .stat { position: relative; overflow: hidden; border-color: var(--border); box-shadow: var(--shadow); }
html.fx .stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; opacity: .85;
  background: linear-gradient(90deg, var(--maroon), var(--gold) 70%, transparent); }
html.fx .stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(251, 191, 36, .14), transparent); transition: opacity .3s; opacity: .6; }
html.fx a.stat:hover { border-color: rgba(251, 191, 36, .55); box-shadow: var(--shadow-lift); }
html.fx a.stat:hover::after { opacity: 1; }
html.fx .stat-n { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0;
  background: linear-gradient(180deg, #fff 30%, #fde8a6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #fff; }
html.fx .stat-l { font-family: var(--fx-mono); font-weight: 600; letter-spacing: .09em; font-size: .62rem; }
html.fx .stat-alert { border-color: rgba(224, 54, 74, .5); background: linear-gradient(135deg, rgba(224, 54, 74, .2), var(--surface) 75%); }
html.fx .stat-alert::before { background: linear-gradient(90deg, #ff5468, var(--gold) 60%, transparent); }
html.fx .stat-alert .stat-n { background: none; -webkit-text-fill-color: #ff7a89; color: #ff7a89; text-shadow: 0 0 22px rgba(255, 84, 104, .55); }

/* ---- tables ---- */
html.fx .table th { font-family: var(--fx-mono); font-weight: 600; letter-spacing: .1em; background: rgba(6, 10, 24, .55); color: var(--faint); border-bottom-color: var(--border); }
html.fx .table tbody tr { position: relative; }
html.fx .table tbody tr:hover { background: linear-gradient(90deg, rgba(251, 191, 36, .09), rgba(251, 191, 36, .02) 60%, transparent); }
html.fx .table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
html.fx .row-overdue { background: linear-gradient(90deg, rgba(224, 54, 74, .2), rgba(224, 54, 74, .05) 70%, transparent); }
html.fx .row-overdue:hover { background: linear-gradient(90deg, rgba(224, 54, 74, .3), rgba(224, 54, 74, .08) 70%, transparent); }
html.fx .row-overdue td:first-child { box-shadow: inset 3px 0 0 #ff5468, 8px 0 24px -10px rgba(255, 84, 104, .6); }

/* ---- pills / badges: soft gradient, hairline ring and a glowing status dot ---- */
html.fx .badge, html.fx .stock, html.fx .tag { font-family: var(--fx-mono); font-weight: 600; letter-spacing: .05em; }
html.fx .badge { background-image: linear-gradient(135deg, rgba(255, 255, 255, .09), transparent);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 255, .22); padding: 3px 11px 3px 9px; }
html.fx .badge::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; vertical-align: 1px;
  background: currentColor; box-shadow: 0 0 8px currentColor; }
@supports (color: color-mix(in srgb, red, blue)) {
  html.fx .badge { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 38%, transparent); }
}
html.fx .pill { box-shadow: 0 0 20px -8px var(--crimson-glow); }

/* ---- buttons ---- */
html.fx .btn { background: var(--surface); border-color: var(--border); }
html.fx .btn:hover { background: var(--hover); border-color: var(--gold); box-shadow: 0 0 18px -6px rgba(251, 191, 36, .55); transform: translateY(-1px); }
html.fx .btn-primary { background: linear-gradient(135deg, #d12a3a, #8f1422); border-color: rgba(255, 120, 135, .45); color: #fff; box-shadow: 0 0 26px -6px var(--crimson-glow); }
html.fx .btn-primary:hover { background: linear-gradient(135deg, #e63a4b, #a3182a); border-color: rgba(255, 150, 160, .8); box-shadow: 0 0 34px -4px rgba(224, 54, 74, .85); }
html.fx .btn-ghost { background: transparent; border-color: transparent; }
html.fx .btn:focus-visible, html.fx a:focus-visible, html.fx .theme-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---- form fields ---- */
html.fx input[type=text], html.fx input[type=email], html.fx input[type=password], html.fx input[type=tel], html.fx input[type=search],
html.fx input[type=number], html.fx input[type=date], html.fx input[type=time], html.fx select, html.fx textarea {
  background: var(--surface-2); border-color: var(--border); }
html.fx input:focus, html.fx select:focus, html.fx textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(251, 191, 36, .16), 0 0 22px -6px rgba(251, 191, 36, .45); }
html.fx input:disabled { background: rgba(6, 10, 24, .8); }
html.fx .form label, html.fx legend { font-family: var(--fx-mono); letter-spacing: .08em; font-size: .68rem; }
html.fx .form label .hint, html.fx .form label .optional, html.fx .form .hint { font-family: inherit; }
html.fx fieldset { border-color: var(--border); }
html.fx select option { background: #0b1124; color: var(--text); }

/* ---- ticket page ---- */
html.fx .comment { background: var(--surface-2); border-color: var(--border); }
html.fx .comment.by-staff { background: linear-gradient(90deg, rgba(224, 54, 74, .1), var(--surface-2) 45%); border-left-color: var(--maroon); box-shadow: -10px 0 26px -16px var(--crimson-glow); }
html.fx .comment.internal { border-left-color: var(--gold); box-shadow: -10px 0 26px -16px rgba(251, 191, 36, .5); }
html.fx .kv dt { font-family: var(--fx-mono); letter-spacing: .09em; }
html.fx .timeline { border-left: 2px solid transparent; border-image: linear-gradient(180deg, var(--maroon), var(--gold) 55%, transparent) 1; }
html.fx .timeline li::before { background: var(--gold); box-shadow: 0 0 0 3px #0b1124, 0 0 14px rgba(251, 191, 36, .75); }
html.fx .notice { background: var(--surface-2); border-color: var(--border); }
html.fx .reply-form { border-top-color: var(--border); }
html.fx details > summary::after { color: var(--gold); }

/* ---- subnav, flashes, idle prompt, reports ---- */
html.fx .subnav a { background: var(--surface); border-color: var(--border); font-family: var(--fx-display); }
html.fx .subnav a:hover { border-color: var(--gold); box-shadow: 0 0 16px -6px rgba(251, 191, 36, .5); }
html.fx .subnav a.active { background: linear-gradient(135deg, #d12a3a, #8f1422); border-color: rgba(255, 120, 135, .45); box-shadow: 0 0 22px -6px var(--crimson-glow); }
html.fx .flash { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
html.fx .bar, html.fx .hb-fill { background: linear-gradient(180deg, var(--gold), var(--maroon)); box-shadow: 0 0 14px -2px var(--crimson-glow); }
html.fx .hb-fill { background: linear-gradient(90deg, var(--maroon), var(--gold)); }

/* ---- motion: only for people who have not asked for less ---- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fx-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes fx-pulse { 0%, 100% { box-shadow: var(--shadow), 0 0 0 0 rgba(224, 54, 74, .0); } 50% { box-shadow: var(--shadow), 0 0 28px -4px rgba(224, 54, 74, .55); } }
  html.fx .stat { animation: fx-rise .5s cubic-bezier(.2, .7, .2, 1) both; }
  html.fx .stat:nth-child(2) { animation-delay: .05s; } html.fx .stat:nth-child(3) { animation-delay: .1s; }
  html.fx .stat:nth-child(4) { animation-delay: .15s; } html.fx .stat:nth-child(5) { animation-delay: .2s; }
  html.fx .stat:nth-child(6) { animation-delay: .25s; } html.fx .stat:nth-child(7) { animation-delay: .3s; }
  html.fx .stat:nth-child(n+8) { animation-delay: .35s; }
  html.fx .stat-alert { animation: fx-rise .5s cubic-bezier(.2, .7, .2, 1) both, fx-pulse 3.2s ease-in-out .8s infinite; }
  html.fx .card { animation: fx-rise .55s cubic-bezier(.2, .7, .2, 1) both; }
  html.fx .table tbody tr:nth-child(-n+12) { animation: fx-rise .4s ease-out both; }
  html.fx .badge::before { animation: fx-dot 2.6s ease-in-out infinite; }
  @keyframes fx-dot { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
}
@media (prefers-reduced-motion: reduce) { html.fx *, html.fx *::before, html.fx *::after { animation: none !important; transition: none !important; } }

/* ---- small screens: lighter effects, same look ---- */
@media (max-width: 640px) {
  html.fx .card, html.fx .stat, html.fx .item, html.fx .comment { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(16, 23, 46, .9); }
  html.fx body::before { background-size: 32px 32px; }
}
