/* ============================================================
   EventFlow Pro · "Signal" theme (global overlay)
   Works on top of the Tailwind CDN runtime build.

   Design language: architectural precision over generic glass.
   - Solid, crisp surfaces with 1px hairlines (no translucent blur)
   - Deep-ink side rail with a brand "signal bar" on the active item
   - Fine blueprint grid background, one restrained brand glow
   - 2px brand "signal line" on the top edge of headers
   - Editorial micro-labels + tabular numerals
   Selectors deliberately mirror common view class combos so the
   whole app upgrades without touching every template.
   ============================================================ */

/* ---------- Base canvas: crisp paper + blueprint grid ---------- */

body {
    background-color: #f4f5f7;
    color: #1c2b36;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(30rem 22rem at 88% -6%, rgba(169, 15, 3, .055), transparent 62%),
        linear-gradient(to right, rgba(13, 31, 42, .03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(13, 31, 42, .03) 1px, transparent 1px);
    background-size: auto, 26px 26px, 26px 26px;
    background-position: 0 0, 0 0, 0 0;
}

body::after {
    content: "";
    position: fixed;
    z-index: -1;
    pointer-events: none;
    top: -6rem;
    left: -5rem;
    width: 22rem;
    height: 22rem;
    border-radius: 9999px;
    border: 1px solid rgba(169, 15, 3, .10);
    background:
        radial-gradient(circle, rgba(169, 15, 3, .12), transparent 68%);
    filter: blur(34px);
    opacity: .9;
}

/* ---------- Dark canvas (admin / scanner) ---------- */

body.theme-dark {
    background-color: #0b1120;
    color: #dbe4ec;
}

body.theme-dark::before {
    background-image:
        radial-gradient(30rem 22rem at 88% -6%, rgba(214, 66, 54, .10), transparent 62%),
        linear-gradient(to right, rgba(255, 255, 255, .028) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .028) 1px, transparent 1px);
    background-size: auto, 26px 26px, 26px 26px;
}

body.theme-dark::after {
    background: radial-gradient(circle, rgba(169, 15, 3, .16), transparent 68%);
    border-color: rgba(214, 66, 54, .14);
}

/* ---------- Signature: deep-ink side rail ---------- */

.rail {
    background-color: #0d1f2a !important;
    border-right: 1px solid rgba(255, 255, 255, .06) !important;
}

body.theme-dark .rail {
    background-color: #0a1a24 !important;
}

.rail-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem .5rem .8rem;
}

.rail-brand .mark {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: .55rem;
    background: linear-gradient(135deg, #e03a2d, #8a0c02);
    box-shadow: 0 4px 12px rgba(169, 15, 3, .35), inset 0 1px 0 rgba(255, 255, 255, .22);
    font-weight: 800;
    font-size: .9rem;
    color: #fff;
}

.rail-brand .name {
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: #0d1f2a;
    line-height: 1.1;
}

.rail .rail-brand .name,
body.theme-dark .rail-brand .name,
.rail-brand.on-ink .name {
    color: #fff;
}

.rail-brand .sub {
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(159, 176, 189, .85);
}

.rail-nav {
    display: flex;
    flex-direction: column;
    gap: .125rem;
}

.rail-label {
    padding: 1rem .85rem .4rem;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(159, 176, 189, .55);
}

.rail-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .85rem;
    border-radius: .6rem;
    font-size: .865rem;
    font-weight: 500;
    color: #9fb0bd;
    transition: background-color .15s ease, color .15s ease;
}

.rail-link svg {
    flex-shrink: 0;
}

.rail-link:hover {
    background-color: rgba(255, 255, 255, .05);
    color: #ffffff;
}

.rail-link.active {
    background-color: rgba(255, 255, 255, .08);
    color: #ffffff;
    font-weight: 600;
}

.rail-link.active::before {
    content: "";
    position: absolute;
    left: -.8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 1.35rem;
    border-radius: 9999px;
    background: linear-gradient(180deg, #e03a2d, #a90f03);
    box-shadow: 0 0 10px rgba(214, 66, 54, .5);
}

.rail-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, .06);
    padding-top: .75rem;
}

.rail-footer .rail-link { font-size: .83rem; }

/* ---------- Signature: 2px brand signal line on headers ---------- */

.topbar {
    position: relative;
}

.topbar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #8a0c02 0%, #a90f03 42%, #d64236 78%, rgba(214, 66, 54, .15) 100%);
}

/* ---------- Crisp elevated surfaces (replaces glass) ---------- */

.glass,
.glass-heavy {
    background: #ffffff !important;
    border: 1px solid #d6dbe2 !important;
    box-shadow: 0 2px 4px rgba(13, 31, 42, .08), 0 18px 40px -14px rgba(13, 31, 42, .28) !important;
    opacity: 1;
}

.glass-dark {
    background: #101f2c !important;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .6) !important;
    opacity: 1;
}

.text-gradient {
    background-image: linear-gradient(115deg, #e03a2d 0%, #a90f03 55%, #7c0b02 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Core card panels (light) ---------- */

.rounded-xl.border-slate-200.bg-white,
.rounded-2xl.border-slate-200.bg-white {
    background: #ffffff !important;
    border: 1px solid #e3e6eb !important;
    box-shadow: 0 1px 2px rgba(13, 31, 42, .04), 0 10px 28px -14px rgba(13, 31, 42, .14) !important;
    border-radius: 14px;
}

.rounded-xl.border-slate-200.bg-white p,
.rounded-xl.border-slate-200.bg-white h1,
.rounded-xl.border-slate-200.bg-white h2,
.rounded-xl.border-slate-200.bg-white h3,
.rounded-xl.border-slate-200.bg-white td,
.rounded-xl.border-slate-200.bg-white th,
.rounded-2xl.border-slate-200.bg-white p,
.rounded-2xl.border-slate-200.bg-white h1,
.rounded-2xl.border-slate-200.bg-white h2,
.rounded-2xl.border-slate-200.bg-white h3 {
    color: #1c2b36;
}

/* Distinctive card heading treatment: small brand tick + tight display type */
.rounded-xl.border-slate-200.bg-white h1,
.rounded-xl.border-slate-200.bg-white h2,
.rounded-2xl.border-slate-200.bg-white h1,
.rounded-2xl.border-slate-200.bg-white h2 {
    font-family: 'Poppins', system-ui, sans-serif;
    letter-spacing: -.02em;
    font-weight: 800;
}

/* ---------- Dark card panels (admin) ---------- */

body.theme-dark .rounded-xl.border-slate-800.bg-slate-900 {
    background: #101f2c !important;
    border: 1px solid rgba(255, 255, 255, .07) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 12px 30px -14px rgba(0, 0, 0, .5) !important;
    border-radius: 14px;
}

/* ---------- Tables: hairline dividers + editorial header labels ---------- */

.rounded-xl.border-slate-200.bg-white th,
.rounded-2xl.border-slate-200.bg-white th {
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #7c8a97;
}

.rounded-xl.border-slate-200.bg-white table tbody tr,
body.theme-dark .rounded-xl.border-slate-800.bg-slate-900 table tbody tr {
    border-top: 1px solid #eceef1;
}

body.theme-dark .rounded-xl.border-slate-800.bg-slate-900 table tbody tr {
    border-top-color: rgba(255, 255, 255, .06);
}

.rounded-xl.border-slate-200.bg-white table tbody tr:hover,
body.theme-dark .rounded-xl.border-slate-800.bg-slate-900 table tbody tr:hover {
    background-color: rgba(169, 15, 3, .03);
}

body.theme-dark .hover\:bg-slate-800\/50:hover { background-color: rgba(30, 41, 59, .6); }

/* ---------- Inputs & selects: crisp paper fields ---------- */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="url"],
input[type="tel"],
input[type="search"],
select,
textarea {
    background-color: #ffffff !important;
    border: 1px solid #d5dae1 !important;
    border-radius: .55rem;
    box-shadow: inset 0 1px 2px rgba(13, 31, 42, .03);
    transition: border-color .15s ease, box-shadow .15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    border-color: #a90f03 !important;
    box-shadow: 0 0 0 3px rgba(169, 15, 3, .12) !important;
}

body.theme-dark input[type="text"],
body.theme-dark input[type="email"],
body.theme-dark input[type="password"],
body.theme-dark input[type="number"],
body.theme-dark input[type="date"],
body.theme-dark input[type="time"],
body.theme-dark input[type="datetime-local"],
body.theme-dark input[type="url"],
body.theme-dark input[type="tel"],
body.theme-dark input[type="search"],
body.theme-dark select,
body.theme-dark textarea {
    background-color: #0e1c29 !important;
    border-color: rgba(255, 255, 255, .12) !important;
    color: #dbe4ec;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
}

body.theme-dark input[type="text"]:focus,
body.theme-dark input[type="email"]:focus,
body.theme-dark input[type="password"]:focus,
body.theme-dark input[type="number"]:focus,
body.theme-dark input[type="date"]:focus,
body.theme-dark input[type="time"]:focus,
body.theme-dark input[type="datetime-local"]:focus,
body.theme-dark input[type="url"]:focus,
body.theme-dark input[type="tel"]:focus,
body.theme-dark input[type="search"]:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus {
    border-color: #d64236 !important;
    box-shadow: 0 0 0 3px rgba(214, 66, 54, .16) !important;
}

/* ---------- Primary brand buttons: crafted "hard-key" depth ---------- */

.bg-brand-600 {
    background-image: linear-gradient(180deg, #c41505 0%, #a90f03 55%, #930d02 100%) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 2px 3px rgba(13, 31, 42, .18), 0 10px 18px -8px rgba(169, 15, 3, .45) !important;
    border-radius: .6rem;
}

.bg-brand-600:hover {
    background-image: linear-gradient(180deg, #d71a08 0%, #b51205 60%, #9e0e02 100%) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .24) inset, 0 3px 6px rgba(13, 31, 42, .2), 0 14px 24px -10px rgba(169, 15, 3, .55) !important;
}

/* ---------- Soft surfaces & badges: crisp tints ---------- */

.rounded-lg.bg-slate-50,
.rounded-xl.bg-slate-50 {
    background-color: #f1f3f5 !important;
    border: 1px solid #e7eaee;
}

.rounded-lg.bg-brand-50,
.rounded-xl.bg-brand-50 {
    background: linear-gradient(135deg, #fbe9e6, #fdf2f0) !important;
    border: 1px solid rgba(169, 15, 3, .14);
}

.rounded-full.bg-brand-50 {
    background: linear-gradient(135deg, #fbe9e6, #fdf2f0) !important;
}

.rounded-full.bg-slate-100 {
    background-color: #eef0f3 !important;
}

/* ---------- Flash messages: crisp semantic tints ---------- */

.border-green-200.bg-green-50 {
    background: #f0faf2 !important;
    border-color: #bfe6c8 !important;
}

.border-red-200.bg-red-50 {
    background: #fdf1f1 !important;
    border-color: #f3c1c1 !important;
}

.border-amber-200.bg-amber-50 {
    background: #fdf8ec !important;
    border-color: #f2ddb0 !important;
}

.border-blue-200.bg-blue-50 {
    background: #f0f6fd !important;
    border-color: #bfd9f2 !important;
}

body.theme-dark .border-green-700\/40.bg-green-900\/30,
body.theme-dark .border-red-700\/40.bg-red-900\/30,
body.theme-dark .border-amber-700\/40.bg-amber-900\/30,
body.theme-dark .border-blue-700\/40.bg-blue-900\/30 {
    background: #10202e !important;
    border-color: rgba(255, 255, 255, .08) !important;
}

/* ---------- Editorial micro-labels ---------- */

.micro-label {
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #8b99a6;
}

/* ---------- Tabular numerals for stats & prices ---------- */

.stat-num,
.price-fig {
    font-family: 'Poppins', system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

/* ---------- Premium scrollbars ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, .32);
    border-radius: 9999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, .5); background-clip: padding-box; }

::selection { background: rgba(169, 15, 3, .16); }

/* ---------- Font smoothing for premium text ---------- */

.font-display { font-family: 'Poppins', system-ui, sans-serif; letter-spacing: -0.02em; }
