* { box-sizing: border-box; }

:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #171717;
    background: #F7F7F3;
    --yellow: #F4C430;
    --yellow-dark: #D7A800;
    --yellow-soft: #FFF7D7;
    --black: #111111;
    --muted: #6F716F;
    --border: #E5E5DE;
    --surface: #FFFFFF;
    --danger: #B42318;
    --shadow: 0 18px 50px rgba(17,17,17,.07);
}

body { margin: 0; background: #F7F7F3; color: #171717; }
a { color: inherit; }
h1,h2,h3,p { margin-top: 0; }
h1 { font-size: clamp(30px,4vw,44px); line-height: 1.04; letter-spacing: -.035em; margin-bottom: 9px; }
h2 { font-size: 23px; line-height: 1.15; letter-spacing: -.02em; margin-bottom: 8px; }
button,input,select { font: inherit; }
.muted { color: var(--muted); }
.eyebrow { color: #806500; font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 9px; }
.eyebrow-light { color: #E7C959; }
.field-error { color: var(--danger); font-size: 13px; font-weight: 700; }
.help-text { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.45; }

.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup-large .brand-logo { width: 54px; height: 54px; }
.brand-logo { width: 42px; height: 42px; display: block; }
.brand-name { font-weight: 900; font-size: 20px; letter-spacing: -.02em; }
.brand-caption { color: rgba(255,255,255,.58); font-size: 12px; margin-top: 2px; }

.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.08fr) minmax(430px,.92fr); background: #fff; }
.auth-brand-panel { min-width: 0; padding: 54px clamp(34px,6vw,86px); display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: radial-gradient(circle at 80% 20%,rgba(244,196,48,.18),transparent 28%),linear-gradient(145deg,#111 0%,#171717 62%,#221D09 100%); }
.admin-brand-panel { background: radial-gradient(circle at 20% 80%,rgba(244,196,48,.16),transparent 30%),linear-gradient(145deg,#111 0%,#171717 64%,#211D0D 100%); }
.auth-brand-copy { max-width: 650px; margin: 80px 0; }
.auth-brand-copy h1 { font-size: clamp(40px,6vw,72px); max-width: 760px; }
.auth-brand-copy p:not(.eyebrow) { max-width: 560px; color: #BDBDB7; font-size: 17px; line-height: 1.7; }
.trust-row { display: flex; flex-wrap: wrap; gap: 12px; }
.trust-row span { padding: 8px 11px; border: 1px solid #353535; border-radius: 999px; color: #C8C8C3; font-size: 12px; }
.auth-form-panel { display: grid; place-items: center; padding: 40px; background: radial-gradient(circle at top right,rgba(244,196,48,.14),transparent 32%),#F7F7F3; }
.auth-card { width: min(100%,460px); background: rgba(255,255,255,.97); border: 1px solid var(--border); border-radius: 22px; padding: 38px; box-shadow: var(--shadow); }
.auth-intro { margin-bottom: 25px; line-height: 1.55; }
.mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 25px; }
.auth-footer { margin-top: 22px; padding-top: 18px; border-top: 1px solid #ECECE6; display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--muted); font-size: 12px; }
.subtle-link { color: #695300; font-weight: 800; text-decoration: none; }

.form-stack { display: grid; gap: 16px; }
label { display: grid; gap: 8px; font-weight: 750; font-size: 14px; }
input[type="text"],input[type="password"],input[type="email"],input[type="number"],input[type="file"],select { width: 100%; min-height: 46px; border: 1px solid #D9D9D2; border-radius: 11px; padding: 11px 13px; background: #fff; color: #171717; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--yellow); }
input:focus,select:focus,button:focus,a:focus { outline: 3px solid rgba(244,196,48,.34); outline-offset: 2px; }
.button { min-height: 43px; border: 0; border-radius: 10px; padding: 11px 17px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 850; cursor: pointer; transition: transform .18s ease,background .18s ease,border-color .18s ease; }
.button-primary { background: var(--yellow); color: #111; box-shadow: 0 9px 22px rgba(244,196,48,.22); }
.button-primary:hover { background: var(--yellow-dark); transform: translateY(-1px); }
.button-secondary { background: #EEEEEA; color: #1D1D1D; }
.button-dark-outline { width: 100%; border: 1px solid #444; background: transparent; color: #fff; }
.button-dark-outline:hover { border-color: var(--yellow); }
.full { width: 100%; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.alert { padding: 12px 14px; margin-bottom: 17px; border: 1px solid #E5E5DF; border-radius: 10px; background: #F1F1EC; }
.alert-error { background: #FFF0EE; border-color: #F4C8C2; color: #8B1F17; }
.alert-success { background: #ECF8EF; border-color: #CDE9D3; color: #216A32; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0,1fr); }
.sidebar { position: relative; padding: 26px 18px; background: linear-gradient(180deg,#111 0%,#171717 100%); color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.sidebar::after { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--yellow); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.sidebar-logo { width: 38px; height: 38px; }
.sidebar-brand strong { display: block; font-size: 17px; font-weight: 900; }
.sidebar-brand small { display: block; color: #8F8F8B; margin-top: 2px; font-size: 11px; }
.client-chip { margin-top: 25px; padding: 13px; border: 1px solid #313131; border-radius: 11px; background: #1D1D1D; }
.client-chip-label { display: block; margin-bottom: 5px; color: #878783; font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.client-chip strong { display: block; color: #fff; font-size: 13px; overflow-wrap: anywhere; }
.sidebar nav { display: grid; gap: 6px; margin-top: 26px; }
.nav-link { min-height: 46px; padding: 9px 11px; border: 1px solid transparent; border-radius: 9px; color: #BDBDB8; display: flex; align-items: center; gap: 11px; text-decoration: none; font-size: 14px; font-weight: 700; }
.nav-link:hover,.nav-link.active { background: #24230F; border-color: #423A13; color: #fff; }
.nav-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: #292929; color: #8F8F8A; font-size: 9px; font-weight: 900; }
.nav-link.active .nav-icon { background: var(--yellow); color: #111; }
.sidebar-bottom { display: grid; gap: 14px; }
.sidebar-help { padding: 11px 12px; border-left: 2px solid var(--yellow); }
.sidebar-help span { display: block; color: #858581; font-size: 10px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-help strong { font-size: 12px; color: #D6D6D0; }
.page-content { width: 100%; max-width: 1440px; padding: 40px; }
.narrow-content { max-width: 880px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.hero-header { padding: 6px 0 4px; }

.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; margin-bottom: 18px; }
.stat-card { position: relative; min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 8px 28px rgba(17,17,17,.035); overflow: hidden; }
.stat-card.stat-accent::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--yellow); }
.stat-top { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; font-size: 25px; letter-spacing: -.025em; }
.stat-card strong.smaller { font-size: 16px; }
.stat-card small { display: block; margin-top: 8px; color: #8A8C88; line-height: 1.35; }
.stat-badge { padding: 4px 7px; border-radius: 999px; background: var(--yellow-soft); color: #745D00 !important; font-size: 8px !important; font-weight: 900; letter-spacing: .08em; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #C7C7C2; }
.status-dot.is-on { background: #2AA653; box-shadow: 0 0 0 4px rgba(42,166,83,.11); }
.panel { padding: 22px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 8px 30px rgba(17,17,17,.035); }
.panel-featured { border-top: 3px solid var(--yellow); }
.upload-panel { background: linear-gradient(135deg,#fff 0%,#FFFDF4 100%); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.secure-pill,.event-pill { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px; background: #F2F2ED; color: #62645F; font-size: 10px; font-weight: 850; }
.upload-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; }
.file-picker { min-width: 0; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 650px; border-collapse: collapse; }
th,td { padding: 13px 10px; border-bottom: 1px solid #ECECE6; text-align: left; vertical-align: middle; font-size: 13px; }
th { color: #767872; font-size: 10px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.file-name { font-weight: 750; }
.file-icon { width: 30px; height: 30px; margin-right: 9px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--yellow-soft); color: #755D00; font-size: 10px; font-weight: 900; vertical-align: middle; }
.action-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.action-button { display: inline-flex; padding: 7px 10px; border: 1px solid #D9D9D2; border-radius: 8px; color: #2A2A28; text-decoration: none; font-size: 11px; font-weight: 850; }
.action-button:hover { border-color: var(--yellow-dark); background: var(--yellow-soft); }
.text-link { color: #6F5800; font-weight: 800; text-decoration: none; }
.danger-link { border: 0; background: transparent; padding: 0; color: var(--danger); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.empty-cell { padding: 34px; text-align: center; color: var(--muted); }
.empty-state { display: grid; gap: 5px; justify-items: center; }
.empty-state strong { color: #2B2B29; }
.empty-state span { color: var(--muted); font-size: 12px; }
.status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 850; }
.status-on { background: #EAF7ED; color: #226A32; }
.status-off { background: #FBEAEA; color: #8E2626; }
.admin-form ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; font-weight: 400; }

.simple-state-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #F7F7F3; }
.simple-state-card { width: min(100%,460px); padding: 34px; border: 1px solid var(--border); border-radius: 18px; background: #fff; text-align: center; box-shadow: var(--shadow); }
.state-logo { width: 54px; height: 54px; margin-bottom: 20px; }

@media (max-width:1050px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-brand-panel { display: none; }
    .auth-form-panel { min-height: 100vh; }
    .mobile-brand { display: flex; }
    .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:780px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { display: block; }
    .sidebar-bottom { margin-top: 18px; }
    .page-content { padding: 24px 16px; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr; }
    .upload-row { grid-template-columns: 1fr; }
    .auth-form-panel { padding: 22px; }
    .auth-card { padding: 28px 22px; }
    .section-heading { flex-direction: column; }
}
