:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #15263b;
  background: #f2f5f8;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f2f5f8; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; position: relative; overflow: hidden; background: linear-gradient(145deg, #eef4f8 0%, #f8fafc 45%, #eef2f6 100%); }
.login-orbit { position: absolute; border-radius: 999px; filter: blur(4px); opacity: .55; }
.orbit-one { width: 430px; height: 430px; background: radial-gradient(circle, rgba(16,145,198,.18), transparent 68%); top: -180px; right: -100px; }
.orbit-two { width: 500px; height: 500px; background: radial-gradient(circle, rgba(184,48,64,.14), transparent 68%); bottom: -210px; left: -160px; }
.login-card { width: min(440px, 100%); position: relative; z-index: 2; background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.9); border-radius: 22px; padding: 34px; box-shadow: 0 28px 75px rgba(36,54,76,.16); }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand h1 { margin: 0; font-size: 27px; letter-spacing: -.8px; }
.login-brand p { margin: 2px 0 0; color: #65758a; font-size: 14px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; color: white; background: linear-gradient(145deg, #009fdb, #087daf); font-weight: 900; box-shadow: 0 7px 16px rgba(0,159,219,.25); }
.brand-mark.large { width: 54px; height: 54px; font-size: 25px; border-radius: 15px; }
.login-divider { height: 1px; background: #e7edf3; margin: 26px 0; }
.login-card h2 { margin: 0 0 4px; font-size: 24px; }
.muted { color: #6d7b8c; margin: 0 0 22px; }
label { display: grid; gap: 7px; color: #35465a; font-size: 13px; font-weight: 700; }
.login-card form { display: grid; gap: 16px; }
input, select { width: 100%; padding: 11px 12px; border: 1px solid #ced8e2; border-radius: 9px; background: white; color: #15263b; outline: none; }
input:focus, select:focus { border-color: #1091c6; box-shadow: 0 0 0 3px rgba(16,145,198,.12); }
.button { border: 0; border-radius: 9px; padding: 10px 15px; font-weight: 750; transition: .16s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: #b83040; color: white; box-shadow: 0 8px 18px rgba(184,48,64,.2); }
.button.primary:hover { background: #9f2636; }
.button.secondary { background: #e7f5fb; color: #077ba8; }
.button.ghost { border: 1px solid #dce4ec; background: white; color: #4e5f73; }
.button.full { width: 100%; padding: 12px; margin-top: 2px; }
.button:disabled { opacity: .7; cursor: default; transform: none; }
.error-box { border: 1px solid #f2bbc2; background: #fff1f3; color: #a22233; border-radius: 9px; padding: 10px 12px; font-size: 13px; }
.test-logins { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e7edf3; display: grid; gap: 8px; }
.test-logins p { margin: 0 0 2px; color: #5b6c7f; font-size: 12px; }
.test-logins button { text-align: left; border: 1px solid #d9e3ec; background: #f8fafc; padding: 10px 12px; border-radius: 10px; display: flex; justify-content: space-between; gap: 12px; color: #26384c; }
.test-logins button:hover { border-color: #79bdd8; background: #f1f9fc; }
.test-logins small { color: #728195; }
.privacy-note { font-size: 11px; text-align: center; color: #8793a1; margin: 16px 0 0; }

.topbar { height: 70px; padding: 0 28px; background: white; border-bottom: 1px solid #dce4eb; display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 20; }
.brand-button { border: 0; background: transparent; display: flex; align-items: center; gap: 11px; color: #15263b; padding: 0; }
.brand-button > span:last-child { display: grid; text-align: left; }
.brand-button strong { font-size: 19px; letter-spacing: -.4px; }
.brand-button small { color: #748295; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.signed-in { display: grid; text-align: right; font-size: 12px; }
.signed-in small { color: #778699; }
.role-pill { display: inline-flex; align-items: center; justify-content: center; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .7px; }
.role-pill.manager { color: #982739; background: #fce9ec; }
.role-pill.dealer { color: #0879a5; background: #e5f5fb; }
.preview-banner { background: #fff8db; color: #67551a; border-bottom: 1px solid #ebdda1; text-align: center; padding: 7px 14px; font-size: 12px; }
.top-navigation { position: sticky; top: 70px; z-index: 19; padding: 6px 28px; overflow-x: auto; background: #15263b; box-shadow: 0 2px 7px rgba(15,35,53,.14); }
.top-navigation nav { display: flex; align-items: center; gap: 5px; width: max-content; min-width: 100%; }
.top-navigation nav button { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; border: 0; border-radius: 7px; padding: 8px 11px; background: transparent; color: #c4d0dc; font-size: 11px; font-weight: 700; white-space: nowrap; }
.top-navigation nav button > span { min-width: 16px; color: #8fa9bd; font-size: 14px; text-align: center; }
.top-navigation nav button:hover { background: rgba(255,255,255,.08); color: white; }
.top-navigation nav button.active { background: #0092c8; color: white; box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.top-navigation nav button.active > span { color: white; }
.content { min-width: 0; padding: 30px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 3px 0 0; font-size: clamp(25px, 3vw, 33px); letter-spacing: -1.05px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; font-weight: 850; color: #0092c8; }
.result-count { color: #6d7d8f; font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card { background: white; border: 1px solid #dce4eb; border-top: 4px solid #24425f; border-radius: 13px; padding: 18px; display: grid; gap: 4px; box-shadow: 0 8px 20px rgba(31,55,78,.05); }
.stat-card.red { border-top-color: #b83040; }
.stat-card.blue { border-top-color: #0092c8; }
.stat-card.gold { border-top-color: #d5a129; }
.stat-card > span { color: #6c7b8c; font-size: 12px; font-weight: 700; }
.stat-card strong { font-size: 25px; letter-spacing: -.6px; }
.stat-card small { color: #8995a3; font-size: 11px; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr); gap: 20px; }
.panel { background: white; border: 1px solid #dce4eb; border-radius: 14px; box-shadow: 0 9px 24px rgba(31,55,78,.05); overflow: hidden; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px 15px; border-bottom: 1px solid #edf1f4; }
.panel-title h2, .form-intro h2 { margin: 0; font-size: 17px; }
.panel-title p, .form-intro p { margin: 3px 0 0; color: #7b8898; font-size: 12px; }
.text-button { border: 0; background: transparent; color: #087fac; font-size: 12px; font-weight: 750; padding: 4px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: #788697; background: #f8fafb; font-size: 10px; text-transform: uppercase; letter-spacing: .65px; text-align: left; padding: 11px 14px; border-bottom: 1px solid #e9eef2; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid #edf1f4; color: #34465a; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfe; }
td strong, td small { display: block; }
td small { color: #8995a3; margin-top: 2px; font-size: 10px; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status.new { color: #a12637; background: #fce9ec; }
.status.processing { color: #087aa6; background: #e5f5fb; }
.status.complete { color: #39744d; background: #e9f6ed; }
.quick-actions { display: grid; padding: 12px; gap: 8px; }
.quick-actions button { display: grid; grid-template-columns: 38px 1fr; column-gap: 10px; text-align: left; border: 1px solid #e3e9ee; background: #fbfcfd; padding: 11px; border-radius: 10px; color: #26384c; }
.quick-actions button:hover { border-color: #8bc7dc; background: #f4fafc; }
.quick-icon { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 9px; background: #e5f5fb; color: #087fae; display: grid; place-items: center; font-size: 17px; }
.quick-actions strong { font-size: 12px; }
.quick-actions small { color: #8491a0; margin-top: 2px; font-size: 10px; }
.month-highlight { margin: 0 12px 12px; padding: 13px; background: #15263b; color: white; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; }
.month-highlight span { color: #bbc7d2; font-size: 11px; }
.month-highlight strong { font-size: 14px; }
.form-panel { max-width: 1000px; }
.form-intro { padding: 19px 21px; border-bottom: 1px solid #edf1f4; }
.order-form { padding: 22px; }
.auto-field { background: #edf8fc; border: 1px solid #cce9f3; padding: 13px 15px; border-radius: 10px; margin-bottom: 20px; display: grid; }
.auto-field span, .auto-field small { color: #6e8391; font-size: 10px; text-transform: uppercase; letter-spacing: .7px; }
.auto-field strong { margin: 3px 0; color: #087aa6; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; border-top: 1px solid #edf1f4; padding-top: 18px; }
.form-actions span { color: #7d8997; font-size: 11px; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 13px; padding: 16px; border-bottom: 1px solid #edf1f4; background: #fbfcfd; }
.empty-state { padding: 50px 20px; text-align: center; display: grid; gap: 4px; color: #7a8795; }
.empty-state strong { color: #45566a; }
.report-layout { grid-template-columns: 1fr 1fr; }
.bar-chart { display: grid; gap: 12px; padding: 20px; }
.bar-row { display: grid; grid-template-columns: 72px minmax(100px, 1fr) 28px; gap: 10px; align-items: center; font-size: 11px; color: #667689; }
.bar-row > div { height: 9px; border-radius: 999px; background: #eef2f5; overflow: hidden; }
.bar-row i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0a91c5, #41b7dc); }
.bar-row strong { color: #2b3e52; }
.invoice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.invoice-grid article { border: 1px solid #dfe7ed; border-radius: 11px; padding: 16px; background: #fbfcfd; }
.invoice-grid article > span { color: #8492a1; font-size: 10px; text-transform: uppercase; letter-spacing: .7px; }
.invoice-grid h3 { margin: 6px 0 10px; font-size: 14px; }
.invoice-grid p { color: #738195; font-size: 11px; margin: 0; }
.invoice-grid article > strong { display: block; margin: 4px 0 10px; font-size: 20px; }

@media (max-width: 980px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-column, .report-layout { grid-template-columns: 1fr; }
  .invoice-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .topbar { padding: 0 14px; }
  .signed-in, .topbar .role-pill, .reset-button { display: none; }
  .top-navigation { padding: 5px 8px; }
  .top-navigation nav button { padding: 7px 9px; font-size: 10px; }
  .content { padding: 20px 12px; }
  .page-heading { align-items: flex-start; }
  .page-heading .button { font-size: 11px; }
  .stat-grid { gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 20px; }
  .form-grid, .filters, .invoice-grid { grid-template-columns: 1fr; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .button { width: 100%; }
}

@media print {
  .topbar, .preview-banner, .database-banner, .top-navigation, .page-heading .button { display: none !important; }
  .content { padding: 0; }
  .panel { box-shadow: none; break-inside: avoid; }
}
