:root {
  --ink: #14283a;
  --muted: #627484;
  --paper: #ffffff;
  --surface: #f3f7fa;
  --line: #d8e2e9;
  --primary: #087e8b;
  --primary-dark: #065f69;
  --accent: #f5a623;
  --danger: #b8323e;
  --success: #247a52;
  --shadow: 0 14px 40px rgba(20, 40, 58, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--surface); }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { min-height: 72px; padding: 0 4vw; display: flex; align-items: center; gap: 2rem; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; font-size: 1.05rem; color: var(--ink); white-space: nowrap; }
.topbar nav { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
.topbar nav a, .account { font-size: .9rem; }
.account { display: flex; align-items: center; gap: .75rem; white-space: nowrap; }
.container { width: min(1180px, 92vw); margin: 2.5rem auto 4rem; min-height: calc(100vh - 190px); }
.site-footer { display: flex; align-items: center; justify-content: center; gap: 1.2rem; flex-wrap: wrap; text-align: center; color: var(--muted); font-size: .82rem; padding: 1.5rem; }
.powered-by { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); font-weight: 700; }
.powered-by img { display: block; height: 34px; width: auto; max-width: 180px; object-fit: contain; }
h1, h2 { letter-spacing: -.025em; margin-top: 0; }
h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); margin-bottom: .6rem; }
h2 { font-size: 1.25rem; }
p { line-height: 1.6; }
.muted, small { color: var(--muted); }
.eyebrow { color: var(--primary-dark); text-transform: uppercase; letter-spacing: .13em; font-size: .73rem; font-weight: 800; margin: 0 0 .5rem; }
.page-heading, .hero-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.page-heading, .hero-heading { margin-bottom: 1.8rem; }
.hero-heading { padding: 2rem 0; }
.panel, .auth-card, .narrow-card, .device-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.panel { padding: 1.4rem; margin-bottom: 1.4rem; }
.auth-card, .narrow-card { width: min(470px, 100%); padding: 2.2rem; margin: 7vh auto; }
.error-card { text-align: center; }
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.customer-stats { grid-template-columns: repeat(2, minmax(200px, 320px)); }
.stat-card { display: flex; flex-direction: column; padding: 1.25rem; background: linear-gradient(145deg,#fff,#f8fbfc); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); box-shadow: var(--shadow); }
.stat-card:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-1px); }
.stat-card strong { font-size: 2rem; }
.stat-card span { color: var(--muted); font-size: .88rem; }
.stacked-form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
label { display: flex; flex-direction: column; gap: .45rem; font-weight: 700; font-size: .9rem; }
input, select, textarea { width: 100%; padding: .75rem .85rem; border: 1px solid #b9c9d3; border-radius: 8px; color: var(--ink); background: #fff; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(8,126,139,.18); border-color: var(--primary); }
textarea { resize: vertical; }
.check { flex-direction: row; align-items: center; }
.check input { width: auto; }
.form-actions, .button-group { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.button { display: inline-flex; justify-content: center; align-items: center; padding: .72rem 1rem; border-radius: 8px; border: 1px solid transparent; font-weight: 750; cursor: pointer; font: inherit; }
.button:hover { text-decoration: none; }
.primary { background: var(--primary); color: white; }
.primary:hover { background: var(--primary-dark); }
.secondary { border-color: var(--line); background: white; color: var(--ink); }
.inline-form { display: inline; margin: 0; }
.link-button { appearance: none; border: 0; background: none; color: var(--primary-dark); padding: 0; cursor: pointer; font: inherit; }
.danger-text { color: var(--danger); }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button:disabled:hover { text-decoration: none; }
.alert { border-radius: 9px; padding: .85rem 1rem; margin-bottom: 1.2rem; border: 1px solid; }
.alert-success { background: #e6f5ed; border-color: #a8d7bd; color: #155d3c; }
.alert-danger { background: #fff0f1; border-color: #e7b2b7; color: #8f202b; }
.alert-warning { background: #fff7e3; border-color: #edd496; color: #704d00; }
.status-list { display: grid; gap: .75rem; margin: .8rem 0 0; }
.status-item { border-top: 1px solid rgba(112,77,0,.22); padding-top: .75rem; }
.status-item:first-child { border-top: 0; padding-top: 0; }
.status-item strong { display: block; }
.status-meta { color: var(--muted); font-size: .82rem; margin-top: .2rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; text-align: left; }
th, td { padding: .85rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.dense { font-size: .85rem; }
.actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 2.2rem; }
.badge { display: inline-block; padding: .26rem .55rem; border-radius: 99px; font-size: .72rem; font-weight: 750; }
.badge.success { color: #155d3c; background: #dff3e8; }
.badge.danger { color: #8f202b; background: #ffe4e6; }
.badge.warning { color: #704d00; background: #fff0bd; }
.badge.neutral { color: #596875; background: #edf1f4; }
code, pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .84em; }
pre { max-width: 34rem; max-height: 14rem; overflow: auto; white-space: pre-wrap; }
.filter-panel { padding: 1rem 1.4rem; }
.horizontal-form { display: flex; gap: 1rem; align-items: end; }
.horizontal-form label { min-width: 280px; }
.card-grid, .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.device-card { padding: 1.5rem; position: relative; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #37a56e; position: absolute; right: 1.3rem; top: 1.3rem; box-shadow: 0 0 0 5px #dff3e8; }
dl { margin-bottom: 1.2rem; }
dt { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; margin-top: .8rem; }
dd { margin: .25rem 0 0; }
.detail-list { display: grid; grid-template-columns: 1fr 1.4fr; gap: .65rem 1rem; }
.detail-list dt { margin: 0; }
.result-highlight { background: linear-gradient(120deg, #0b5361, #087e8b); color: white; border-radius: 16px; padding: 1.7rem 2rem; margin-bottom: 1.4rem; display: flex; align-items: center; justify-content: space-between; }
.result-highlight strong { font-size: clamp(2rem, 5vw, 3.2rem); }
.info-box, .report-note { background: #eaf5f6; color: #23525a; border-radius: 9px; padding: .8rem 1rem; font-size: .88rem; }
.preserve-lines { white-space: pre-line; }
@media (max-width: 900px) {
  .topbar { align-items: flex-start; padding-top: 1rem; padding-bottom: 1rem; flex-wrap: wrap; gap: .8rem; }
  .topbar nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .account { margin-left: auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 650px) {
  .container { width: min(94vw, 1180px); margin-top: 1.5rem; }
  .page-heading, .hero-heading, .section-heading, .result-highlight { align-items: flex-start; flex-direction: column; gap: .9rem; }
  .form-grid, .card-grid, .detail-grid, .customer-stats { grid-template-columns: 1fr; }
  .auth-card, .narrow-card { padding: 1.4rem; margin-top: 3vh; }
  .account span { display: none; }
  .powered-by img { height: 28px; max-width: 150px; }
}

