:root {
  color-scheme: light;
  --navy: #092f3e;
  --navy-2: #12495c;
  --teal: #08a99a;
  --teal-soft: #e7f8f5;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --text: #17333d;
  --muted: #6d7e85;
  --line: #dfe7ea;
  --green: #16825f;
  --green-soft: #e8f6f0;
  --yellow: #a56800;
  --yellow-soft: #fff4d8;
  --red: #c43b46;
  --red-soft: #fdecee;
  --shadow: 0 14px 35px rgba(19, 49, 62, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 5px; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; color: #fff; background: linear-gradient(145deg, var(--teal), var(--navy-2)); font-size: 30px; font-weight: 850; box-shadow: 0 12px 24px rgba(8,169,154,.2); }
.brand-mark.small { width: 43px; height: 43px; border-radius: 13px; font-size: 23px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: radial-gradient(circle at 15% 15%, #d8f4ef 0, transparent 34%), linear-gradient(135deg, #f7fafb, #edf4f6); }
.login-card { width: min(100%, 440px); padding: 42px; background: rgba(255,255,255,.94); border: 1px solid rgba(255,255,255,.9); border-radius: 28px; box-shadow: 0 28px 70px rgba(9,47,62,.14); }
.login-card .brand-mark { margin-bottom: 28px; }
.login-card .muted { margin-bottom: 30px; line-height: 1.55; }
label { display: block; margin: 0 0 17px; font-size: 13px; font-weight: 700; }
input, select { width: 100%; margin-top: 7px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); outline: none; transition: .18s; }
input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(8,169,154,.1); }
.primary-button, .secondary-button { border: 0; border-radius: 11px; padding: 11px 15px; font-weight: 750; }
.primary-button { width: 100%; margin-top: 7px; color: #fff; background: var(--navy); }
.primary-button:hover { background: var(--navy-2); }
.secondary-button { color: var(--navy); background: #edf3f5; }
.secondary-button:hover { background: #e3ecef; }
.warning-button, .danger-button { border: 0; border-radius: 11px; padding: 11px 15px; font-weight: 750; }
.warning-button { color: #6b4300; background: #fff1c7; }
.danger-button { color: #9d1c2c; background: var(--red-soft); }
.warning-button:disabled, .danger-button:disabled, .secondary-button:disabled, .primary-button:disabled { opacity: .5; cursor: default; }
.form-error { padding: 11px 13px; border-radius: 10px; color: var(--red); background: var(--red-soft); font-size: 13px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 235px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 17px 20px; display: flex; flex-direction: column; color: #fff; background: linear-gradient(180deg, var(--navy), #062631); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 19px; }
.sidebar-brand span { margin-top: 2px; color: #8db0ba; font-size: 12px; }
nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 13px; border: 0; border-radius: 11px; color: #b7cdd3; background: transparent; text-align: left; font-weight: 700; }
.nav-item span { width: 20px; font-size: 19px; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.1); }
.sidebar-foot { margin-top: auto; padding: 17px 10px 0; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-foot p { margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.text-button { padding: 0; border: 0; color: #8db0ba; background: none; font-size: 12px; }
.topbar { min-height: 105px; padding: 24px clamp(20px, 4vw, 46px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(255,255,255,.82); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.top-actions { display: flex; align-items: center; gap: 13px; font-size: 12px; }
.content { padding: 30px clamp(20px, 4vw, 46px) 55px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 37px; }
.metric-card { min-height: 125px; padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); box-shadow: var(--shadow); }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-card strong { display: block; margin-top: 16px; color: var(--navy); font-size: 31px; letter-spacing: -.04em; }
.section-heading, .panel-header { display: flex; align-items: end; justify-content: space-between; gap: 15px; }
.section-heading { margin: 0 0 15px; }
.section-heading > p { margin-bottom: 2px; font-size: 12px; }
.service-grid { display: grid; grid-template-columns: repeat(5, minmax(160px, 1fr)); gap: 13px; margin-bottom: 34px; }
.service-card { min-height: 170px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.service-top { display: flex; justify-content: space-between; gap: 10px; }
.service-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--navy); background: #edf3f5; font-weight: 850; }
.status-dot { width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: #94a3a8; box-shadow: 0 0 0 5px #eef1f2; }
.status-dot.healthy { background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
.status-dot.degraded { background: #e0a11b; box-shadow: 0 0 0 5px var(--yellow-soft); }
.status-dot.unavailable { background: var(--red); box-shadow: 0 0 0 5px var(--red-soft); }
.service-card h3 { margin: 19px 0 8px; font-size: 15px; }
.service-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.service-stats { margin-top: 12px; display: flex; gap: 10px; font-size: 11px; font-weight: 750; }
.ok { color: var(--green); } .bad { color: var(--red); }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); box-shadow: var(--shadow); }
.incident-list { margin-top: 15px; }
.incident-row { display: grid; grid-template-columns: 13px 1fr auto; gap: 13px; align-items: center; padding: 14px 3px; border-top: 1px solid var(--line); }
.incident-row:first-child { border-top: 0; }
.incident-row .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.incident-row .dot.history-ok { background: var(--green); }
.incident-row strong { display: block; margin-bottom: 3px; font-size: 13px; }
.incident-row small { color: var(--muted); }
.empty-state { padding: 28px 10px; color: var(--muted); text-align: center; }
.customer-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) 200px 170px; gap: 13px; margin-bottom: 17px; padding: 15px; }
.customer-toolbar select, .customer-toolbar input { margin: 0; }
.search-field { position: relative; margin: 0; }
.search-field span { position: absolute; left: 14px; top: 9px; color: var(--muted); font-size: 21px; }
.search-field input { padding-left: 40px; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel .panel-header { padding: 22px; }
.count-pill { min-width: 34px; padding: 6px 10px; border-radius: 999px; color: var(--teal); background: var(--teal-soft); text-align: center; font-size: 12px; font-weight: 800; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); background: #f9fbfb; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
td { font-size: 12px; }
.user-cell strong, .user-cell span { display: block; }
.user-cell span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; color: var(--muted); background: #eef2f3; font-size: 10px; font-weight: 800; }
.badge.green { color: var(--green); background: var(--green-soft); }
.badge.yellow { color: var(--yellow); background: var(--yellow-soft); }
.badge.red { color: var(--red); background: var(--red-soft); }
.row-button { padding: 7px 10px; border: 0; border-radius: 9px; color: var(--navy); background: #edf3f5; font-weight: 800; }
.pagination { padding: 15px 20px; display: flex; align-items: center; justify-content: flex-end; gap: 13px; border-top: 1px solid var(--line); font-size: 12px; }
.pagination button:disabled { opacity: .45; cursor: default; }
.backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(4,25,33,.38); backdrop-filter: blur(2px); }
.detail-panel { position: fixed; z-index: 21; top: 0; right: 0; width: min(520px, 100%); height: 100vh; overflow-y: auto; background: #f7f9fa; box-shadow: -22px 0 55px rgba(4,25,33,.18); }
.detail-head { position: sticky; top: 0; z-index: 2; padding: 26px; display: flex; justify-content: space-between; gap: 15px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.detail-head h2 { font-size: 24px; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 11px; color: var(--navy); background: #edf3f5; font-size: 24px; }
.detail-body { padding: 22px; }
.detail-section { margin-bottom: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.detail-section h3 { margin-bottom: 14px; font-size: 14px; }
.detail-kv { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12px; }
.detail-kv:first-of-type { border-top: 0; }
.detail-kv span { color: var(--muted); }
.control-note { margin: -5px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.detail-section label { display: block; margin: 10px 0 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.detail-section label input { margin-top: 5px; padding: 10px 11px; }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.control-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.control-actions .secondary-button { width: auto; margin: 0; }
.detail-section .form-error { margin-top: 12px; }
.allowance { margin: 12px 0; }
.allowance-top { display: flex; justify-content: space-between; font-size: 11px; font-weight: 750; }
.progress { height: 7px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: #e8edef; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #48c6ba); }
.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; padding: 12px 16px; border-radius: 11px; color: #fff; background: var(--navy); box-shadow: var(--shadow); font-size: 12px; }
.maintenance-intro { display: grid; grid-template-columns: 1fr minmax(330px, 520px); gap: 30px; align-items: center; margin-bottom: 30px; }
.maintenance-intro .muted { margin: 8px 0 0; max-width: 650px; line-height: 1.55; }
.maintenance-auth { display: grid; grid-template-columns: 1fr 170px; gap: 12px; }
.maintenance-auth label { margin: 0; color: var(--muted); font-size: 11px; }
.maintenance-auth input { margin-top: 5px; }
.maintenance-actions-panel { margin-bottom: 22px; }
.safe-action-row, .maintenance-job { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 16px 2px; border-top: 1px solid var(--line); }
.safe-action-row { margin-top: 15px; }
.safe-action-row strong, .maintenance-job strong { display: block; font-size: 13px; }
.safe-action-row p, .maintenance-job p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.maintenance-job-list { margin-top: 14px; }
.maintenance-job-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.maintenance-job .secondary-button { min-width: 150px; }
.maintenance-history-panel { margin-top: 22px; }
@media (max-width: 1050px) {
  .service-grid { grid-template-columns: repeat(3, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 14px; flex-direction: row; align-items: center; }
  .sidebar-brand { padding: 0; }
  .sidebar nav { margin-left: auto; display: flex; }
  .nav-item { width: auto; padding: 10px; }
  .nav-item span { display: none; }
  .sidebar-foot { display: none; }
  .topbar { min-height: auto; padding: 19px; align-items: start; }
  .top-actions .muted { display: none; }
  .content { padding: 20px 14px 40px; }
  .metric-grid, .service-grid { grid-template-columns: 1fr 1fr; }
  .customer-toolbar { grid-template-columns: 1fr; }
  .maintenance-intro { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .login-card { padding: 28px 23px; border-radius: 22px; }
  .metric-grid, .service-grid { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 24px; }
  .secondary-button { padding: 10px; }
  .section-heading > p { display: none; }
  .control-grid { grid-template-columns: 1fr; }
  .maintenance-auth { grid-template-columns: 1fr; }
  .safe-action-row, .maintenance-job { grid-template-columns: 1fr; }
}
