:root {
    --primary: #1267f1;
    --primary-dark: #0b3570;
    --sidebar: #071d3a;
    --sidebar-soft: #0b2a52;
    --text: #1f2633;
    --muted: #5e6879;
    --line: #e7ebf2;
    --bg: #f3f6fb;
    --card: #ffffff;
    --danger: #b42318;
    --success: #087443;
    --success-bg: #dcfce7;
    --radius: 10px;
    --shadow: 0 16px 40px rgba(18, 29, 48, .06);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 12px; color: var(--text); }
h1 { font-size: 34px; }
h2 { font-size: 23px; }
h3 { font-size: 19px; }
p { margin: 0 0 12px; }

.public-body .topbar {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.brand { font-weight: 900; color: var(--text); }
.brand-logo img { width: 172px; display: block; }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.container { width: min(1120px, calc(100% - 32px)); margin: 32px auto; }

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--sidebar);
    color: #dbeafe;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 98px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: #fff;
}
.sidebar-logo img {
    max-width: 210px;
    filter: none;
}

.sidebar-user {
    padding: 0 2px 8px;
    display: grid;
    gap: 2px;
    color: #bfdbfe;
}
.sidebar-user strong { color: #fff; }

.sidebar-nav {
    display: grid;
    gap: 6px;
}
.sidebar-nav a,
.sidebar-logout button {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    border-radius: 8px;
    color: #e5eefc;
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.sidebar-nav a span,
.sidebar-logout span {
    width: 22px;
    text-align: center;
    color: #93c5fd;
}
.sidebar-nav a:hover,
.sidebar-nav a.active,
.sidebar-logout button:hover {
    background: var(--sidebar-soft);
    color: #fff;
}
.sidebar-logout { margin: 8px 0 0; }

.main-area {
    min-width: 0;
}
.mobile-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.app-container {
    width: min(1560px, calc(100% - 56px));
    margin: 0 auto;
    padding: 34px 0 64px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
}
.head-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.muted { color: var(--muted); }

.hero {
    display: grid;
    grid-template-columns: 1.4fr .8fr;
    gap: 32px;
    align-items: center;
    padding: 56px 0;
}
.hero h1 { font-size: clamp(34px, 5vw, 58px); max-width: 820px; }
.hero p { color: var(--muted); font-size: 18px; max-width: 720px; }
.hero-panel, .panel, .plan, .grid > article {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.hero-panel { display: grid; gap: 12px; font-size: 20px; }

.grid { display: grid; gap: 18px; margin: 22px 0; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.narrow { max-width: 560px; margin: 0 auto; }
.actions, .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.actions { justify-content: flex-start; margin-top: 22px; }

.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 0 17px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}
.button:hover, button:hover { background: var(--primary-dark); color: #fff; }
.button.secondary, button.secondary {
    background: #e8f1ff;
    color: var(--primary-dark);
}
.button.secondary:hover, button.secondary:hover {
    background: #dbeafe;
    color: var(--primary-dark);
}
.button.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.button.full { width: 100%; margin-top: 18px; }
.inline { display: inline-flex; margin: 0; }

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}
.metric-card {
    min-height: 112px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}
.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 16px;
    margin-bottom: 8px;
}
.metric-card strong {
    display: block;
    color: var(--text);
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1;
    letter-spacing: -.03em;
}

.dashboard-split {
    align-items: stretch;
}
.progress-wrap {
    height: 12px;
    border-radius: 999px;
    background: #e8eef7;
    overflow: hidden;
    margin: 18px 0 14px;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #22c55e);
    border-radius: inherit;
}
.mini-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--muted);
}
.mini-stats strong { color: var(--text); }
.limit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.limit-row:last-of-type { border-bottom: 0; }

.quick-actions {
    display: grid;
    gap: 10px;
}
.quick {
    min-height: 46px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    background: #fff;
}
.quick.primary {
    background: var(--primary-dark);
    color: #fff;
    border-color: var(--primary-dark);
}

.form { display: grid; gap: 14px; }
.form.compact { gap: 10px; }
label { display: grid; gap: 6px; font-weight: 800; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .02em; }
tr:hover td { background: #f8fbff; }

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #eef2f7;
    color: #475467;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}
.badge.success {
    background: var(--success-bg);
    color: var(--success);
}
.code {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 800;
}

.metrics article strong { display: block; font-size: 28px; }
.metrics article span { color: var(--muted); }
.alert { border-radius: 8px; padding: 14px 16px; margin-bottom: 18px; background: #fff1f0; color: var(--danger); border: 1px solid #ffd2cc; }
.success { text-align: center; border-color: #abefc6; }
.ticket { font-size: 32px; color: var(--success); font-weight: 900; letter-spacing: .08em; }
.price { font-size: 24px; font-weight: 900; }

@media (max-width: 1100px) {
    .app-shell { grid-template-columns: 240px minmax(0, 1fr); }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .app-shell { display: block; }
    .sidebar { display: none; }
    .mobile-topbar { display: flex; }
    .app-container { width: min(100% - 28px, 720px); padding-top: 22px; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .hero, .two, .three, .four, .metric-grid { grid-template-columns: 1fr; }
    .public-body .topbar { height: auto; padding: 16px; align-items: flex-start; gap: 12px; }
    .public-body .topbar, .topbar nav { flex-wrap: wrap; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
}
