:root {
  --navy: #061b46;
  --navy-2: #0a2b67;
  --blue: #0d57c7;
  --sky: #1da6f5;
  --yellow: #ffd229;
  --ice: #f4f7fb;
  --surface: #ffffff;
  --text: #142e5c;
  --muted: #6d7f9f;
  --line: #dfe7f2;
  --danger: #b42318;
  --success: #067647;
  --warning: #a15c00;
  --shadow: 0 12px 32px rgba(15, 45, 95, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, "Segoe UI", Arial, sans-serif; background: var(--ice); color: var(--text); -webkit-font-smoothing: antialiased; }
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.eyebrow { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.muted { color: var(--muted); }

/* Authentication */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 8% 0, #167be0 0, transparent 30%), radial-gradient(circle at 92% 95%, #0e4ba3 0, transparent 34%), linear-gradient(145deg, #031431, #082761 65%, #0b438e); }
.auth-card { width: min(500px, 100%); background: #fff; border: 1px solid rgba(255,255,255,.6); border-radius: 26px; padding: 36px; box-shadow: 0 32px 90px rgba(0,0,0,.35); }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand > span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; background: var(--yellow); color: var(--navy); font-weight: 900; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand small { color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.auth-card h1 { margin: 28px 0 8px; color: var(--navy); font-size: 32px; letter-spacing: -.03em; }
.auth-card p { color: var(--muted); line-height: 1.6; }
.back-link { display: inline-block; margin-top: 20px; color: var(--blue); font-weight: 700; }

/* Shell and sidebar */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 276px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, var(--navy) 0%, #08265d 55%, #0a3479 100%); padding: 22px 16px 18px; color: #fff; overflow: auto; z-index: 40; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.sidebar-brand { display: flex; gap: 12px; align-items: center; padding: 3px 8px 23px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand > span { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; background: linear-gradient(145deg, #fff5b0, var(--yellow)); box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.sidebar-brand img { width: 36px; height: 36px; object-fit: contain; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { font-size: 17px; letter-spacing: -.01em; }
.sidebar-brand small { color: #aecaee; font-size: 9px; font-weight: 700; letter-spacing: .13em; margin-top: 3px; }
.admin-nav { padding-top: 16px; }
.nav-group { display: grid; gap: 4px; margin-bottom: 15px; }
.nav-label { padding: 0 12px 5px; color: #82a6d5; font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.admin-nav a { position: relative; display: flex; gap: 11px; align-items: center; min-height: 42px; padding: 9px 12px; border-radius: 11px; color: #dbeaff; font-size: 13px; font-weight: 600; transition: background .18s, color .18s, transform .18s; }
.admin-nav a:hover { background: rgba(255,255,255,.09); color: #fff; transform: translateX(2px); }
.admin-nav a.active { background: var(--yellow); color: var(--navy); box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.admin-nav a.active::after { content: ""; position: absolute; right: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--navy); }
.nav-icon { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; background: rgba(255,255,255,.09); font-size: 13px; }
.admin-nav a.active .nav-icon { background: rgba(6,27,70,.1); }
.nav-count { min-width: 20px; height: 20px; display: grid; place-items: center; margin-left: auto; padding: 0 6px; border-radius: 999px; background: #ffefd0; color: #885500; font-size: 9px; }
.admin-nav a.active .nav-count { background: var(--navy); color: #fff; }
.sidebar-footer { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; margin-top: 8px; padding: 16px 8px 2px; border-top: 1px solid rgba(255,255,255,.13); font-size: 12px; }
.admin-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: rgba(255,255,255,.13); color: var(--yellow); font-weight: 900; }
.admin-identity { min-width: 0; }
.admin-identity strong, .admin-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-identity small { color: #aecaee; margin-top: 2px; text-transform: capitalize; }
.sidebar-links { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; padding-top: 5px; }
.sidebar-links a { color: #fff; font-weight: 650; }
.sidebar-links a:last-child { color: #aecaee; }
.sidebar-overlay { display: none; }
.sidebar-collapse { position: absolute; top: 74px; right: 8px; z-index: 5; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 2px solid rgba(255,255,255,.72); border-radius: 50%; background: #fff; color: var(--blue); box-shadow: 0 5px 14px rgba(0,0,0,.2); font-size: 19px; font-weight: 800; line-height: 1; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.sidebar-collapse:hover { background: var(--yellow); box-shadow: 0 7px 17px rgba(0,0,0,.25); }
.sidebar-collapse:focus-visible { outline: 3px solid rgba(255,210,41,.45); outline-offset: 2px; }
.admin-shell.sidebar-collapsed { grid-template-columns: 82px minmax(0,1fr); }
.admin-shell.sidebar-collapsed .sidebar { padding-inline: 12px; overflow-x: hidden; }
.admin-shell.sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 0; }
.admin-shell.sidebar-collapsed .sidebar-brand > div, .admin-shell.sidebar-collapsed .nav-label, .admin-shell.sidebar-collapsed .admin-nav a > span:not(.nav-icon), .admin-shell.sidebar-collapsed .admin-identity, .admin-shell.sidebar-collapsed .sidebar-links { display: none; }
.admin-shell.sidebar-collapsed .nav-group { margin-bottom: 8px; }
.admin-shell.sidebar-collapsed .admin-nav a { justify-content: center; padding-inline: 8px; }
.admin-shell.sidebar-collapsed .nav-icon { width: 30px; height: 30px; }
.admin-shell.sidebar-collapsed .nav-count { position: absolute; top: 4px; right: 3px; min-width: 15px; height: 15px; padding: 0 3px; font-size: 7px; }
.admin-shell.sidebar-collapsed .sidebar-footer { grid-template-columns: 1fr; justify-items: center; padding-inline: 0; }
.admin-shell.sidebar-collapsed .sidebar-collapse { transform: rotate(180deg); }

/* Header and page structure */
.admin-main { min-width: 0; }
.admin-topbar { min-height: 92px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px clamp(22px, 3vw, 42px); background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.admin-topbar h1 { font-size: 25px; line-height: 1.1; margin: 4px 0 0; color: var(--navy); letter-spacing: -.025em; }
.admin-topbar p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-primary-action { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 12px; border: 0; border-radius: 11px; background: var(--yellow); color: var(--navy); box-shadow: 0 7px 16px rgba(178,137,0,.14); font-size: 11px; font-weight: 850; cursor: pointer; }
.topbar-primary-action span { font-size: 16px; line-height: 1; }
.topbar-site-link { padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--blue); font-size: 12px; font-weight: 750; }
.command-button { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafd; color: var(--muted); font-size: 11px; font-weight: 650; cursor: pointer; }
kbd { padding: 3px 6px; border: 1px solid #d7dfeb; border-bottom-width: 2px; border-radius: 5px; background: #fff; color: #77869e; font: 600 9px/1 Inter, sans-serif; }
.mobile-nav-toggle { display: none; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--navy); cursor: pointer; font-size: 20px; }
.admin-content { width: min(1560px, 100%); margin: 0 auto; padding: 28px clamp(22px, 3vw, 42px) 52px; }
.admin-footer { display: flex; justify-content: space-between; gap: 15px; padding: 16px clamp(22px,3vw,42px); border-top: 1px solid var(--line); color: #8796ab; font-size: 9px; }

/* Actionable notifications */
.notification-center { position: relative; }
.notification-button { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--blue); cursor: pointer; }
.notification-button > span { font-size: 17px; }
.notification-button > b { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; border-radius: 999px; background: #e5484d; color: #fff; font-size: 7px; }
.notification-panel[hidden] { display: none; }
.notification-panel { position: absolute; top: calc(100% + 12px); right: 0; z-index: 70; width: min(380px, calc(100vw - 28px)); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 24px 65px rgba(4,24,63,.22); }
.notification-panel > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 17px; border-bottom: 1px solid var(--line); background: #f8fafd; }
.notification-panel h2 { margin: 3px 0 0; color: var(--navy); font-size: 15px; }
.notification-panel > header > span { color: var(--muted); font-size: 9px; }
.notification-list { max-height: 380px; overflow: auto; padding: 7px; }
.notification-list a { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; }
.notification-list a:hover { background: #f1f6fd; }
.notification-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #eaf3ff; color: var(--blue); font-weight: 900; }
.notification-list strong, .notification-list small { display: block; }
.notification-list strong { color: var(--navy); font-size: 10px; }
.notification-list small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.notification-list i { color: var(--blue); font-style: normal; }
.notification-empty { display: grid; gap: 4px; padding: 30px 18px; text-align: center; }
.notification-empty strong { color: var(--navy); }
.notification-empty span { color: var(--muted); font-size: 10px; }

/* Dashboard */
.dashboard-welcome { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 132px; padding: 25px 28px; margin-bottom: 20px; border-radius: 22px; color: #fff; background: linear-gradient(115deg, var(--navy), #0b4daa 72%, #1478ce); box-shadow: 0 18px 38px rgba(6,31,82,.16); }
.dashboard-welcome::after { content: ""; position: absolute; width: 260px; height: 260px; right: 10%; top: -130px; border: 55px solid rgba(255,255,255,.06); border-radius: 50%; pointer-events: none; }
.dashboard-welcome > * { position: relative; z-index: 1; }
.dashboard-welcome .eyebrow { color: #8ed8ff; }
.dashboard-welcome h2 { margin: 5px 0; font-size: 27px; letter-spacing: -.025em; }
.dashboard-welcome p { margin: 0; color: #cee4ff; font-size: 13px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 20px; }
.stat-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.stat-card { display: flex; gap: 15px; align-items: center; padding: 20px; min-width: 0; }
.stat-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; background: #eaf3ff; color: var(--blue); font-size: 19px; }
.stat-card:nth-child(3) .stat-icon, .stat-card:nth-child(4) .stat-icon { background: #fff7d9; color: #8d6200; }
.stat-card span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.stat-card strong { display: block; margin-top: 3px; font-size: 27px; color: var(--navy); letter-spacing: -.04em; }
.stat-card small { display: block; margin-top: 1px; color: #91a0b7; font-size: 10px; }
.revenue-total { display: block; margin: 4px 0 15px; color: var(--navy); font-size: 30px; letter-spacing: -.04em; }
.health-row { display: flex; justify-content: space-between; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; }
.health-row small { color: var(--muted); }
.health-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 4px #ecfdf3; }
.insights-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.feed-list { display: grid; }
.feed-item { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 11px; align-items: center; min-height: 58px; padding: 9px 4px; border-top: 1px solid #edf1f6; }
.feed-item:first-child { border-top: 0; }
.feed-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #edf4ff; color: var(--blue); }
.feed-item strong, .feed-item small { display: block; }
.feed-item strong { color: var(--navy); font-size: 11px; }
.feed-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.feed-value { display: grid; justify-items: end; gap: 4px; color: var(--navy); font-size: 11px; font-weight: 800; }
.feed-value .badge { font-size: 8px; }
.stock-alert { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 13px; padding: 12px 13px; border: 1px solid #f8dda1; border-radius: 11px; background: #fff9e9; font-size: 10px; }
.stock-alert strong { color: #805600; }
.stock-alert span { color: #937348; }
.stock-alert a, .text-link { color: var(--blue); font-size: 10px; font-weight: 800; }

/* Panels, tables and forms */
.panel { padding: 21px; margin-bottom: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 11px; min-height: 38px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; color: var(--navy); font-size: 17px; letter-spacing: -.015em; }
.panel-head .eyebrow + h2 { margin-top: 4px; }
.panel-actions { display: flex; align-items: center; gap: 8px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr); gap: 20px; align-items: start; }
.admin-grid > aside.panel, .admin-grid > aside > .panel:first-child { position: sticky; top: 112px; }
.table-wrap { overflow: auto; border: 1px solid #e7edf6; border-radius: 13px; }
.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 720px; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 13px; border-bottom: 1px solid #eaf0f7; vertical-align: middle; font-size: 12px; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr { transition: background .15s; }
.admin-table tbody tr:hover { background: #f8fbff; }
.admin-table th { position: sticky; top: 0; z-index: 1; color: #687b9a; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; background: #f7f9fc; }
.admin-table th.is-sortable { cursor: pointer; user-select: none; }
.admin-table th.is-sortable::after { content: "↕"; margin-left: 6px; color: #b0bccd; font-size: 8px; }
.admin-table th.sort-asc::after { content: "↑"; color: var(--blue); }
.admin-table th.sort-desc::after { content: "↓"; color: var(--blue); }
.admin-table td strong { color: var(--navy); }
.article-public-link { display: block; max-width: 420px; margin-top: 5px; overflow-wrap: anywhere; color: var(--blue); font-size: 9px; font-weight: 650; line-height: 1.4; }
.article-public-link + small { display: block; margin-top: 4px; }
.admin-table img { width: 42px; height: 42px; object-fit: contain; border: 1px solid #e8eef6; border-radius: 10px; background: #f7f9fc; }
.admin-table a:not(.icon-button):hover { color: var(--blue); text-decoration: underline; }
.client-empty td { padding: 30px; color: var(--muted); text-align: center; }
.table-search { display: flex; align-items: center; gap: 7px; width: min(220px, 100%); padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #f9fbfe; color: var(--muted); }
.table-search:focus-within { border-color: #85b7ee; box-shadow: 0 0 0 3px rgba(13,87,199,.09); background: #fff; }
.table-search input { min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-actions form { display: inline; }
.row-actions select { min-height: 34px; padding: 6px 27px 6px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); font-size: 11px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; background: #eaf3ff; color: var(--blue); font-size: 10px; font-weight: 800; text-transform: capitalize; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.success { background: #ecfdf3; color: var(--success); }
.badge.warning { background: #fff8e0; color: var(--warning); }
.badge.danger { background: #fff0ee; color: var(--danger); }
.empty { padding: 30px; text-align: center; color: var(--muted); }

.admin-form { display: grid; gap: 15px; }
.form-state { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 5px 8px; border-radius: 999px; background: #f1f4f8; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.form-state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #98a6ba; }
.form-state.unsaved { background: #fff8e0; color: var(--warning); }
.form-state.unsaved::before { background: #e69b00; }
.upload-preview { width: 100%; min-height: 92px; display: grid; place-items: center; margin-top: 4px; padding: 8px; border: 1px dashed #bdd0e7; border-radius: 10px; background: #f8fbff; }
.upload-preview img { max-width: 100%; max-height: 130px; object-fit: contain; border-radius: 8px; }
.upload-preview span { color: var(--muted); font-size: 9px; }
.admin-form label { display: grid; gap: 6px; color: var(--navy); font-size: 11px; font-weight: 750; }
.admin-form input, .admin-form select, .admin-form textarea, .filter-bar input, .filter-bar select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #fbfcfe; color: var(--text); transition: border .15s, box-shadow .15s, background .15s; }
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus, .filter-bar input:focus, .filter-bar select:focus { border-color: #79afe8; box-shadow: 0 0 0 3px rgba(13,87,199,.09); background: #fff; }
.admin-form textarea { min-height: 105px; resize: vertical; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 4px; }
.check-label { display: flex !important; grid-column: 1 / -1; align-items: center; gap: 8px; min-height: 38px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #f9fbfe; }
.check-label input { width: 16px; height: 16px; accent-color: var(--blue); }
.filter-bar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafd; }
.filter-bar input, .filter-bar select { width: auto; min-width: 170px; background: #fff; }
.logo-preview { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--line); border-radius: 13px; padding: 6px; }
.danger-zone { border-color: #fbd0ca; }
.settings-list { display: grid; gap: 14px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.mini-stats article { padding: 17px 19px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.mini-stats span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.mini-stats strong { display: block; margin-top: 5px; color: var(--navy); font-size: 24px; }
.retention-note { color: var(--muted); font-size: 10px; }
.admin-table code { padding: 4px 6px; border-radius: 6px; background: #f2f5f9; color: #526681; font-size: 9px; }

/* Team-versus-team game presentation */
.admin-matchup { width: 250px; display: grid; grid-template-columns: minmax(82px, 1fr) 36px minmax(82px, 1fr); gap: 9px; align-items: center; padding: 5px 0; }
.admin-match-team { display: grid; justify-items: center; gap: 6px; min-width: 0; text-align: center; }
.admin-match-team strong { width: 100%; overflow: hidden; color: var(--navy); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.admin-team-logo { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; background: #f6f9fd; }
.admin-table .admin-team-logo img { width: 58px; height: 58px; max-width: 58px; object-fit: contain; border: 0; border-radius: 0; background: transparent; }
.admin-team-logo.fallback { border: 1px solid #d8e5f4; background: linear-gradient(145deg, #edf5ff, #dbeaff); color: var(--blue); font-size: 12px; font-weight: 900; }
.admin-versus, .preview-versus { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #edf4ff; color: var(--blue); font-size: 9px; font-weight: 900; }
.match-division { display: block; margin-top: 5px; color: var(--muted); text-align: center; }
.game-form-preview { display: grid; grid-template-columns: 1fr 38px 1fr; gap: 9px; align-items: center; margin: -3px 0 17px; padding: 16px 12px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(180deg, #fbfdff, #f4f8fd); }
.preview-team { display: grid; justify-items: center; gap: 7px; min-width: 0; text-align: center; }
.preview-team strong { width: 100%; overflow: hidden; color: var(--navy); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.preview-logo { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 50%; }
.preview-logo img { width: 66px; height: 66px; object-fit: contain; }
.preview-logo.fallback { border: 1px dashed #b9cce4; background: #fff; color: #8ba0bd; font-weight: 900; }

/* Orders and invoices */
.order-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.order-stats article { display: flex; gap: 13px; align-items: center; min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.order-stat-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; font-size: 17px; font-weight: 900; }
.order-stat-icon.blue { background: #eaf3ff; color: var(--blue); }
.order-stat-icon.amber { background: #fff7df; color: #9a6200; }
.order-stat-icon.green { background: #eafbf2; color: var(--success); }
.order-stat-icon.violet { background: #f3efff; color: #6941c6; }
.order-stats small, .order-stats strong, .order-stats em { display: block; }
.order-stats small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.order-stats strong { margin-top: 3px; overflow: hidden; color: var(--navy); font-size: 21px; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.order-stats em { margin-top: 2px; color: #96a4b8; font-size: 9px; font-style: normal; }
.order-workspace { padding: 0; overflow: hidden; }
.order-workspace > .panel-head { padding: 21px 21px 5px; }
.order-toolbar { display: flex; gap: 10px; align-items: center; padding: 13px 21px 17px; border-bottom: 1px solid var(--line); }
.order-search { display: grid; grid-template-columns: auto minmax(170px, 1fr) auto; gap: 8px; align-items: center; width: min(370px, 100%); min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #f9fbfe; color: var(--muted); }
.order-search:focus-within { border-color: #85b7ee; box-shadow: 0 0 0 3px rgba(13,87,199,.09); background: #fff; }
.order-search input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.order-tabs { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9fc; }
.order-tabs button { display: flex; gap: 5px; align-items: center; min-height: 30px; padding: 6px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 800; cursor: pointer; }
.order-tabs button span { min-width: 16px; padding: 2px 4px; border-radius: 999px; background: #e9edf3; font-size: 8px; }
.order-tabs button.active { background: #fff; color: var(--blue); box-shadow: 0 2px 7px rgba(15,45,95,.1); }
.order-tabs button.active span { background: #e7f1ff; }
#orderDateFilter { min-height: 38px; margin-left: auto; padding: 8px 30px 8px 10px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #fff; color: var(--text); font-size: 10px; }
.order-table-wrap { border: 0; border-radius: 0; }
.order-table { min-width: 850px; }
.order-table th { padding-top: 10px; padding-bottom: 10px; }
.order-table td { padding-top: 13px; padding-bottom: 13px; }
.invoice-link { display: flex; gap: 9px; align-items: center; padding: 0; border: 0; background: transparent; color: var(--navy); text-align: left; cursor: pointer; }
.invoice-link:hover strong { color: var(--blue); text-decoration: underline; }
.invoice-link strong, .invoice-link small, .customer-cell strong, .customer-cell small { display: block; }
.invoice-link small, .customer-cell small { max-width: 180px; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.invoice-icon { width: 32px; height: 36px; display: grid; place-items: center; border: 1px solid #cfe0f5; border-radius: 8px; background: #f0f6ff; color: var(--blue); }
.customer-cell { display: flex; gap: 9px; align-items: center; }
.customer-avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: linear-gradient(145deg, #e7f1ff, #d7e8ff); color: var(--blue); font-size: 10px; font-weight: 900; }
.order-total { font-size: 13px; }
.order-status-form { display: grid; grid-template-columns: auto minmax(92px, 1fr) auto; gap: 6px; align-items: center; }
.order-status-form select { min-height: 32px; padding: 6px 25px 6px 8px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: #fff; color: var(--text); font-size: 9px; }
.order-status-form button:disabled { opacity: .42; cursor: default; transform: none; box-shadow: none; }
.order-view-button { display: flex; gap: 5px; align-items: center; white-space: nowrap; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--blue); font-size: 9px; font-weight: 800; cursor: pointer; }
.order-view-button:hover { border-color: #9fc2eb; background: #f8fbff; }
.order-table-footer { display: flex; justify-content: space-between; gap: 12px; padding: 12px 21px; border-top: 1px solid var(--line); background: #fafbfd; color: var(--muted); font-size: 9px; }

.order-modal[hidden] { display: none; }
.order-modal { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 20px; }
.order-modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(2,12,31,.68); backdrop-filter: blur(4px); }
.order-modal-dialog { position: relative; width: min(820px, 100%); max-height: min(90vh, 880px); display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; border: 1px solid rgba(255,255,255,.7); border-radius: 20px; background: #fff; box-shadow: 0 35px 100px rgba(0,0,0,.4); }
.order-modal-dialog > header, .order-modal-dialog > footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 20px; }
.order-modal-dialog > header { border-bottom: 1px solid var(--line); background: #f9fbfe; }
.order-modal-dialog > header h2 { margin: 4px 0 0; color: var(--navy); font-size: 18px; }
.order-modal-dialog > footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.modal-close { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: 20px; cursor: pointer; }
.order-modal-body { overflow: auto; padding: 20px; background: #f4f7fb; }
.admin-invoice-sheet { padding: 24px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 8px 25px rgba(15,45,95,.06); }
.admin-invoice-head, .invoice-title-row, .invoice-customer-grid, .invoice-total-row { display: flex; justify-content: space-between; gap: 22px; }
.admin-invoice-head { align-items: center; padding-bottom: 17px; border-bottom: 3px solid var(--blue); }
.admin-invoice-brand { display: flex; gap: 11px; align-items: center; }
.admin-invoice-brand img { width: 46px; height: 46px; object-fit: contain; }
.admin-invoice-brand strong, .admin-invoice-brand small, .invoice-title-row small, .invoice-customer-grid small, .invoice-total-row small { display: block; }
.admin-invoice-brand strong { color: var(--navy); font-size: 19px; }
.admin-invoice-brand small, .invoice-title-row small, .invoice-customer-grid small, .invoice-total-row small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.admin-invoice-sheet .badge.paid { background: #ecfdf3; color: var(--success); }
.admin-invoice-sheet .badge.cancelled { background: #fff0ee; color: var(--danger); }
.admin-invoice-sheet .badge.pending { background: #fff8e0; color: var(--warning); }
.invoice-title-row { align-items: end; padding: 22px 0 17px; }
.invoice-title-row h3 { margin: 4px 0 0; color: var(--navy); font-size: 23px; letter-spacing: -.02em; }
.invoice-title-row > div:last-child { text-align: right; }
.invoice-customer-grid { padding: 16px; border: 1px solid #e5edf6; border-radius: 11px; background: #f8fafd; }
.invoice-customer-grid > div { width: 50%; }
.invoice-customer-grid strong, .invoice-customer-grid a { display: block; margin-top: 4px; color: var(--navy); font-size: 11px; }
.invoice-customer-grid a { color: var(--blue); }
.invoice-customer-grid p { margin: 4px 0 0; color: var(--text); font-size: 10px; line-height: 1.5; }
.invoice-items-wrap { margin-top: 18px; overflow: auto; }
.invoice-items-wrap table { width: 100%; border-collapse: collapse; }
.invoice-items-wrap th, .invoice-items-wrap td { padding: 10px; border-bottom: 1px solid #e9eef5; text-align: left; font-size: 10px; }
.invoice-items-wrap th { color: var(--muted); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; background: #fafbfd; }
.invoice-items-wrap th:last-child, .invoice-items-wrap td:last-child { text-align: right; }
.invoice-item-type { display: block; margin-bottom: 2px; color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.invoice-total-row { justify-content: flex-end; align-items: end; padding: 19px 0; }
.invoice-total-row > span { min-width: 140px; }
.invoice-total-row > span:last-child { text-align: right; }
.invoice-total-row strong { display: block; margin-top: 3px; color: var(--navy); font-size: 13px; text-transform: capitalize; }
.invoice-total-row > span:last-child strong { font-size: 22px; }
.admin-invoice-sheet > footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; }

/* Quick find */
.command-palette[hidden] { display: none; }
.command-palette { position: fixed; inset: 0; z-index: 100; display: grid; align-items: start; justify-items: center; padding: min(14vh, 120px) 18px 20px; }
.command-backdrop { position: absolute; inset: 0; border: 0; background: rgba(2,12,31,.6); backdrop-filter: blur(3px); }
.command-dialog { position: relative; width: min(560px, 100%); max-height: min(620px, 76vh); overflow: hidden; border: 1px solid rgba(255,255,255,.6); border-radius: 18px; background: #fff; box-shadow: 0 35px 90px rgba(0,0,0,.35); }
.command-search { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 15px 16px; border-bottom: 1px solid var(--line); color: var(--blue); }
.command-search input { min-width: 0; border: 0; outline: 0; color: var(--navy); font-size: 14px; }
.command-results { max-height: min(540px, 65vh); overflow: auto; padding: 10px; }
.command-group { display: block; padding: 10px 9px 5px; color: #8b9ab0; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.command-results a { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--text); font-size: 11px; font-weight: 700; }
.command-results a:hover, .command-results a.focused { background: #eef5ff; color: var(--blue); }
.command-results a .nav-icon { background: #e9f2ff; color: var(--blue); }
.command-results a small { color: #9aa8bc; font-size: 9px; }
.command-empty { padding: 25px; color: var(--muted); text-align: center; font-size: 11px; }

/* Controls and system feedback */
.primary-button, .secondary-button, .danger-button, .icon-button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 800; font-size: 11px; cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s; }
.primary-button { background: var(--yellow); color: var(--navy); box-shadow: 0 7px 16px rgba(178,137,0,.15); }
.secondary-button { background: #eaf3ff; color: var(--blue); }
.danger-button { background: #fff0ee; color: var(--danger); }
.icon-button { min-height: 32px; padding: 7px 10px; background: #edf4ff; color: var(--blue); }
.account-delete-form { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 16px; border-top: 1px solid #f1c9c4; }
.account-delete-form p { display: grid; gap: 3px; margin: 0; color: var(--danger); font-size: 11px; }
.account-delete-form p small { max-width: 250px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.account-delete-form .danger-button { flex: 0 0 auto; }
.primary-button:hover, .secondary-button:hover, .danger-button:hover, .icon-button:hover { transform: translateY(-1px); box-shadow: 0 7px 15px rgba(16,48,95,.12); }
button.is-loading { opacity: .7; cursor: wait; }
.alert { position: relative; padding: 13px 15px; margin: 0 0 18px; border: 1px solid; border-radius: 11px; font-size: 12px; font-weight: 650; transition: opacity .3s, transform .3s; }
.alert.error { background: #fff5f3; border-color: #ffd3cc; color: var(--danger); }
.alert.success { background: #effcf5; border-color: #bcebd1; color: var(--success); }
.alert.fade-out { opacity: 0; transform: translateY(-5px); pointer-events: none; }
.pagination { display: flex; gap: 6px; margin-top: 16px; }
.pagination a { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--blue); font-size: 11px; font-weight: 700; }
.pagination a.active { border-color: var(--blue); background: var(--blue); color: #fff; }
.quick-grid { display: grid; gap: 9px; }
.quick-card { position: relative; padding: 14px 35px 14px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafcff; transition: border .15s, transform .15s, background .15s; }
.quick-card::after { content: "→"; position: absolute; right: 14px; top: 50%; color: var(--blue); transform: translateY(-50%); }
.quick-card:hover { border-color: #a8c8ed; background: #fff; transform: translateY(-1px); }
.quick-card strong { display: block; color: var(--navy); margin-bottom: 4px; font-size: 12px; }
.quick-card span { font-size: 10px; line-height: 1.45; }

/* Newsroom editor */
.news-admin-filters { margin: 0 0 18px; }
.news-admin-filters input[type="search"] { min-width: 210px; flex: 1; }
.news-admin-filters select { min-width: 135px; }
.field-hint { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 600; line-height: 1.45; }
.admin-news-image-preview { display: block; width: 100%; max-height: 220px; margin: 9px 0; border: 1px solid var(--line); border-radius: 12px; object-fit: cover; }
.news-editor-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.admin-empty-cell { padding: 35px 15px !important; color: var(--muted); text-align: center; }
.highlight-admin-card-cell { display: grid; grid-template-columns: 74px minmax(150px,1fr); gap: 11px; align-items: center; }
.highlight-admin-card-cell img { width: 74px; height: 54px; border-radius: 9px; object-fit: cover; }
.highlight-admin-card-cell strong, .highlight-admin-card-cell small { display: block; }
.highlight-admin-card-cell small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.highlight-heading-panel { margin-top: 18px; }

/* WordPress-style visual article editor */
.rich-editor { min-width: 0; color: var(--navy); }
.rich-editor-label { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 7px; font-size: 11px; font-weight: 750; }
.rich-editor-label small { color: var(--muted); font-size: 9px; font-weight: 600; }
.rich-editor-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: #edf2f8; }
.rich-editor-modes button { min-height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; cursor: pointer; }
.rich-editor-modes button.active { background: #fff; color: var(--blue); box-shadow: 0 2px 8px rgba(15,45,95,.1); }
.rich-editor-toolbar { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; padding: 8px; border: 1px solid var(--line); border-bottom: 0; border-radius: 0; background: #f7f9fc; }
.rich-editor-toolbar select { width: auto; min-width: 116px; min-height: 34px; padding: 6px 28px 6px 9px; border: 1px solid #d7e1ed; border-radius: 7px; background: #fff; color: var(--navy); font-size: 10px; font-weight: 700; }
.rich-editor-toolbar button { min-width: 34px; min-height: 34px; display: inline-grid; place-items: center; padding: 6px 8px; border: 1px solid #d7e1ed; border-radius: 7px; background: #fff; color: var(--navy); font-size: 10px; font-weight: 750; cursor: pointer; }
.rich-editor-toolbar button:hover, .rich-editor-toolbar button.active { border-color: #8bb8ea; background: #eaf3ff; color: var(--blue); }
.rich-toolbar-divider { width: 1px; height: 24px; margin: 0 2px; background: #d9e2ed; }
.rich-source-toggle { margin-left: auto; }
.rich-editor-canvas, .rich-editor-source { width: 100%; min-height: 420px; max-height: 680px; overflow: auto; padding: clamp(18px, 3vw, 32px); border: 1px solid var(--line); border-radius: 0; outline: 0; background: #fff; color: #24374d; font-family: Inter, Arial, Roboto, sans-serif !important; font-size: 17px; font-weight: 400; line-height: 1.8; box-shadow: inset 0 1px 2px rgba(15,45,95,.03); }
.rich-editor-canvas:focus, .rich-editor-source:focus { border-color: #79afe8; box-shadow: 0 0 0 3px rgba(13,87,199,.09); }
.rich-editor-canvas:empty::before { content: attr(data-placeholder); color: #9aa8ba; pointer-events: none; }
.rich-editor-canvas p { margin: 0 0 22px; }
.rich-editor-canvas h2, .rich-editor-canvas h3 { margin: 30px 0 13px; color: #072d61; line-height: 1.2; }
.rich-editor-canvas h2 { font-size: 27px; }
.rich-editor-canvas h3 { font-size: 21px; }
.rich-editor-canvas ul, .rich-editor-canvas ol { margin: 0 0 22px; padding-left: 28px; }
.rich-editor-canvas li { margin-bottom: 7px; }
.rich-editor-canvas blockquote { margin: 24px 0; padding: 15px 18px; border-left: 4px solid var(--yellow); background: #f7faff; color: #425a75; font-size: 18px; font-style: italic; }
.rich-editor-canvas a { color: var(--blue); text-decoration: underline; }
.rich-editor-canvas hr { margin: 30px 0; border: 0; border-top: 1px solid var(--line); }
.rich-editor-plain, .admin-form textarea.rich-editor-plain { display: none; width: 100%; min-height: 420px; max-height: 680px; padding: clamp(18px, 3vw, 32px); resize: vertical; border: 1px solid var(--line); border-radius: 0; outline: 0; background: #fff; color: #24374d; font-family: Inter, Arial, Roboto, sans-serif !important; font-size: 17px; font-weight: 400; line-height: 1.8; }
.rich-editor-plain:focus { border-color: #79afe8; box-shadow: 0 0 0 3px rgba(13,87,199,.09); }
.rich-editor.plain-mode .rich-editor-toolbar, .rich-editor.plain-mode .rich-editor-canvas { display: none; }
.rich-editor.plain-mode .rich-editor-plain, .admin-form .rich-editor.plain-mode textarea.rich-editor-plain { display: block; }
.rich-editor-status { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; background: #f8fafd; color: var(--muted); font-size: 8px; font-weight: 700; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-grid > aside.panel, .admin-grid > aside > .panel:first-child { position: static; }
  .insights-grid { grid-template-columns: 1fr; }
  .order-stats { grid-template-columns: 1fr 1fr; }
  .order-toolbar { flex-wrap: wrap; }
  #orderDateFilter { margin-left: 0; }
}

@media (max-width: 1100px) {
  .admin-shell { display: block; }
  .sidebar { position: fixed; left: -292px; width: 276px; box-shadow: 20px 0 50px rgba(0,0,0,.25); transition: left .22s ease; }
  .admin-shell.sidebar-collapsed { display: block; }
  .admin-shell.sidebar-collapsed .sidebar { padding: 22px 16px 18px; }
  .admin-shell.sidebar-collapsed .sidebar-brand { justify-content: flex-start; padding: 3px 8px 23px; }
  .admin-shell.sidebar-collapsed .sidebar-brand > div, .admin-shell.sidebar-collapsed .nav-label, .admin-shell.sidebar-collapsed .admin-identity { display: block; }
  .admin-shell.sidebar-collapsed .admin-nav a > span:not(.nav-icon) { display: inline; }
  .admin-shell.sidebar-collapsed .sidebar-links { display: flex; }
  .admin-shell.sidebar-collapsed .nav-group { margin-bottom: 15px; }
  .admin-shell.sidebar-collapsed .admin-nav a { justify-content: flex-start; padding: 9px 12px; }
  .admin-shell.sidebar-collapsed .nav-icon { width: 22px; height: 22px; }
  .admin-shell.sidebar-collapsed .nav-count { position: static; min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; font-size: 9px; }
  .admin-shell.sidebar-collapsed .sidebar-footer { grid-template-columns: 38px 1fr; justify-items: stretch; padding: 16px 8px 2px; }
  .sidebar-collapse { display: none; }
  .sidebar.open { left: 0; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 35; border: 0; background: rgba(2,12,31,.55); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
  .sidebar-overlay.visible { opacity: 1; visibility: visible; }
  .mobile-nav-toggle { display: grid; flex: 0 0 42px; position: relative; z-index: 2; }
  .topbar-site-link, .command-button kbd { display: none; }
  .topbar-primary-action { width: 38px; padding: 0; justify-content: center; font-size: 0; }
  .topbar-primary-action span { font-size: 18px; }
  .command-button { width: 42px; justify-content: center; padding: 0; font-size: 0; }
  .command-button span { font-size: 18px; }
  .admin-topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 78px; gap: 10px; padding: 14px max(14px, env(safe-area-inset-right)) 14px max(17px, env(safe-area-inset-left)); overflow: visible; }
  .admin-topbar > div:first-child { min-width: 0; overflow: hidden; }
  .topbar-actions { min-width: 0; flex: 0 0 auto; gap: 6px; }
  .admin-topbar h1 { font-size: 20px; }
  .admin-topbar p { max-width: 235px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .notification-panel { position: fixed; top: 74px; right: 12px; left: 12px; width: auto; max-height: calc(100vh - 90px); overflow-y: auto; }
  .admin-content { padding: 18px 14px 40px; }
  .dashboard-welcome { align-items: flex-start; flex-direction: column; padding: 22px; }
  .dashboard-welcome h2 { font-size: 23px; }
  .stats-grid, .form-grid { grid-template-columns: 1fr; }
  .panel { padding: 16px; border-radius: 15px; }
  .panel-head { align-items: flex-start; }
  .table-search { width: 100%; order: 5; }
  .filter-bar { align-items: stretch; }
  .filter-bar input, .filter-bar select, .filter-bar button { width: 100%; }
  .news-admin-filters a { width: 100%; }
  .news-editor-actions { flex-direction: column; }
  .mini-stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .mini-stats article { padding: 13px; }
  .mini-stats strong { font-size: 20px; }
  .order-toolbar { align-items: stretch; }
  .order-search { width: 100%; }
  .order-tabs { width: 100%; overflow-x: auto; }
  .order-tabs button { flex: 1 0 auto; justify-content: center; }
  #orderDateFilter { width: 100%; }
  .order-table-footer { flex-direction: column; }
  .order-modal { padding: 8px; }
  .order-modal-dialog { max-height: 96vh; border-radius: 15px; }
  .order-modal-body { padding: 10px; }
  .admin-invoice-sheet { padding: 16px; }
  .invoice-customer-grid { flex-direction: column; }
  .invoice-customer-grid > div { width: 100%; }
  .admin-footer { flex-direction: column; }
}

@media (max-width: 540px) {
  .command-button { display: none; }
  .admin-topbar p { max-width: 180px; }
}

@media (max-width: 420px) {
  .stat-card { padding: 16px; }
  .dashboard-welcome .primary-button { width: 100%; }
  .admin-topbar .eyebrow { display: none; }
  .mini-stats { grid-template-columns: 1fr; }
  .feed-item { grid-template-columns: 34px minmax(0,1fr); }
  .feed-value { grid-column: 2; justify-items: start; }
  .stock-alert { grid-template-columns: 1fr; }
  .order-stats { grid-template-columns: 1fr; }
  .admin-invoice-head, .invoice-title-row { align-items: flex-start; flex-direction: column; }
  .invoice-title-row > div:last-child { text-align: left; }
  .invoice-total-row { display: grid; grid-template-columns: 1fr 1fr; }
  .admin-invoice-sheet > footer { flex-direction: column; }
  .game-form-preview { grid-template-columns: 1fr 32px 1fr; padding: 13px 8px; }
  .preview-logo { width: 58px; height: 58px; }
  .preview-logo img { width: 54px; height: 54px; }
}

/* Global typography */
html,
body,
body *,
body *::before,
body *::after,
button,
input,
select,
textarea {
  font-family: Inter, Arial, Roboto, sans-serif !important;
}

/* User management */
.user-management-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.correspondent-management-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.user-management-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(350px, .65fr);
  align-items: start;
}

.member-management-grid {
  margin-top: 24px;
}

.user-management-grid aside.panel {
  position: sticky;
  top: 116px;
}

.user-management-empty {
  display: grid;
  justify-items: center;
  padding: 42px 20px;
  text-align: center;
}

.user-management-empty > span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  border-radius: 17px;
  background: #edf5ff;
  color: var(--blue);
  font-size: 24px;
}

.user-management-empty strong {
  color: var(--navy);
}

.user-management-empty p {
  max-width: 310px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.role-hierarchy-panel {
  margin-bottom: 24px;
}

.role-hierarchy-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.role-level {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f8fafd;
}

.role-level > b {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  border-radius: 9px;
  background: #e8f1ff;
  color: var(--blue);
  font-size: 11px;
}

.role-level.super {
  border-color: #e9c32d;
  background: linear-gradient(145deg, #fffdf2, #fff8d2);
}

.role-level.super > b {
  background: var(--yellow);
  color: var(--navy);
}

.role-level strong {
  color: var(--navy);
  font-size: 13px;
}

.role-level p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.role-level code {
  color: var(--blue);
  font-size: inherit;
  font-weight: 750;
}

@media (max-width: 1350px) {
  .role-hierarchy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1250px) {
  .user-management-grid {
    grid-template-columns: 1fr;
  }

  .user-management-grid aside.panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .user-management-stats,
  .correspondent-management-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-hierarchy-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .user-management-stats,
  .correspondent-management-stats {
    grid-template-columns: 1fr;
  }
}

/* Cross-platform responsive hardening */
img,
svg,
video {
  max-width: 100%;
}

.admin-main,
.admin-content,
.panel,
.panel-head > div,
.topbar-actions {
  min-width: 0;
}

.table-wrap,
.order-table-wrap,
.invoice-items-wrap {
  max-width: 100%;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1180px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .sidebar {
    left: min(-92vw, -320px);
    width: min(88vw, 320px);
    max-width: 320px;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
  }

  .sidebar.open {
    left: 0;
  }

  .admin-main {
    width: 100%;
  }

  .admin-topbar {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full,
  .check-label {
    grid-column: 1;
  }

  .admin-grid > aside.panel,
  .user-management-grid aside.panel,
  .newsroom-editor {
    position: static;
  }

  .table-wrap {
    position: relative;
  }

  .admin-table {
    min-width: 680px;
  }

  .admin-table th,
  .admin-table td {
    padding: 11px;
  }

  .primary-button,
  .secondary-button,
  .danger-button,
  .icon-button,
  .mobile-nav-toggle,
  .notification-button {
    min-height: 42px;
  }

  .row-actions .icon-button,
  .row-actions .danger-button,
  .row-actions .secondary-button {
    min-height: 36px;
  }
}

@media (max-width: 760px) {
  .admin-content {
    padding: 16px 12px 34px;
  }

  .admin-topbar {
    min-height: 72px;
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .admin-topbar h1 {
    font-size: clamp(18px, 5vw, 21px);
  }

  .admin-topbar p {
    max-width: min(44vw, 240px);
  }

  .topbar-actions {
    gap: 5px;
  }

  .mobile-nav-toggle,
  .notification-button,
  .command-button,
  .topbar-primary-action {
    width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 10px;
  }

  .panel {
    padding: 15px;
    border-radius: 14px;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-head > a,
  .panel-head > .secondary-button,
  .panel-head > .panel-actions {
    align-self: stretch;
  }

  .panel-head > a,
  .panel-head > .secondary-button {
    width: 100%;
  }

  .panel-actions {
    flex-wrap: wrap;
  }

  .panel-actions > * {
    flex: 1 1 auto;
  }

  .filter-bar {
    padding: 10px;
  }

  .filter-bar input,
  .filter-bar select,
  .filter-bar button,
  .filter-bar a {
    min-width: 0;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card strong {
    font-size: 23px;
  }

  .dashboard-welcome,
  .newsroom-welcome {
    min-height: 0;
    padding: 20px;
    border-radius: 17px;
  }

  .dashboard-welcome h2,
  .newsroom-welcome h2 {
    font-size: 22px;
  }

  .dashboard-welcome p,
  .newsroom-welcome p {
    line-height: 1.55;
  }

  .mini-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-table {
    min-width: 640px;
  }

  .highlight-admin-card-cell {
    grid-template-columns: 60px minmax(130px, 1fr);
  }

  .highlight-admin-card-cell img {
    width: 60px;
    height: 46px;
  }

  .account-delete-form {
    align-items: stretch;
    flex-direction: column;
  }

  .account-delete-form p small {
    max-width: none;
  }

  .account-delete-form .danger-button {
    width: 100%;
  }

  .rich-editor-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .rich-editor-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .rich-editor-toolbar button,
  .rich-editor-toolbar select {
    flex: 0 0 auto;
  }

  .rich-source-toggle {
    margin-left: 0;
  }

  .rich-editor-canvas,
  .rich-editor-plain,
  .admin-form textarea.rich-editor-plain {
    min-height: 340px;
    padding: 18px;
    font-size: 16px;
  }

  .admin-footer {
    align-items: flex-start;
    padding: 15px 12px max(15px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 520px) {
  .admin-topbar p,
  .command-button,
  .topbar-site-link {
    display: none;
  }

  .admin-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-topbar .eyebrow {
    display: block;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stats-grid,
  .newsroom-stats,
  .mini-stats,
  .user-management-stats,
  .correspondent-management-stats,
  .order-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-welcome,
  .newsroom-welcome {
    gap: 16px;
  }

  .dashboard-welcome .primary-button,
  .newsroom-welcome .secondary-button {
    width: 100%;
  }

  .panel {
    padding: 13px;
    margin-bottom: 14px;
  }

  .panel-head h2 {
    font-size: 16px;
  }

  .admin-table {
    min-width: 590px;
  }

  .admin-form {
    gap: 12px;
  }

  .admin-form input,
  .admin-form select,
  .admin-form textarea,
  .filter-bar input,
  .filter-bar select {
    min-height: 44px;
    padding: 11px;
    font-size: 16px;
  }

  .admin-form textarea {
    min-height: 130px;
  }

  .news-editor-actions,
  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .news-editor-actions > *,
  .form-actions > * {
    width: 100%;
  }

  .auth-page {
    align-items: start;
    padding: max(18px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom));
  }

  .auth-card {
    padding: 24px 19px;
    border-radius: 20px;
  }

  .auth-card h1 {
    font-size: 27px;
  }

  .order-modal {
    padding: 0;
  }

  .order-modal-dialog {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
  }

  .command-palette {
    padding: 8px;
  }

  .command-dialog {
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .sidebar {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .sidebar-brand {
    padding-bottom: 12px;
  }

  .admin-nav {
    padding-top: 10px;
  }

  .nav-group {
    margin-bottom: 9px;
  }

  .admin-nav a {
    min-height: 38px;
    padding-top: 7px;
    padding-bottom: 7px;
  }
}
