:root {
    --ep-primary: #4f46e5;
    --ep-primary-dark: #3730a3;
    --ep-primary-soft: #eef2ff;
    --ep-ink: #172033;
    --ep-muted: #667085;
    --ep-canvas: #f4f6fb;
    --ep-surface: #ffffff;
    --ep-border: #e6e9f0;
    --ep-radius: 1rem;
    --ep-shadow: 0 14px 35px rgba(31, 42, 68, .07);
}

body.admin-body, body.admin-login-body, body.platform-body {
    background: radial-gradient(circle at 12% 0, #ffffff 0, var(--ep-canvas) 38%, #eef1f8 100%);
    color: var(--ep-ink);
    min-height: 100vh;
}

.admin-topbar {
    min-height: 68px;
    background: rgba(255, 255, 255, .9);
    border-bottom: 1px solid rgba(230, 233, 240, .9);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.admin-brand { color: var(--ep-ink); text-decoration: none; }
.admin-brand:hover { color: var(--ep-primary); }
.admin-brand-mark {
    align-items: center;
    background: linear-gradient(135deg, var(--ep-primary), #7c3aed);
    border-radius: .8rem;
    box-shadow: 0 8px 20px rgba(79, 70, 229, .24);
    color: #fff;
    display: inline-flex;
    font-size: .82rem;
    font-weight: 800;
    height: 2.35rem;
    justify-content: center;
    letter-spacing: -.02em;
    width: 2.35rem;
}

.admin-brand-copy { line-height: 1.05; }
.admin-brand-copy small { color: var(--ep-muted); display: block; font-size: .68rem; font-weight: 600; letter-spacing: .08em; margin-top: .22rem; text-transform: uppercase; }
.admin-tenant-pill { background: var(--ep-primary-soft); border: 1px solid #dfe3ff; border-radius: 999px; color: var(--ep-primary-dark); font-size: .82rem; font-weight: 600; max-width: 300px; overflow: hidden; padding: .42rem .75rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-copy { color: var(--ep-muted); font-size: .78rem; line-height: 1.1; text-align: right; }
.admin-user-copy strong { color: var(--ep-ink); display: block; font-size: .86rem; }

.admin-layout { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.admin-sidebar { background: rgba(255, 255, 255, .76); border-right: 1px solid var(--ep-border); min-width: 0; padding: 1.25rem 1rem; }
.admin-sidebar-inner { position: sticky; top: 88px; }
.admin-sidebar-label { color: #98a2b3; font-size: .68rem; font-weight: 800; letter-spacing: .11em; margin: 0 .75rem .65rem; text-transform: uppercase; }
.admin-sidebar .nav-link {
    align-items: center;
    border-radius: .78rem;
    color: #475467;
    display: flex;
    font-size: .9rem;
    font-weight: 600;
    gap: .68rem;
    padding: .58rem .72rem;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
.admin-sidebar .nav-link::before { background: #d0d5dd; border-radius: 999px; content: ''; flex: 0 0 auto; height: .42rem; width: .42rem; }
.admin-sidebar .nav-link:hover { background: #f3f4f8; color: var(--ep-ink); transform: translateX(2px); }
.admin-sidebar .nav-link.active { background: linear-gradient(135deg, var(--ep-primary), #6558e8); box-shadow: 0 9px 22px rgba(79, 70, 229, .2); color: #fff; }
.admin-sidebar .nav-link.active::before { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .18); }
.admin-main { min-width: 0; padding: clamp(1rem, 2.3vw, 2rem); }
.admin-content { margin: 0 auto; max-width: 1540px; }

.admin-main h1, .platform-main h1 { font-weight: 750; letter-spacing: -.025em; }
.admin-main h2, .platform-main h2 { letter-spacing: -.012em; }
.admin-main .card, .platform-main .card {
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(230, 233, 240, .85) !important;
    border-radius: var(--ep-radius);
    box-shadow: var(--ep-shadow) !important;
    overflow: hidden;
}
.admin-main .card-body, .platform-main .card-body { padding: clamp(1rem, 2vw, 1.4rem); }
.admin-main .form-control, .admin-main .form-select, .platform-main .form-control, .platform-main .form-select, .admin-login-card .form-control {
    border-color: #dfe3ea;
    border-radius: .72rem;
    min-height: 2.65rem;
}
.admin-main .form-control:focus, .admin-main .form-select:focus, .platform-main .form-control:focus, .platform-main .form-select:focus, .admin-login-card .form-control:focus {
    border-color: #8f88ee;
    box-shadow: 0 0 0 .22rem rgba(79, 70, 229, .12);
}
.admin-main .form-label, .platform-main .form-label, .admin-login-card .form-label { color: #344054; font-size: .84rem; font-weight: 650; }
.admin-main .btn, .platform-main .btn, .admin-topbar .btn, .admin-login-card .btn { border-radius: .7rem; font-weight: 650; }
.btn-primary { --bs-btn-bg: var(--ep-primary); --bs-btn-border-color: var(--ep-primary); --bs-btn-hover-bg: var(--ep-primary-dark); --bs-btn-hover-border-color: var(--ep-primary-dark); }
.admin-main .table, .platform-main .table { --bs-table-bg: transparent; margin-bottom: 0; }
.admin-main .table thead th, .platform-main .table thead th { border-bottom-color: var(--ep-border); color: #7b8495; font-size: .7rem; font-weight: 800; letter-spacing: .075em; padding-block: .78rem; text-transform: uppercase; white-space: nowrap; }
.admin-main .table tbody td, .platform-main .table tbody td { border-bottom-color: #edf0f5; padding-block: .78rem; }
.admin-main .table tbody tr, .platform-main .table tbody tr { transition: background-color .15s ease; }
.admin-main .table tbody tr:hover, .platform-main .table tbody tr:hover { background: rgba(79, 70, 229, .025); }
.admin-main .badge, .platform-main .badge { border-radius: 999px; font-weight: 700; letter-spacing: .01em; padding: .38rem .62rem; }
.admin-main .alert, .platform-main .alert { border: 0; border-radius: .85rem; box-shadow: 0 8px 20px rgba(31, 42, 68, .05); }
.admin-main .pagination { --bs-pagination-border-radius: .65rem; --bs-pagination-color: var(--ep-primary); }
.admin-main .text-secondary, .platform-main .text-secondary { color: var(--ep-muted) !important; }
.admin-main tbody tr:last-child td, .platform-main tbody tr:last-child td { border-bottom: 0; }

.admin-login-body { position: relative; }
.admin-login-body::before, .admin-login-body::after { border-radius: 999px; content: ''; filter: blur(1px); pointer-events: none; position: fixed; }
.admin-login-body::before { background: rgba(79, 70, 229, .14); height: 28rem; left: -12rem; top: -12rem; width: 28rem; }
.admin-login-body::after { background: rgba(14, 165, 233, .11); bottom: -13rem; height: 32rem; right: -13rem; width: 32rem; }
.admin-login-card { background: rgba(255, 255, 255, .9); border: 1px solid rgba(255, 255, 255, .8); border-radius: 1.35rem; box-shadow: 0 24px 65px rgba(31, 42, 68, .13); overflow: hidden; position: relative; width: min(100%, 440px); z-index: 1; }
.admin-login-eyebrow { color: var(--ep-primary); font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.admin-login-card .btn-primary { box-shadow: 0 10px 24px rgba(79, 70, 229, .2); min-height: 2.75rem; }

.platform-main { margin: 0 auto; max-width: 1540px; padding: clamp(1rem, 2.3vw, 2rem); }

.dashboard-page { padding-bottom: 1rem; }
.dashboard-hero { align-items: center; display: flex; justify-content: space-between; margin-bottom: 1.5rem; }
.dashboard-hero h1 { font-size: clamp(1.65rem, 2.5vw, 2.15rem); }
.dashboard-eyebrow { color: var(--ep-primary); font-size: .67rem; font-weight: 800; letter-spacing: .115em; margin-bottom: .3rem; text-transform: uppercase; }
.dashboard-live { align-items: center; background: #ecfdf3; border: 1px solid #d1fadf; border-radius: 999px; color: #027a48; display: inline-flex; font-size: .76rem; font-weight: 750; gap: .48rem; padding: .45rem .7rem; white-space: nowrap; }
.dashboard-live span { background: #12b76a; border-radius: 999px; box-shadow: 0 0 0 4px rgba(18, 183, 106, .13); height: .48rem; width: .48rem; }

.dashboard-metric { background: rgba(255, 255, 255, .96); border: 1px solid var(--ep-border); border-radius: var(--ep-radius); box-shadow: var(--ep-shadow); min-height: 154px; overflow: hidden; padding: 1.15rem; position: relative; }
.dashboard-metric::after { background: var(--metric-color, var(--ep-primary)); border-radius: 999px; bottom: -3.8rem; content: ''; filter: blur(1px); height: 7rem; opacity: .07; position: absolute; right: -2.8rem; width: 7rem; }
.dashboard-metric-primary { --metric-color: #4f46e5; }
.dashboard-metric-info { --metric-color: #0ea5e9; }
.dashboard-metric-success { --metric-color: #12b76a; }
.dashboard-metric-warning { --metric-color: #f79009; }
.dashboard-metric-violet { --metric-color: #9333ea; }
.dashboard-metric-icon { align-items: center; background: color-mix(in srgb, var(--metric-color) 11%, white); border-radius: .66rem; color: var(--metric-color); display: flex; font-size: .92rem; font-weight: 850; height: 2rem; justify-content: center; margin-bottom: .8rem; width: 2rem; }
.dashboard-metric-label { color: var(--ep-muted); font-size: .78rem; font-weight: 650; }
.dashboard-metric-value { color: var(--ep-ink); font-size: clamp(1.35rem, 2.1vw, 1.75rem); font-weight: 780; letter-spacing: -.035em; line-height: 1.2; margin-top: .16rem; overflow-wrap: anywhere; }
.dashboard-metric-meta { color: #98a2b3; font-size: .7rem; margin-top: .32rem; }

.dashboard-section-head { align-items: center; display: flex; gap: 1rem; justify-content: space-between; margin-bottom: 1.25rem; }
.dashboard-text-link { color: var(--ep-primary); font-size: .76rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.dashboard-text-link:hover { color: var(--ep-primary-dark); }
.dashboard-chart { align-items: end; display: grid; gap: clamp(.5rem, 2vw, 1.15rem); grid-template-columns: repeat(7, minmax(0, 1fr)); height: 224px; padding-top: 1rem; }
.dashboard-chart-column { align-items: center; display: grid; grid-template-rows: 1.2rem minmax(0, 1fr) 1.2rem; height: 100%; min-width: 0; text-align: center; }
.dashboard-chart-value { color: #7b8495; font-size: .65rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.dashboard-chart-track { align-items: end; background: linear-gradient(180deg, #f6f7fb, #eef0f7); border-radius: .55rem .55rem .25rem .25rem; display: flex; height: 100%; overflow: hidden; width: 100%; }
.dashboard-chart-bar { background: linear-gradient(180deg, #7770ee, var(--ep-primary)); border-radius: .55rem .55rem .2rem .2rem; box-shadow: 0 -6px 18px rgba(79, 70, 229, .16); min-height: 4px; transition: height .25s ease; width: 100%; }
.dashboard-chart-label { color: #667085; font-size: .7rem; font-weight: 700; padding-top: .35rem; }

.dashboard-actions { display: grid; gap: .6rem; }
.dashboard-actions > a { align-items: center; border: 1px solid #edf0f5; border-radius: .85rem; color: var(--ep-ink); display: grid; gap: .7rem; grid-template-columns: auto minmax(0, 1fr) auto; padding: .72rem; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.dashboard-actions > a:hover { border-color: #d9ddf9; box-shadow: 0 8px 20px rgba(31, 42, 68, .06); transform: translateY(-1px); }
.dashboard-actions strong { display: block; font-size: .8rem; }
.dashboard-actions small { color: var(--ep-muted); display: block; font-size: .68rem; margin-top: .12rem; }
.dashboard-actions b { color: #98a2b3; font-size: .9rem; }
.dashboard-action-icon { align-items: center; background: var(--ep-primary-soft); border-radius: .62rem; color: var(--ep-primary); display: flex; font-size: .72rem; font-weight: 850; height: 2.05rem; justify-content: center; width: 2.05rem; }
.dashboard-action-icon-blue { background: #eaf8ff; color: #0284c7; }
.dashboard-action-icon-green { background: #ecfdf3; color: #039855; }
.dashboard-action-icon-amber { background: #fffaeb; color: #dc6803; }

.dashboard-spark-list { display: grid; gap: .68rem; }
.dashboard-spark-row { align-items: center; display: grid; gap: .65rem; grid-template-columns: 2rem minmax(0, 1fr) 2rem; }
.dashboard-spark-row > span, .dashboard-spark-row > strong { color: #667085; font-size: .7rem; }
.dashboard-spark-row > strong { text-align: right; }
.dashboard-spark-track { background: #f0f2f7; border-radius: 999px; height: .52rem; overflow: hidden; }
.dashboard-spark-track i { background: linear-gradient(90deg, #14b8a6, #12b76a); border-radius: inherit; display: block; height: 100%; min-width: 2px; }
.dashboard-legend { color: #98a2b3; font-size: .67rem; margin-top: 1rem; }
.dashboard-legend i { background: #12b76a; border-radius: 999px; display: inline-block; height: .42rem; margin-right: .35rem; width: .42rem; }

.dashboard-event { align-items: center; background: linear-gradient(135deg, #f8f8ff, #f5f8ff); border: 1px solid #e6e7fb; border-radius: .95rem; display: flex; gap: 1rem; min-height: 142px; padding: 1.15rem; }
.dashboard-event-date { align-items: center; background: #fff; border: 1px solid #e1e4ef; border-radius: .8rem; box-shadow: 0 8px 18px rgba(31, 42, 68, .06); display: flex; flex: 0 0 auto; flex-direction: column; height: 4.5rem; justify-content: center; width: 4.5rem; }
.dashboard-event-date span { color: var(--ep-primary); font-size: .63rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-event-date strong { font-size: 1.55rem; line-height: 1.1; }
.dashboard-event h3 { font-size: 1.05rem; font-weight: 750; margin-bottom: .28rem; }
.dashboard-event p { color: var(--ep-muted); font-size: .76rem; margin: 0; }

.dashboard-empty { align-items: center; color: var(--ep-muted); display: flex; flex-direction: column; justify-content: center; min-height: 150px; padding: 1.2rem; text-align: center; }
.dashboard-empty > span { align-items: center; background: var(--ep-primary-soft); border-radius: 999px; color: var(--ep-primary); display: flex; font-size: 1rem; height: 2.5rem; justify-content: center; margin-bottom: .65rem; width: 2.5rem; }
.dashboard-empty strong { color: #344054; font-size: .84rem; }
.dashboard-empty p { font-size: .72rem; margin: .25rem 0 0; max-width: 340px; }
.dashboard-empty-inline { flex-direction: row; gap: .8rem; min-height: 142px; text-align: left; }
.dashboard-empty-inline > span { flex: 0 0 auto; margin: 0; }
.dashboard-orders td { font-size: .78rem; }
.dashboard-orders td:first-child small { color: #98a2b3; display: block; font-size: .65rem; margin-top: .14rem; }
.dashboard-status { background: #f2f4f7; border-radius: 999px; color: #475467; display: inline-block; font-size: .66rem; font-weight: 750; padding: .33rem .55rem; }
.dashboard-status-success { background: #ecfdf3; color: #027a48; }
.dashboard-status-pending { background: #fffaeb; color: #b54708; }

@media (max-width: 991.98px) {
    .admin-layout { display: block; min-height: 0; }
    .admin-sidebar { border-bottom: 1px solid var(--ep-border); border-right: 0; padding: .7rem 1rem; }
    .admin-sidebar-inner { position: static; }
    .admin-sidebar-label { display: none; }
    .admin-sidebar .nav { flex-direction: row !important; flex-wrap: nowrap; gap: .4rem !important; overflow-x: auto; padding: .1rem 0 .45rem; scrollbar-width: thin; }
    .admin-sidebar .nav-link { flex: 0 0 auto; padding: .5rem .72rem; }
    .admin-sidebar .nav-link:hover { transform: none; }
}

@media (max-width: 575.98px) {
    .admin-topbar { min-height: 60px; }
    .admin-brand-copy small, .admin-user-copy, .admin-tenant-pill { display: none; }
    .admin-brand-mark { border-radius: .65rem; height: 2rem; width: 2rem; }
    .admin-main { padding: .9rem; }
    .admin-main .card-body { padding: 1rem; }
    .admin-main h1 { font-size: 1.55rem; }
    .dashboard-hero { align-items: flex-start; }
    .dashboard-live { font-size: 0; padding: .55rem; }
    .dashboard-live span { margin: 0; }
    .dashboard-metric { min-height: 142px; }
    .dashboard-chart { gap: .35rem; height: 190px; }
    .dashboard-chart-value { display: none; }
    .dashboard-chart-column { grid-template-rows: minmax(0, 1fr) 1.2rem; }
    .dashboard-section-head { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
