:root {
    --navy: #1e293b;
    --navy-dark: #0f172a;
    --accent: #e63e2c;
    --accent-2: #f97316;
    --gold: #d4a843;
    --bg: #f3f4f8;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e8eaf0;
    --white: #fff;
    --radius: 20px;
    --shadow: 0 10px 30px rgba(15, 23, 42, .06);
    --sidebar: 268px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Open Sans', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(230, 62, 44, .18), transparent 50%),
        radial-gradient(900px 400px at 110% 110%, rgba(249, 115, 22, .16), transparent 45%),
        var(--bg);
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 28px;
    padding: 40px 36px;
    box-shadow: var(--shadow);
}
.login-card h1 { font-family: Montserrat, sans-serif; font-size: 26px; color: var(--navy); margin-bottom: 8px; }
.login-card > p { color: var(--muted); margin-bottom: 28px; line-height: 1.5; }
.login-logo {
    display: block;
    margin-bottom: 22px;
}
.login-logo img {
    display: block;
    width: min(260px, 100%);
    height: auto;
}
.login-field { position: relative; }
.login-field .toggle-password {
    position: absolute;
    right: 12px;
    top: 38px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
    padding: 14px;
    gap: 14px;
}
.sidebar {
    width: var(--sidebar);
    background: #fff;
    color: var(--navy);
    padding: 18px 14px 20px;
    flex-shrink: 0;
    border-radius: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 28px);
    position: sticky;
    top: 14px;
    overflow: auto;
}
.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 10px 18px;
}
.sidebar-brand img {
    display: block;
    width: 100%;
    max-width: 210px;
    height: auto;
}
.sidebar-brand small { display: block; font-weight: 600; letter-spacing: 0; color: var(--muted); text-transform: none; font-size: 11px; }
.sidebar-section { font-size: 11px; font-weight: 700; color: var(--muted); padding: 14px 12px 8px; }
.nav-group { margin-bottom: 4px; }
.nav-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: var(--navy);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
}
.nav-group-toggle i.chevron { color: var(--muted); font-size: 11px; transition: transform .2s; }
.nav-group.is-open .nav-group-toggle i.chevron { transform: rotate(180deg); }
.nav-group-body { display: none; padding: 0 0 6px 10px; }
.nav-group.is-open .nav-group-body { display: block; }
.sidebar a, .sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #475569;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 2px;
}
.sidebar a i, .sidebar .nav-link i { width: 18px; text-align: center; color: #94a3b8; }
.sidebar a:hover, .sidebar .nav-link:hover { background: #f8fafc; color: var(--navy); }
.sidebar a.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 8px 18px rgba(230, 62, 44, .28);
}
.sidebar a.active i { color: #fff; }
.sidebar-foot { margin-top: auto; padding-top: 12px; }
.sidebar .logout-btn {
    width: 100%;
    justify-content: flex-start;
    background: #f8fafc;
    color: var(--navy);
    border: 1px solid var(--border);
}
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.topbar {
    background: #fff;
    padding: 14px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px;
    box-shadow: var(--shadow);
    gap: 16px;
}
.topbar h2 { font-family: Montserrat, sans-serif; font-size: 18px; color: var(--navy); }
.topbar-right { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border-radius: 999px;
    padding: 6px 12px 6px 6px;
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
}
.content { padding: 6px 4px 18px; flex: 1; }
.page-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.page-lead { color: var(--muted); font-size: 14px; max-width: 640px; line-height: 1.5; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 12px; padding: 10px 16px; cursor: pointer; font-weight: 700; font-size: 13px; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 16px rgba(230, 62, 44, .22); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy); border: 1px solid var(--border); }
.btn-danger { background: #fff; color: #b91c1c; border: 1px solid #fecaca; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-pad { padding: 22px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.table th { background: #fbfbfd; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.badge { display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-on { background: #dcfce7; color: #166534; }
.badge-off { background: #fee2e2; color: #991b1b; }
.badge-new { background: #ffedd5; color: #c2410c; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 24px; }
.form-grid .full { grid-column: 1 / -1; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 12px; font: inherit; background: #fbfbfd;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: 2px solid rgba(230, 62, 44, .25); border-color: var(--accent);
}
.form-group textarea { min-height: 110px; resize: vertical; background: #fff; }
.form-actions { padding: 0 24px 24px; display: flex; gap: 10px; }
.settings-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.settings-nav a { padding: 8px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--muted); }
.settings-nav a:hover, .settings-nav a.is-current { color: var(--accent); border-color: #fecaca; }
.settings-block { margin-bottom: 18px; }
.settings-block h3 { font-family: Montserrat, sans-serif; font-size: 16px; padding: 20px 24px 0; }
.settings-block p.hint { color: var(--muted); font-size: 13px; padding: 6px 24px 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat, .kpi-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.kpi-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; min-height: 118px; }
.kpi-card b, .stat b { display: block; font-size: 32px; color: var(--navy); font-family: Montserrat, sans-serif; line-height: 1.1; }
.kpi-card span, .stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    flex-shrink: 0;
}
.kpi-icon.red { background: linear-gradient(135deg, #ef4444, #e63e2c); }
.kpi-icon.orange { background: linear-gradient(135deg, #fb923c, #f97316); }
.kpi-icon.purple { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.kpi-icon.pink { background: linear-gradient(135deg, #f472b6, #ec4899); }
.dash-grid { display: grid; grid-template-columns: 1.7fr .9fr; gap: 16px; margin-bottom: 16px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 8px 22px 22px; }
.quick-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: 16px;
    min-height: 118px;
    font-weight: 700;
    font-size: 13px;
}
.quick-card i { font-size: 18px; }
.quick-card.red { background: #fff1f2; color: #be123c; }
.quick-card.orange { background: #fff7ed; color: #c2410c; }
.quick-card.purple { background: #f5f3ff; color: #6d28d9; }
.quick-card.pink { background: #fdf2f8; color: #be185d; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 8px; }
.card-head h3 { font-family: Montserrat, sans-serif; font-size: 16px; }
.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding: 8px 22px 22px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-pair { display: flex; align-items: flex-end; gap: 4px; height: 100%; width: 100%; justify-content: center; }
.bar { width: 10px; border-radius: 999px 999px 4px 4px; min-height: 4px; }
.bar.quotes { background: #0f172a; }
.bar.messages { background: var(--accent); }
.bar-col small { color: var(--muted); font-size: 11px; font-weight: 700; }
.donut-wrap { display: flex; gap: 18px; align-items: center; padding: 8px 22px 22px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.donut-legend b { color: var(--navy); }
.activity-list { list-style: none; padding: 0 8px 16px; }
.activity-list li a { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; }
.activity-list li a:hover { background: #f8fafc; }
.activity-icon {
    width: 36px; height: 36px; border-radius: 50%; background: #fff7ed; color: var(--accent);
    display: grid; place-items: center; flex-shrink: 0;
}
.activity-list strong { display: block; font-size: 13px; }
.activity-list small { color: var(--muted); }
.flash { margin-bottom: 16px; padding: 12px 16px; border-radius: 12px; background: #dcfce7; color: #166534; font-weight: 600; }
.errors { margin-bottom: 16px; padding: 12px 16px; border-radius: 12px; background: #fee2e2; color: #991b1b; font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 28px; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 12px; background: #edf2f7; }
.preview-lg { width: 160px; height: 90px; object-fit: cover; border-radius: 12px; margin-top: 8px; background: #edf2f7; }
.preview-logo {
    display: block;
    width: 180px;
    height: 120px;
    object-fit: contain;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .65), rgba(255, 255, 255, .65)),
        repeating-conic-gradient(#eef2f7 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
}
.field-note { margin: 4px 0 8px; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.45; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mobile-toggle { display: none; background: none; border: 0; color: var(--navy); font-size: 22px; cursor: pointer; }
.sidebar-backdrop { display: none; }
.empty-note { padding: 24px; color: var(--muted); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.title-color-panel {
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fafc;
}
.title-color-palette { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.form-group .title-color-chip,
.title-color-clear {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    margin: 0;
    padding: 4px 10px 4px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}
.title-color-chip.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(230, 62, 44, .16);
}
.title-color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .12);
    flex: 0 0 18px;
}
.title-color-dot.is-light { box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .28); }
.title-color-dot-custom {
    background: conic-gradient(#a01a28, #fcd116, #1d6b3a, #0b2c4a, #a8925c, #a01a28);
}
.form-group .title-color-chip-custom input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}
.title-color-clear { padding: 6px 10px; color: var(--muted); }
.title-color-clear i { width: 16px; text-align: center; }
.title-color-hint { margin: 8px 2px 0; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.45; }
.form-group .title-color-editor {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    white-space: pre-wrap;
    line-height: 1.45;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.title-color-field.is-multiline .title-color-editor { min-height: 110px; }
.form-group .title-color-editor.is-light-ink { background: #0f172a; }
.form-group .title-color-editor:focus { outline: 2px solid rgba(230, 62, 44, .25); border-color: var(--accent); }
.title-color-source { display: none !important; }
.supply-list { display: grid; gap: 10px; padding: 8px 24px 0; }
.supply-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(180px, .8fr) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fafc;
}
.supply-field { display: grid; gap: 6px; margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.supply-field input,
.supply-field select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--navy);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}
.supply-icon-control { display: flex; align-items: center; gap: 8px; }
.supply-icon-control i {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--accent);
}
.supply-icon-control select { min-width: 0; }
.supply-remove {
    height: 42px;
    padding: 0 12px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.supply-toolbar { padding: 12px 24px 20px; }

@media (max-width: 1200px) {
    .stats, .quick-grid { grid-template-columns: 1fr 1fr; }
    .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
    .form-grid { grid-template-columns: 1fr; }
    .supply-row { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .admin-shell { padding: 0; gap: 0; }
    .sidebar {
        position: fixed;
        inset: 12px auto 12px 12px;
        transform: translateX(calc(-100% - 24px));
        z-index: 30;
        transition: .3s;
        max-height: calc(100vh - 24px);
    }
    .sidebar.open { transform: none; }
    .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 25; }
    .mobile-toggle { display: block; }
    .stats, .quick-grid { grid-template-columns: 1fr; }
    .content { padding: 12px; }
    .main { padding: 12px; }
    .topbar, .sidebar { border-radius: 16px; }
    .table { display: block; overflow-x: auto; }
}
