:root {
  color-scheme: dark;
  --paper: #070b09;
  --surface: #101713;
  --surface-2: #151e18;
  --ink: #eef5ef;
  --ink-2: #c5d2c8;
  --muted: #9ba99e;
  --line: #29372e;
  --line-dark: #3d4c42;
  --green: #91d9a5;
  --green-2: #a8e3b8;
  --green-soft: #1a3021;
  --green-soft-2: #1d2b22;
  --amber: #efbd72;
  --amber-soft: #392a18;
  --red: #ff9284;
  --red-soft: #3c211f;
  --slate-soft: #1b2520;
  --shadow: 0 12px 36px rgba(0, 0, 0, .34);
  --radius: 16px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(47,108,77,.3); outline-offset: 2px; }
.skip-link { position: fixed; z-index: 100; top: -60px; left: 10px; padding: 10px 14px; border-radius: 8px; color: #fff; background: var(--green); font-weight: 700; box-shadow: var(--shadow); }
.skip-link:focus { top: 10px; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column; width: 248px; padding: 25px 16px 18px; background: #fbfaf5; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 23px; }
.brand-mark { width: 37px; height: 37px; border-radius: 11px; display: grid; place-items: center; background: var(--green); color: #f5f3e9; }
.brand-mark svg { width: 28px; height: 28px; stroke-width: 1.5; }
.brand strong { display: block; font-size: 15px; letter-spacing: -.4px; font-weight: 800; }
.brand small { display: block; margin-top: 2px; font-size: 9px; line-height: 1.2; color: var(--muted); letter-spacing: 1.15px; font-weight: 700; }
.workspace-label, .nav-group-label { color: #9aa19a; font-size: 9px; font-weight: 800; letter-spacing: 1.15px; }
.workspace-label { padding: 0 10px 9px; }
.demo-workspace { height: 39px; margin: 0 2px 24px; padding: 0 11px; display: flex; align-items: center; gap: 8px; color: var(--ink-2); background: #f1f2ec; border: 1px solid #e9eae2; border-radius: 9px; font-size: 11px; font-weight: 600; }
.demo-workspace .live-dot { width: 7px; height: 7px; border-radius: 50%; background: #79a486; box-shadow: 0 0 0 3px #e1ebe2; }
.demo-workspace .caret { margin-left: auto; color: #98a098; font-size: 14px; }
.side-nav { display: flex; flex: 1 1 auto; flex-direction: column; gap: 4px; min-height: 0; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; }
.nav-group-label { padding: 0 11px 8px; }
.nav-group-spaced { margin-top: 19px; }
.nav-link { min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 11px; border-radius: 9px; color: #727f76; font-size: 12px; font-weight: 600; transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav-link svg { width: 17px; height: 17px; }
.nav-link:hover { background: #f2f2eb; color: var(--ink); }
.nav-link:active { transform: scale(.99); }
.nav-link.active { color: var(--green); background: #e8efe8; font-weight: 700; }
.nav-count { margin-left: auto; font-family: var(--mono); font-size: 10px; color: #78877d; }
.nav-ping { width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: #77a181; }
.sidebar-bottom { margin-top: auto; }
.isolation-mini { min-height: 60px; display: flex; align-items: center; gap: 10px; padding: 10px 10px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fffefa; }
.mini-icon { width: 29px; height: 29px; display: grid; place-items: center; color: var(--amber); background: var(--amber-soft); border-radius: 8px; }
.mini-icon svg { width: 15px; height: 15px; }
.isolation-mini strong, .profile-copy strong { display: block; font-size: 11px; font-weight: 700; }
.isolation-mini small, .profile-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.toggle-on { width: 27px; height: 15px; margin-left: auto; padding: 2px; border-radius: 99px; background: #82a98a; }
.toggle-on i { display: block; width: 11px; height: 11px; margin-left: auto; background: white; border-radius: 50%; }
.profile-row { display: flex; align-items: center; gap: 9px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.avatar { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; font-size: 10px; font-weight: 800; }
.avatar-dark { color: #f2f1e7; background: #3c5d49; }
.profile-menu { margin-left: auto; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; background: transparent; border: 0; border-radius: 8px; color: #778279; cursor: pointer; }
.icon-button:hover { background: #f0f1eb; color: var(--ink); }
.icon-button svg { width: 16px; height: 16px; }
.main-shell { min-height: 100vh; margin-left: 248px; }
.topbar { height: 72px; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 35px; background: rgba(244,243,237,.93); border-bottom: 1px solid rgba(229,230,222,.9); backdrop-filter: blur(14px); }
.crumbs { display: flex; align-items: center; gap: 9px; font-size: 12px; color: #929991; white-space: nowrap; }
.crumbs strong { color: var(--ink); font-size: 12px; font-weight: 700; }
.crumb-slash { color: #c2c7c0; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.search-box { width: min(250px, 24vw); height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 9px; background: #fbfaf6; border: 1px solid var(--line); border-radius: 8px; color: #89928b; }
.search-box svg { width: 15px; height: 15px; }
.search-box input { width: 100%; min-width: 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 11px; }
.search-box input::placeholder { color: #9aa199; }
.search-box kbd { padding: 2px 5px; color: #a4aaa2; font-family: var(--mono); font-size: 9px; border: 1px solid #e7e8e0; border-radius: 4px; background: #fffefa; }
.top-demo { display: flex; align-items: center; gap: 6px; font-size: 9px; color: #8b7556; letter-spacing: .6px; font-weight: 800; white-space: nowrap; }
.top-demo i { width: 6px; height: 6px; border-radius: 50%; background: #d09b54; }
.button { min-height: 38px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 700; white-space: nowrap; transition: background .16s ease, transform .16s ease, box-shadow .16s ease; }
.button:active { transform: translateY(1px); }
.button svg { width: 15px; height: 15px; }
.button-primary { color: #fff; background: var(--green); box-shadow: 0 2px 5px rgba(25,72,48,.12); }
.button-primary:hover { background: #174630; box-shadow: 0 4px 10px rgba(25,72,48,.16); }
.button-secondary { color: var(--green); background: #fffefa; border-color: #dfe4dc; }
.button-secondary:hover { background: #f2f6f1; border-color: #cad8cd; }
.button-quiet { color: #69766d; background: transparent; }
.button-quiet:hover { background: #f2f3ed; }
.button-danger { color: var(--red); background: var(--red-soft); border-color: #f2d9d3; }
.button-sm { min-height: 31px; padding: 0 10px; font-size: 10px; }
.main-view { max-width: 1520px; margin: 0 auto; padding: 30px 35px 48px; outline: 0; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; font-size: clamp(24px, 2.1vw, 31px); font-weight: 700; letter-spacing: -1.05px; line-height: 1.12; text-wrap: pretty; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; text-wrap: pretty; }
.heading-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.date-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 10px; color: #68756c; background: rgba(255,254,250,.7); border: 1px solid var(--line); border-radius: 8px; font-size: 10px; font-weight: 600; }
.date-chip svg { width: 14px; height: 14px; color: #8b968c; }
.demo-banner { display: flex; align-items: center; gap: 11px; padding: 12px 14px; margin-bottom: 18px; color: #725e42; background: #fbf3e5; border: 1px solid #f0e2c8; border-radius: 11px; font-size: 11px; line-height: 1.5; }
.demo-banner strong { color: #785620; letter-spacing: .4px; font-size: 9px; white-space: nowrap; }
.demo-banner .demo-badge { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border-radius: 7px; color: #946a2b; background: #f7e9cd; font-family: var(--mono); font-size: 11px; font-weight: 600; }
.demo-banner p { margin: 0; }
.demo-banner a { color: #795822; text-decoration: underline; text-underline-offset: 2px; }
.router-ops-banner { display: flex; align-items: center; gap: 11px; padding: 12px 14px; margin: -7px 0 18px; color: #275a3c; background: #eef7ef; border: 1px solid #cfe3d1; border-radius: 11px; font-size: 11px; line-height: 1.5; }
.router-ops-banner[hidden] { display: none; }
.router-ops-banner strong { color: #245239; letter-spacing: .4px; font-size: 9px; }
.router-ops-banner p { margin: 0; }
.router-ops-warning { color: #7d2b23; background: #fff0ed; border-color: #efc9c2; }
.router-ops-warning strong { color: #8b3025; }
.router-ops-warning .demo-badge { color: #922c22; background: #f8d9d3; }
.router-ops-banner .demo-badge { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border-radius: 7px; color: #286141; background: #d9ecdc; font-family: var(--mono); font-size: 11px; font-weight: 700; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.stat-card { min-height: 115px; position: relative; padding: 16px 17px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 2px 7px rgba(35,52,42,.018); overflow: hidden; }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #79857c; font-size: 10px; font-weight: 600; }
.stat-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: #4f775b; background: #eff4ee; }
.stat-icon svg { width: 15px; height: 15px; }
.stat-icon.amber { color: var(--amber); background: var(--amber-soft); }
.stat-icon.red { color: var(--red); background: var(--red-soft); }
.stat-number { margin-top: 10px; font-size: 26px; line-height: 1; font-weight: 700; letter-spacing: -1px; }
.stat-foot { display: flex; align-items: center; gap: 5px; margin-top: 8px; color: #8a948b; font-size: 9px; }
.stat-foot .good { color: #56815f; font-weight: 700; }
.stat-foot .warn { color: var(--amber); font-weight: 700; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px, .9fr); gap: 15px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(35,52,42,.025); }
.panel-header { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px; border-bottom: 1px solid #eeefe9; }
.panel-header h2 { margin: 0; font-size: 13px; letter-spacing: -.2px; font-weight: 700; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 10px; font-weight: 700; }
.text-link:hover { color: #123e29; }
.text-link svg { width: 13px; height: 13px; }
.activity-content { padding: 15px 17px 17px; }
.activity-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: #7a857c; font-size: 10px; }
.activity-topline strong { color: var(--ink); font-size: 11px; }
.connection-bars { display: grid; grid-template-columns: repeat(8, 1fr); align-items: end; gap: 9px; height: 108px; padding: 2px 5px 0; border-bottom: 1px solid var(--line); }
.bar-col { display: flex; align-items: center; flex-direction: column; justify-content: flex-end; height: 100%; gap: 7px; color: #a3aaa2; font-family: var(--mono); font-size: 8px; }
.bar-track { width: min(24px, 78%); height: calc(var(--h) * 1%); min-height: 13px; background: linear-gradient(180deg, #94b49a, #d3e0d3); border-radius: 5px 5px 1px 1px; }
.bar-col:nth-child(3n) .bar-track { background: linear-gradient(180deg, #d8a96c, #efdfc4); }
.bar-col:nth-child(5n) .bar-track { background: linear-gradient(180deg, #7c9c82, #bed0bf); }
.chart-legend { display: flex; align-items: center; gap: 15px; margin-top: 13px; color: #859087; font-size: 9px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #88a88e; }
.legend-dot.offline { background: #c5cbc3; }
.alert-panel .panel-header { border-bottom: 0; padding-bottom: 8px; }
.alert-list { padding: 0 14px 8px; }
.alert-row { display: flex; align-items: center; gap: 10px; padding: 11px 3px; border-top: 1px solid #f0f0eb; }
.alert-row:first-child { border-top: 0; }
.alert-avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; color: #8a6433; background: #f8ecd9; border-radius: 10px; font-size: 10px; font-weight: 800; }
.alert-avatar.red { color: #99544b; background: #f7e8e4; }
.alert-info { min-width: 0; flex: 1; }
.alert-info strong { display: block; overflow: hidden; color: #394a40; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.alert-info small { display: block; margin-top: 3px; color: #919990; font-size: 9px; }
.alert-amount { text-align: right; white-space: nowrap; }
.alert-amount strong { display: block; color: #7c5c35; font-family: var(--mono); font-size: 9px; }
.alert-amount small { display: block; margin-top: 3px; color: var(--red); font-size: 8px; }
.pay-row-button { padding: 5px 7px; color: var(--green); background: #eff4ee; border: 0; border-radius: 6px; cursor: pointer; font-size: 9px; font-weight: 700; }
.pay-row-button:hover { background: #e0ebe1; }
.quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 15px; }
.quick-card { min-height: 75px; display: flex; align-items: center; gap: 10px; padding: 12px; text-align: left; cursor: pointer; background: #fbfaf6; border: 1px solid var(--line); border-radius: 12px; transition: transform .18s ease, box-shadow .18s ease; }
.quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-card .stat-icon { width: 32px; height: 32px; }
.quick-card strong { display: block; font-size: 10px; }
.quick-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.section-note { display: flex; align-items: flex-start; gap: 8px; margin: 13px 0 0; color: #8d938a; font-size: 9px; line-height: 1.5; }
.section-note svg { width: 13px; height: 13px; color: #a1a79f; }
/* List pages */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.billing-selection-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.billing-selection-actions .button:disabled { opacity: .55; cursor: not-allowed; }
.billing-select { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }
.billing-recipient-list, .billing-batch-results ul { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 10px; line-height: 1.8; }
.billing-preview-list { display: grid; gap: 9px; max-height: min(56vh, 650px); overflow: auto; padding-right: 3px; }
.billing-preview-item { padding: 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.billing-preview-item summary { color: var(--ink-2); cursor: pointer; font-size: 10px; line-height: 1.5; }
.billing-preview-item summary strong { color: var(--ink); }
.billing-preview-item .bill-message { width: 100%; margin-top: 9px; }
.billing-batch-results { max-height: min(60vh, 650px); overflow: auto; }
.billing-batch-results p { margin: 0; color: var(--ink-2); font-size: 11px; }
.billing-batch-results li { margin-bottom: 8px; }
.result-count { color: #828d84; font-size: 10px; }
.filter-select, .field input, .field select, .field textarea { min-height: 38px; padding: 0 11px; color: var(--ink); background: #fffefa; border: 1px solid var(--line-dark); border-radius: 8px; font-size: 11px; }
.filter-select { min-width: 128px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.data-table th { height: 40px; padding: 0 13px; text-align: left; color: #929a92; background: #fafaf5; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 700; letter-spacing: .45px; text-transform: uppercase; white-space: nowrap; }
.data-table td { height: 62px; padding: 9px 13px; border-bottom: 1px solid #eff0eb; color: #69766d; font-size: 10px; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfcf8; }
.customer-cell { display: flex; align-items: center; gap: 9px; min-width: 148px; }
.person-avatar { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 30px; color: #4e6c55; background: #e8efe6; border-radius: 9px; font-size: 9px; font-weight: 800; }
.person-avatar.p2 { color: #8a6541; background: #f4eadb; }
.person-avatar.p3 { color: #596883; background: #e9ecf2; }
.person-avatar.p4 { color: #865f70; background: #f2e8ed; }
.person-avatar.p5 { color: #537674; background: #e5efec; }
.customer-name strong { display: block; color: #34463b; font-size: 10px; font-weight: 700; }
.customer-name small { display: block; margin-top: 3px; color: #929990; font-size: 9px; }
.mono { font-family: var(--mono); font-size: 9px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 6px; font-size: 8px; line-height: 1; font-weight: 800; letter-spacing: .15px; }
.status-pill::before { content: ''; width: 5px; height: 5px; display: block; flex: 0 0 5px; border-radius: 50%; background: currentColor; }
.status-online { color: #477452; background: #e8f1e7; }
.status-offline { color: #737e76; background: #eff1ee; }
.status-isolated { color: #a66520; background: #fff0d9; }
.access-label { display: block; margin-top: 4px; color: #929890; font-size: 8px; }
.due-soon { color: var(--amber); }
.due-late { color: var(--red); }
.row-actions { display: flex; gap: 5px; }
.table-action { min-height: 28px; padding: 0 8px; color: #65756a; background: transparent; border: 1px solid #e5e8e0; border-radius: 6px; cursor: pointer; font-size: 9px; font-weight: 700; }
.table-action:hover { color: var(--green); background: #f0f5ef; border-color: #d6e2d7; }
.table-action.primary { color: var(--green); background: #edf4ed; border-color: #e5eee3; }
.table-action.danger { color: var(--red); background: #fbefec; border-color: #f3e1dc; }
.empty-state { padding: 46px 20px; color: #89938b; text-align: center; font-size: 11px; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink-2); }
/* Voucher & payment pages */
.metric-strip { display: flex; align-items: center; gap: 23px; padding: 13px 17px; margin-bottom: 15px; background: #fafaf5; border: 1px solid var(--line); border-radius: 12px; }
.metric-item { display: flex; align-items: baseline; gap: 7px; color: #808b82; font-size: 10px; }
.metric-item strong { color: var(--ink); font-size: 15px; letter-spacing: -.3px; }
.metric-sep { width: 1px; height: 26px; background: var(--line-dark); }
.voucher-code { display: inline-block; padding: 5px 7px; color: #546458; background: #f4f6f0; border-radius: 5px; font-family: var(--mono); font-size: 9px; letter-spacing: .1px; }
.copy-button { width: 28px; height: 28px; display: inline-grid; place-items: center; margin-left: 5px; color: #7b887e; background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.copy-button:hover { background: #f1f3ed; color: var(--green); }
.copy-button svg { width: 13px; height: 13px; }
.amount-cell { color: #3d5145 !important; font-family: var(--mono); font-size: 9px !important; font-weight: 600; }
.payment-id { color: #889188; font-family: var(--mono); font-size: 9px; }
/* Map */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 275px; gap: 14px; align-items: stretch; }
.map-card { overflow: hidden; }
.map-card-header { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 15px; border-bottom: 1px solid var(--line); }
.map-title strong { display: block; font-size: 12px; }
.map-title small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.map-controls { display: flex; gap: 7px; align-items: center; }
.map-controls select { max-width: 135px; height: 31px; padding: 0 8px; color: #647168; background: #fffefa; border: 1px solid var(--line); border-radius: 7px; font-size: 9px; }
.map-frame { position: relative; height: min(65vh, 590px); min-height: 390px; background: #e7e9df; }
#mapCanvas { width: 100%; height: 100%; z-index: 1; }
.map-overlay-label { position: absolute; z-index: 500; left: 13px; top: 13px; max-width: min(360px, calc(100% - 26px)); padding: 8px 10px; color: #6d5b3d; background: rgba(255,254,250,.94); border: 1px solid rgba(232,220,197,.95); border-radius: 8px; box-shadow: 0 3px 12px rgba(42,55,44,.09); font-size: 9px; line-height: 1.45; pointer-events: none; }
.map-overlay-label strong { display: block; color: #765923; font-size: 9px; letter-spacing: .35px; }
.map-legend { position: absolute; z-index: 500; right: 12px; bottom: 12px; display: flex; gap: 10px; padding: 8px 10px; color: #657169; background: rgba(255,254,250,.95); border: 1px solid rgba(226,228,219,.9); border-radius: 8px; box-shadow: 0 3px 10px rgba(42,55,44,.08); font-size: 8px; }
.map-legend span { display: inline-flex; align-items: center; gap: 4px; }
.map-legend i { width: 7px; height: 7px; border-radius: 50%; background: #4d8a5a; }
.map-legend i.offline { background: #7a8580; }
.map-legend i.isolated { background: #d28a32; }
.map-side { display: flex; flex-direction: column; min-height: 480px; overflow: hidden; }
.map-side-head { padding: 15px; border-bottom: 1px solid var(--line); }
.map-side-head h2 { margin: 0; font-size: 12px; }
.map-side-head p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.map-customer-list { overflow-y: auto; padding: 0 12px; }
.map-customer { width: 100%; display: flex; align-items: center; gap: 9px; padding: 11px 3px; text-align: left; background: none; border: 0; border-bottom: 1px solid #f0f0eb; cursor: pointer; }
.map-customer:hover { background: #fafaf5; }
.map-customer .person-avatar { width: 28px; height: 28px; flex-basis: 28px; border-radius: 50%; }
.map-customer-copy { min-width: 0; flex: 1; }
.map-customer-copy strong { display: block; overflow: hidden; color: #3c4c41; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.map-customer-copy small { display: block; margin-top: 3px; color: #939a93; font-size: 8px; }
.map-side-foot { margin-top: auto; padding: 11px 14px; color: #868f87; background: #fafaf5; border-top: 1px solid var(--line); font-size: 8px; line-height: 1.45; }
.customer-marker-wrap { background: transparent; border: 0; }
.customer-pin { position: relative; width: 28px; height: 28px; display: grid; place-items: center; color: white; background: #4d895b; border: 3px solid rgba(255,255,255,.97); border-radius: 50% 50% 50% 4px; box-shadow: 0 2px 9px rgba(36,52,40,.3); transform: rotate(-45deg); }
.customer-pin span { font-size: 8px; line-height: 1; font-weight: 800; transform: rotate(45deg); }
.customer-pin.offline { background: #77837b; }
.customer-pin.isolated { background: #d18934; }
.leaflet-popup-content-wrapper { border-radius: 10px !important; }
.demo-popup { min-width: 150px; color: #405045; font-family: var(--font); }
.demo-popup strong { display: block; margin-bottom: 5px; font-size: 11px; }
.demo-popup span { display: block; margin: 3px 0; color: #7f8981; font-size: 9px; }
.demo-popup .status-pill { margin-top: 4px; }
/* Forms & modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(29,43,34,.38); backdrop-filter: blur(3px); animation: fade-in .15s ease both; }
.modal { width: min(100%, 500px); max-height: min(88vh, 790px); display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid rgba(255,255,255,.75); border-radius: 17px; box-shadow: 0 24px 70px rgba(21,38,27,.23); animation: rise-in .18s ease both; }
.modal.modal-wide { width: min(100%, 590px); }
.modal-header { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 16px; letter-spacing: -.4px; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.modal-close { width: 29px; height: 29px; display: grid; place-items: center; color: #7f8981; background: #f4f5ef; border: 0; border-radius: 8px; cursor: pointer; }
.modal-close svg { width: 15px; height: 15px; }
.modal-body { overflow-y: auto; padding: 17px 20px 18px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; background: #fafaf6; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #59675e; font-size: 10px; font-weight: 700; }
.field label .required { color: var(--red); }
.field input, .field select, .field textarea { width: 100%; min-height: 39px; }
.field input::placeholder { color: #a7ada5; }
.field textarea { padding: 9px 11px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(47,108,77,.14); border-color: #98b39c; }
.field-help { color: #8a948b; font-size: 9px; line-height: 1.45; }
.modal-note { padding: 10px 11px; color: #776144; background: #fbf3e6; border: 1px solid #f1e6d4; border-radius: 8px; font-size: 9px; line-height: 1.5; }
.password-wrap { display: flex; gap: 6px; }
.password-wrap input { flex: 1; }
.password-wrap button { min-width: 39px; display: grid; place-items: center; color: #77827a; background: #f5f6f1; border: 1px solid var(--line-dark); border-radius: 8px; cursor: pointer; }
.password-wrap button svg { width: 15px; height: 15px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 15px; }
.detail-item { padding: 12px 0; border-bottom: 1px solid #eff0eb; }
.detail-item small { display: block; margin-bottom: 5px; color: #8b948c; font-size: 9px; }
.detail-item strong { display: block; color: #3c4e42; font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.detail-item strong.code { font-family: var(--mono); font-size: 10px; }
.inline-error { display: none; margin: 9px 0 0; color: var(--red); font-size: 10px; }
.inline-error.show { display: block; }
.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; }
.reminder-date-form { display: flex; align-items: center; gap: 6px; }
.reminder-date-form input { width: 135px; min-height: 34px; padding: 0 7px; color: var(--ink); background: #fffefa; border: 1px solid var(--line-dark); border-radius: 7px; font-size: 9px; }
.gateway-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(230px, .65fr); gap: 14px; align-items: start; }
.gateway-card { overflow: hidden; }
.gateway-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px; }
.gateway-form > .field, .gateway-status, .credential-note, .gateway-methods, .gateway-foot { grid-column: 1 / -1; }
.copy-url-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; }
.copy-url-row input { flex: 1 1 220px; min-width: 0; width: 100%; font-family: var(--mono); font-size: 10px; }
.copy-url-row .button { flex: 0 0 auto; min-height: 38px; }
.gateway-status { display: flex; align-items: center; gap: 10px; padding: 12px; background: #f8f7f1; border: 1px solid var(--line); border-radius: 10px; }
.gateway-status-mark { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; color: #fff; background: var(--green); border-radius: 10px; font-family: var(--mono); font-size: 15px; font-weight: 700; }
.gateway-status strong, .gateway-status small { display: block; }
.gateway-status strong { color: #435449; font-size: 10px; }
.gateway-status small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.credential-note { display: grid; gap: 5px; padding: 12px; color: #725e42; background: #fbf3e5; border: 1px solid #f0e2c8; border-radius: 9px; font-size: 9px; line-height: 1.5; }
.credential-note strong { color: #785620; font-size: 10px; }
.gateway-methods { display: grid; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.gateway-methods legend { padding: 0 5px; color: #59675e; font-size: 10px; font-weight: 700; }
.gateway-methods label { display: flex; align-items: center; gap: 8px; color: #657168; font-size: 10px; }
.gateway-methods input { accent-color: var(--green); }
.gateway-foot { display: flex; align-items: center; gap: 10px; }
.gateway-foot span { color: var(--muted); font-size: 9px; }
.gateway-side { padding: 17px; }
.gateway-side h2 { margin: 0; font-size: 12px; }
.gateway-side ol { display: grid; gap: 12px; padding-left: 19px; margin: 15px 0; color: #68766c; font-size: 10px; line-height: 1.5; }
.gateway-side li::marker { color: var(--green-2); font-weight: 700; }
.gateway-side p { margin: 0; padding-top: 12px; color: #8a928a; border-top: 1px solid var(--line); font-size: 9px; line-height: 1.5; }
.bill-message { min-height: 175px; padding: 10px 11px !important; white-space: pre-wrap; line-height: 1.6; }
/* Toast */
.toast-region { position: fixed; z-index: 150; right: 22px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 240px; max-width: min(360px, calc(100vw - 32px)); display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; color: #3e5645; background: #fffefa; border: 1px solid #dce8dc; border-radius: 10px; box-shadow: 0 10px 30px rgba(32,51,39,.13); font-size: 10px; line-height: 1.45; animation: rise-in .2s ease both; }
.toast::before { content: '✓'; width: 18px; height: 18px; display: grid; place-items: center; flex: 0 0 18px; color: #fff; background: #558361; border-radius: 50%; font-size: 10px; font-weight: 800; }
.toast.warn { color: #795d34; background: #fffaf0; border-color: #f1e1c3; }
.toast.warn::before { content: '!'; background: #bd852e; }
.mobile-nav { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(7px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 1150px) {
  .sidebar { width: 218px; }
  .main-shell { margin-left: 218px; }
  .topbar { padding-inline: 24px; }
  .main-view { padding-inline: 24px; }
  .stats-grid { gap: 10px; }
  .stat-card { padding-inline: 13px; }
  .map-layout { grid-template-columns: minmax(0, 1fr) 245px; }
}
@media (max-width: 960px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .alert-panel { order: 2; }
  .quick-row { margin-top: 0; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-layout { grid-template-columns: 1fr; }
  .map-side { min-height: auto; }
  .map-customer-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 12px; max-height: 240px; }
  .map-side-foot { margin-top: 0; }
}
@media (max-width: 700px) {
  body { font-size: 13px; }
  .sidebar { display: none; }
  .main-shell { margin-left: 0; padding-bottom: 70px; }
  .topbar { height: 58px; padding: 0 15px; }
  .crumbs { gap: 6px; font-size: 10px; }
  .crumbs strong { font-size: 10px; }
  .topbar-actions { gap: 6px; }
  .search-box { width: 35px; height: 34px; padding: 0 9px; border-color: transparent; background: transparent; }
  .search-box input, .search-box kbd { display: none; }
  .search-box:focus-within { width: min(185px, 44vw); padding: 0 8px; background: #fffefa; border-color: var(--line); }
  .search-box:focus-within input { display: block; }
  .top-demo { display: none; }
  .header-add { min-height: 34px; padding: 0 9px; font-size: 9px; }
  .header-add svg { width: 14px; height: 14px; }
  .main-view { padding: 22px 15px 28px; }
  .page-heading { align-items: flex-start; margin-bottom: 17px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p { max-width: 310px; font-size: 11px; }
  .heading-actions { display: none; }
  .demo-banner { align-items: flex-start; gap: 8px; padding: 10px; font-size: 10px; }
  .demo-banner strong { font-size: 8px; }
  .stats-grid { gap: 9px; margin-bottom: 12px; }
  .stat-card { min-height: 101px; padding: 12px; border-radius: 12px; }
  .stat-top { font-size: 9px; }
  .stat-icon { width: 25px; height: 25px; }
  .stat-number { font-size: 23px; }
  .stat-foot { margin-top: 6px; font-size: 8px; }
  .dashboard-grid { gap: 12px; }
  .panel { border-radius: 13px; }
  .panel-header { min-height: 53px; padding: 12px 13px; }
  .panel-header h2 { font-size: 12px; }
  .panel-header p { font-size: 9px; }
  .activity-content { padding: 13px; }
  .connection-bars { gap: 6px; height: 96px; }
  .quick-row { gap: 8px; }
  .quick-card { min-height: 67px; padding: 9px; gap: 8px; }
  .quick-card .stat-icon { width: 27px; height: 27px; }
  .quick-card strong { font-size: 9px; }
  .quick-card small { font-size: 8px; }
  .alert-list { padding-inline: 12px; }
  .alert-row { gap: 8px; }
  .alert-amount strong { font-size: 8px; }
  .mobile-nav { position: fixed; z-index: 30; inset: auto 0 0; height: 64px; display: grid; grid-template-columns: repeat(12, minmax(44px, 1fr)); overflow-x: auto; padding: 5px 7px max(5px, env(safe-area-inset-bottom)); background: rgba(255,254,250,.97); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(42,55,44,.055); backdrop-filter: blur(14px); }
  .mobile-nav-link { min-width: 44px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; color: #879087; border-radius: 9px; font-size: 8px; font-weight: 600; }
  .mobile-nav-link svg { width: 17px; height: 17px; }
  .mobile-nav-link.active { color: var(--green); background: #edf3ed; }
  .list-toolbar { align-items: flex-start; }
  .data-table { min-width: 750px; }
  .table-wrap { margin-inline: -1px; }
  .metric-strip { flex-wrap: wrap; gap: 10px 15px; padding: 10px 12px; }
  .metric-sep { display: none; }
  .metric-item { font-size: 9px; }
  .metric-item strong { font-size: 13px; }
  .map-frame { min-height: 350px; height: 52vh; }
  .map-side { max-height: 370px; }
  .map-customer-list { grid-template-columns: 1fr; max-height: 235px; }
  .map-controls select { max-width: 112px; font-size: 8px; }
  .modal-backdrop { padding: 12px; align-items: end; }
  .modal { max-height: 91vh; border-radius: 16px 16px 10px 10px; }
  .modal-header { padding: 16px 16px 12px; }
  .modal-body { padding: 15px 16px; }
  .modal-footer { padding: 11px 16px; }
  .toast-region { right: 12px; bottom: 75px; }
}
@media (max-width: 400px) {
  .header-add span { display: none; }
  .header-add { width: 34px; padding: 0; }
  .page-heading h1 { font-size: 23px; }
  .mobile-nav-link { font-size: 7px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .detail-grid { grid-template-columns: 1fr; }
  .map-legend { gap: 6px; font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.status-distribution { display: flex; flex-direction: column; gap: 13px; padding: 7px 2px 3px; }
.status-distribution-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 12px; }
.distribution-label { display: flex; justify-content: space-between; gap: 7px; color: #7e8980; font-size: 10px; }
.distribution-label strong { color: #47584b; font-family: var(--mono); font-size: 10px; }
.distribution-track { height: 8px; overflow: hidden; background: #f0f1ec; border-radius: 99px; }
.distribution-fill { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: #79a182; }
.distribution-fill.fill-1 { background: #aab4ad; }
.distribution-fill.fill-2 { background: #d9a15a; }
@media (max-width: 700px) {
  .header-add { min-height: 44px; }
  .search-box { width: 44px; height: 44px; }
  .search-box:focus-within { height: 40px; }
  .table-action { min-height: 36px; }
  .pay-row-button { min-height: 36px; padding-inline: 9px; }
}
@media (max-width: 400px) {
  .header-add { width: 44px; min-height: 44px; }
}

.legend-dot.isolated { background: #d9a15a; }
@media (max-width: 700px) {
  .page-heading:has(.heading-actions .button) { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .heading-actions:has(.button) { display: flex; }
  .heading-actions .button { min-height: 44px; }
  .map-customer { min-height: 53px; }
  .button { min-height: 44px; }
}

@media (max-width: 960px) {
  .gateway-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .gateway-form { padding: 14px; }
  .gateway-foot { flex-wrap: wrap; }
  .gateway-side { padding: 14px; }
  .reminder-date-form input { width: 127px; }
}

.gateway-form input:disabled, .gateway-form textarea:disabled { color: #879087; background: #f0f1ec; border-color: #e1e4dc; opacity: 1; cursor: not-allowed; }
.gateway-status-mark svg { width: 18px; height: 18px; }
.router-switch { display: flex; align-items: center; gap: 9px; grid-column: 1 / -1; color: #78847a; font-size: 10px; line-height: 1.45; }
.router-switch input { accent-color: var(--green); }

/* Self-hosted authentication and integration controls */
[hidden] { display: none !important; }
.login-background { background: linear-gradient(120deg, rgba(7, 24, 24, .62), rgba(8, 20, 29, .46)), url('/assets/login-network-bg.jpg') center / cover fixed no-repeat !important; }
.auth-root { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: transparent; }
.auth-card { width: min(100%, 430px); padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.auth-card .brand-mark { width: 43px; height: 43px; }
.auth-card h1 { margin: 20px 0 7px; font-size: 24px; letter-spacing: -.7px; }
.auth-card p { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.auth-card form { display: grid; gap: 11px; }
.auth-card label { font-size: 11px; font-weight: 700; }
.auth-card input { width: 100%; min-height: 44px; padding: 0 12px; color: var(--ink); background: #fffefa; border: 1px solid var(--line-dark); border-radius: 8px; }
.auth-card .button { min-height: 43px; margin-top: 3px; }
.auth-card > small { display: block; margin-top: 17px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.auth-error { margin: 0 0 15px; padding: 10px 12px; color: #8c382f; background: var(--red-soft); border: 1px solid #efd1cb; border-radius: 8px; font-size: 11px; }
.toggle-off { width: 27px; height: 15px; margin-left: auto; padding: 2px; border-radius: 99px; background: #d6dad4; }
.toggle-off i { display: block; width: 11px; height: 11px; margin-right: auto; background: white; border-radius: 50%; }
.clear-secret { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: #7b5a40; font-size: 10px; }
.clear-secret input { width: 14px; min-height: 14px; height: 14px; margin: 0; accent-color: var(--red); }
.gateway-form .field-help { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.gateway-form .credential-note.full { grid-column: 1 / -1; }
.gateway-foot span[role="status"] { min-width: 0; color: var(--ink-2); font-size: 10px; line-height: 1.4; }
.status-distribution { display: grid; gap: 12px; padding: 5px 0 8px; }
.status-distribution-row { display: grid; gap: 6px; }
.distribution-label { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 10px; }
.distribution-track { height: 7px; overflow: hidden; background: #edf0ea; border-radius: 999px; }
.distribution-fill { display: block; height: 100%; background: #86a88d; border-radius: inherit; }
.distribution-fill.fill-1 { background: #b7c0b9; }
.distribution-fill.fill-2 { background: #cf9650; }
@media (max-width: 640px) {
  .auth-root { padding: 16px; }
  .auth-card { padding: 23px; }
  .topbar-actions { gap: 7px; }
  #logoutButton { min-height: 32px; padding: 0 8px; font-size: 10px; }
  .gateway-foot { flex-wrap: wrap; }
}

/* Customer bill portal */
.portal-page { min-height: 100vh; background: #f4f3ed; }
.portal-page.login-background { background-image: linear-gradient(120deg, rgba(7, 24, 24, .62), rgba(8, 20, 29, .46)), url('/assets/login-network-bg.jpg'); background-position: center; background-size: cover; background-attachment: fixed; }
.portal-root { min-height: 100vh; padding: 28px 16px 42px; }
.portal-shell { width: min(100%, 760px); margin: 0 auto; }
.portal-card { width: min(100%, 480px); margin: 8vh auto 0; padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.portal-login-brand { margin-bottom: 22px; }
.portal-login h1 { margin: 0 0 7px; font-size: 24px; letter-spacing: -.7px; }
.portal-login > p { margin: 0 0 19px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.portal-login form { display: grid; gap: 9px; }
.portal-login label { margin-top: 4px; color: var(--ink-2); font-size: 10px; font-weight: 700; }
.portal-login input { width: 100%; min-height: 43px; padding: 0 11px; color: var(--ink); background: #fffefa; border: 1px solid var(--line-dark); border-radius: 8px; }
.portal-login .portal-button { margin-top: 7px; }
.portal-header-actions { display: flex; align-items: center; gap: 7px; }
.credential-reveal { width: 100%; min-width: 0; min-height: 36px; padding: 0 9px; color: var(--ink); background: #f8f8f2; border: 1px solid var(--line); border-radius: 7px; font-family: var(--mono); font-size: 10px; }
.portal-loading { display: flex; align-items: center; gap: 13px; color: var(--ink-2); }
.portal-loading p { margin: 0; font-size: 12px; }
.portal-brand { display: inline-flex; align-items: center; gap: 10px; }
.portal-brand > span:last-child strong, .portal-brand > span:last-child small { display: block; }
.portal-brand strong { color: var(--ink); font-size: 13px; }
.portal-brand small { margin-top: 3px; color: var(--muted); font-size: 8px; letter-spacing: 1px; font-weight: 800; }
.portal-mark { width: 37px; height: 37px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 11px; font-size: 10px; font-weight: 800; letter-spacing: .5px; }
.portal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.portal-logout { min-height: 38px; padding: 0 12px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 10px; font-weight: 700; }
.portal-greeting { padding: 25px 0 17px; }
.portal-greeting h1 { margin: 6px 0; font-size: clamp(23px, 5vw, 30px); letter-spacing: -.8px; }
.portal-greeting p, .portal-section-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.portal-eyebrow { color: #78857b; font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.portal-sandbox { display: grid; gap: 4px; padding: 12px 13px; color: #755c37; background: #fff3df; border: 1px solid #eedfc1; border-radius: 10px; font-size: 10px; line-height: 1.5; }
.portal-sandbox strong { color: #8c6225; font-size: 9px; letter-spacing: .5px; text-transform: uppercase; }
.portal-summary { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; margin: 13px 0; }
.portal-summary article { display: grid; gap: 5px; padding: 14px; background: #fffefa; border: 1px solid var(--line); border-radius: 11px; }
.portal-summary small { color: var(--muted); font-size: 9px; }
.portal-summary strong { color: var(--ink); font-size: 14px; }
.portal-summary span { color: #78847a; font-size: 9px; line-height: 1.4; }
.portal-bill { padding: 16px; background: #fffefa; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 3px 12px rgba(35,52,42,.03); }
.portal-bill-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.portal-bill h2 { margin: 5px 0 3px; font-size: 25px; letter-spacing: -.7px; }
.portal-bill p { margin: 0; color: #7d8980; font-size: 10px; }
.portal-bill > small { display: block; margin-top: 8px; color: #8e805f; font-size: 9px; line-height: 1.5; }
.portal-status { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 99px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.status-pending { color: #96611f; background: #fff0d9; }
.status-paid { color: #42724a; background: #e7f1e6; }
.status-other { color: #647068; background: #eef0ed; }
.portal-button { min-height: 45px; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 0 14px; color: white; background: var(--green); border: 1px solid var(--green); border-radius: 9px; cursor: pointer; font-size: 11px; font-weight: 800; text-align: center; }
.portal-button:hover { background: #174630; }
.portal-button:disabled { opacity: .6; cursor: wait; }
.portal-muted { margin: 2px 0 12px !important; line-height: 1.5; }
.portal-channel-area { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.portal-channel-area form { display: grid; gap: 8px; }
.portal-channel-area label { color: var(--ink-2); font-size: 10px; font-weight: 700; }
.portal-channel-area select { min-height: 42px; padding: 0 10px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-dark); border-radius: 8px; font-size: 10px; }
.portal-channel-area p { min-height: 0; margin: 0; color: var(--red); font-size: 10px; }
.portal-history { margin-top: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.portal-section-heading { padding: 14px; border-bottom: 1px solid var(--line); }
.portal-section-heading h2 { margin: 0 0 4px; font-size: 12px; }
.portal-table-wrap { overflow-x: auto; }
.portal-history table { width: 100%; border-collapse: collapse; font-size: 9px; }
.portal-history th { padding: 10px 11px; color: #89938b; background: #fafaf5; text-align: left; font-size: 8px; text-transform: uppercase; white-space: nowrap; }
.portal-history td { padding: 12px 11px; color: #57655b; border-top: 1px solid #eff0eb; white-space: nowrap; }
.portal-history a { color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.portal-empty { color: var(--muted) !important; text-align: center; white-space: normal !important; }
.portal-footer { padding: 14px 2px; color: #858f86; font-size: 9px; line-height: 1.5; }
.portal-message h1 { margin: 24px 0 7px; font-size: 23px; }
.portal-message p { margin: 0; color: #6f7d73; font-size: 11px; line-height: 1.6; }
.portal-message.is-error { border-color: #f0d9d4; }
.portal-help { margin-top: 16px; padding-top: 12px; color: #8a948b; border-top: 1px solid var(--line); font-size: 9px; line-height: 1.5; }
.portal-inline-error { padding: 9px 10px; color: #8c382f !important; background: var(--red-soft); border-radius: 7px; }
.bill-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
@media (max-width: 600px) {
  .portal-root { padding: 14px 12px 24px; }
  .portal-header { padding-bottom: 13px; }
  .portal-greeting { padding: 20px 0 14px; }
  .portal-summary { gap: 8px; }
  .portal-summary article { padding: 11px; }
  .portal-bill { padding: 13px; }
  .portal-history th, .portal-history td { padding-inline: 9px; }
  .portal-card { padding: 22px; }
  .portal-header-actions { gap: 5px; }
  .portal-logout { min-height: 36px; padding-inline: 8px; font-size: 9px; }
  .bill-links > a { flex: 1 1 140px; }
}

/* Fiber inventory and RouterOS automation */
.fiber-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.fiber-metrics article { display: grid; gap: 5px; min-height: 74px; padding: 13px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.fiber-metrics small { color: var(--muted); font-size: 9px; font-weight: 700; }
.fiber-metrics strong { font-size: 19px; letter-spacing: -.4px; }
.fiber-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .9fr); align-items: start; gap: 13px; }
.fiber-map-panel, .fiber-list-panel { min-width: 0; overflow: hidden; }
.fiber-map-panel .panel-header, .fiber-list-panel .panel-header { padding: 15px 16px 11px; }
.fiber-map-panel .panel-header h2, .fiber-list-panel .panel-header h2 { margin: 0; font-size: 13px; }
.fiber-map-panel .panel-header p, .fiber-list-panel .panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.fiber-toolbar { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 15px 8px; }
.fiber-toolbar .button { min-height: 34px; font-size: 9px; }
.network-tool-status { min-height: 28px; margin: 0; padding: 0 16px 9px; color: #647168; font-size: 9px; line-height: 1.5; }
.fiber-map-frame { position: relative; min-height: 430px; height: clamp(430px, 54vh, 690px); border-top: 1px solid var(--line); background: #e9eee8; }
#networkMapCanvas { width: 100%; height: 100%; min-height: 430px; outline: 0; }
#networkMapCanvas:focus-visible { outline: 3px solid rgba(47,108,77,.45); outline-offset: -3px; }
.fiber-map-frame .map-overlay-label { position: absolute; z-index: 500; inset: 50% auto auto 50%; width: min(82%, 320px); transform: translate(-50%, -50%); pointer-events: none; }
.fiber-legend { position: absolute; z-index: 500; inset: auto auto 14px 14px; display: flex; flex-wrap: wrap; gap: 9px; padding: 8px 10px; color: #4f5c53; background: rgba(255,254,250,.94); border: 1px solid rgba(220,224,216,.95); border-radius: 8px; box-shadow: 0 4px 12px rgba(33,49,39,.08); font-size: 8px; }
.fiber-legend span { display: inline-flex; align-items: center; gap: 5px; }
.fiber-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #c7864c; }
.fiber-legend i.odp { background: #347ca4; }
.fiber-legend i.feeder, .fiber-legend i.distribution, .fiber-legend i.drop { width: 15px; height: 3px; border-radius: 2px; }
.fiber-legend i.feeder { background: #276b55; }
.fiber-legend i.distribution { background: #3984a6; }
.fiber-legend i.drop { background: #d48a35; }
.fiber-node-wrap, .fiber-vertex-wrap { background: transparent; border: 0; }
.fiber-node-marker { display: inline-flex; align-items: center; justify-content: center; min-width: 43px; height: 26px; padding: 0 7px; color: #fff; background: #8a623f; border: 2px solid white; border-radius: 7px; box-shadow: 0 2px 8px rgba(28,43,33,.28); font-size: 8px; font-weight: 900; letter-spacing: .3px; }
.fiber-node-marker.odp { background: #32799a; border-radius: 99px; }
.fiber-vertex-wrap span { display: block; width: 16px; height: 16px; background: #fff; border: 4px solid #326f91; border-radius: 50%; box-shadow: 0 1px 5px rgba(20,40,30,.35); }
.fiber-side { display: grid; min-width: 0; gap: 13px; }
.fiber-list-panel { padding-bottom: 4px; }
.fiber-list { display: grid; gap: 0; max-height: 310px; overflow: auto; border-top: 1px solid #eff0ea; }
.fiber-list-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; min-width: 0; padding: 11px 13px; border-bottom: 1px solid #eff0ea; }
.fiber-list-copy { display: grid; gap: 4px; min-width: 0; }
.fiber-list-copy strong { overflow-wrap: anywhere; font-size: 10px; }
.fiber-list-copy small { color: #7d887f; font-size: 8px; line-height: 1.5; }
.fiber-list-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.fiber-list-actions .table-action { min-height: 30px; padding: 0 6px; }
.fiber-list-actions .table-action:disabled { opacity: .45; cursor: not-allowed; }
.fiber-node-chip, .fiber-route-chip { display: grid; place-items: center; width: 34px; height: 26px; color: #855c39; background: #f6ecdf; border-radius: 6px; font-size: 8px; font-weight: 900; }
.fiber-node-chip.odp { color: #2e6f8e; background: #e6f0f4; }
.fiber-route-chip { color: #2e6f55; background: #e6f0e8; font-size: 14px; }
.fiber-route-chip.distribution { color: #347c9d; background: #e6f0f4; }
.fiber-route-chip.drop { color: #a76c22; background: #fff1df; }
.fiber-alert { display: grid; gap: 5px; margin: 12px 0; padding: 12px 14px; color: #733d31; background: var(--red-soft); border: 1px solid #f0d5cf; border-radius: 10px; font-size: 10px; }
.fiber-alert strong { font-size: 11px; }
.fiber-alert small { margin-top: 2px; color: #855c53; line-height: 1.5; }
.fiber-tool-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0; }
.gateway-side [role="status"] { display: block; color: var(--muted); font-size: 9px; line-height: 1.5; }
.automation-control { display: flex; align-items: flex-start; gap: 10px; padding: 12px; color: var(--ink); background: #f5f7f1; border: 1px solid #e2e8dd; border-radius: 9px; cursor: pointer; }
.automation-control input[type="checkbox"] { width: 18px; min-width: 18px; height: 18px; min-height: 18px; margin: 2px 0 0; accent-color: var(--green); }
.automation-control span, .automation-control strong, .automation-control small { display: block; }
.automation-control strong { font-size: 10px; }
.automation-control small { margin-top: 4px; color: #66756a; font-size: 9px; font-weight: 400; line-height: 1.5; }
@media (max-width: 1100px) {
  .fiber-layout { grid-template-columns: minmax(0, 1fr); }
  .fiber-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 680px) {
  .fiber-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fiber-layout, .fiber-side { grid-template-columns: minmax(0, 1fr); }
  .fiber-map-frame { height: 55vh; min-height: 400px; }
  #networkMapCanvas { min-height: 400px; }
  .fiber-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fiber-toolbar .button { white-space: normal; }
  .fiber-list-row { grid-template-columns: auto minmax(0, 1fr); }
  .fiber-list-actions { grid-column: 2; justify-content: flex-start; }
}

.provider-check-note { display: block; max-width: 260px; margin-top: 6px; color: var(--ink-2); font-size: 11px; line-height: 1.45; white-space: normal; }
.provider-check-warning { color: #8e3c31; font-weight: 700; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 680px) { .provider-check-note { min-width: 180px; } .row-actions { align-items: flex-start; } }


/* Operations, backup, and C-DATA OLT views */
.operations-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 14px; margin-bottom: 14px; }
.operations-panel { min-width: 0; overflow: hidden; }
.operation-list { display: flex; flex-direction: column; }
.operation-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid #eff0eb; }
.operation-mark { width: 30px; height: 30px; display: grid; place-items: center; color: #54755b; background: #eaf1e8; border-radius: 9px; font-size: 9px; font-weight: 800; }
.operation-mark.warning { color: #94652a; background: #fbefd9; }
.operation-mark.critical { color: #a14e43; background: #f8e9e5; }
.operation-mark.resolved { color: #67786a; background: #edf0eb; }
.operation-copy { min-width: 0; }
.operation-copy strong { display: block; color: #3e4f43; font-size: 10px; line-height: 1.4; }
.operation-copy small { display: block; margin-top: 3px; color: #858f86; font-size: 8px; line-height: 1.4; }
.operation-copy p { margin: 5px 0 0; color: #6f7c72; font-size: 9px; line-height: 1.45; }
.operation-copy .operation-runbook { color: #6f775e; }
.audit-panel { margin-top: 14px; }
.audit-route { display: block; margin-top: 3px; color: #9aa198; font-size: 8px; }
.olt-card { margin-bottom: 14px; }
.olt-card .gateway-form { max-width: none; }
.olt-card .gateway-form > .form-grid { grid-column: 1 / -1; }
.olt-card .field.full { grid-column: 1 / -1; }
.olt-card .field textarea { width: 100%; min-height: 74px; padding: 9px 11px; line-height: 1.45; resize: vertical; }
.olt-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 15px; padding: 10px 15px; color: #727e74; background: #fafaf5; border-top: 1px solid var(--line); font-size: 9px; }
.olt-summary small { margin-left: auto; color: #929990; font-size: 8px; }
.text-danger { color: #a54a3f !important; font-weight: 800; }
@media (max-width: 960px) {
  .operations-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .mobile-nav { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 52px; justify-content: start; }
  .operation-row { grid-template-columns: 30px minmax(0, 1fr); align-items: start; gap: 8px; padding: 12px; }
  .operation-row > .table-action { grid-column: 2; justify-self: start; }
  .olt-summary { gap: 8px 11px; padding-inline: 12px; }
  .olt-summary small { width: 100%; margin-left: 0; }
}


/* Unified black theme for every admin and customer screen */
html, body, .portal-page { background: var(--paper); color: var(--ink); color-scheme: dark; }
.sidebar { background: #0c120e; border-color: var(--line); }
.brand-mark, .portal-mark { color: #f2fff4; background: #25683e; }
.workspace-label, .nav-group-label, .crumbs, .crumb-slash,
.result-count, .payment-id, .empty-state, .access-label,
.stat-top, .stat-foot, .chart-legend, .activity-topline,
.alert-info small, .alert-amount strong, .alert-amount small,
.section-note, .date-chip svg, .search-box, .search-box input::placeholder,
.mobile-nav-link, .portal-eyebrow, .portal-footer, .portal-summary small,
.portal-summary span, .portal-bill p, .portal-bill > small,
.portal-history th, .portal-history td, .portal-help,
.operation-copy small, .operation-copy p, .operation-runbook,
.audit-route, .olt-summary, .olt-summary small, .network-tool-status,
.fiber-list-copy small, .gateway-side ol, .gateway-side p,
.field-help, .gateway-foot span, .portal-message p { color: var(--muted); }
.sidebar-bottom .profile-row, .panel-header, .map-card-header, .portal-header,
.portal-channel-area, .portal-section-heading { border-color: var(--line); }
.demo-workspace, .search-box, .quick-card, .metric-strip, .gateway-status,
.gateway-methods, .map-side-foot, .data-table th, .modal-footer,
.modal-close, .password-wrap button, .map-customer:hover,
.mobile-nav, .portal-summary article, .portal-bill, .portal-history th,
.credential-reveal, .automation-control, .fiber-legend, .olt-summary {
  background-color: var(--surface-2);
  border-color: var(--line);
}
.demo-workspace, .search-box, .search-box kbd, .date-chip, .button-secondary,
.list-toolbar .filter-select, .filter-select, .field input, .field select,
.field textarea, .reminder-date-form input, .auth-card input,
.portal-login input, .portal-channel-area select, .credential-reveal,
.map-controls select {
  color: var(--ink);
  background-color: #0b110d;
  border-color: var(--line-dark);
}
.search-box input { color: var(--ink); background: transparent; }
.search-box:focus-within { background-color: #0b110d; }
.search-box kbd { color: var(--muted); border-color: var(--line); }
input::placeholder, textarea::placeholder, .field input::placeholder { color: #9aa89d; opacity: 1; }
select option { color: var(--ink); background: var(--surface); }
.nav-link { color: #aab8ad; }
.nav-link:hover, .icon-button:hover, .button-quiet:hover { color: var(--ink); background: #1a241e; }
.nav-link.active, .mobile-nav-link.active { color: #a7e7b6; background: #1a3021; }
.nav-count, .icon-button, .mobile-nav-link { color: #a3b0a5; }
.isolation-mini { background: var(--surface); border-color: var(--line); }
.toggle-on { background: #40875a; }
.toggle-off { background: #3b4840; }
.toggle-on i, .toggle-off i { background: #eaf2eb; }
.avatar-dark { color: #edfff1; background: #315d3e; }
.topbar { color: var(--ink); background: rgba(9, 14, 11, .94); border-color: rgba(63, 81, 69, .65); }
.top-demo { color: #e9c58f; }
.button-primary, .portal-button { color: #fff; background: #23683f; border-color: #347b50; }
.button-primary:hover, .portal-button:hover { color: #fff; background: #2d7a4b; }
.button-secondary { color: #a4e3b4; }
.button-secondary:hover { color: #c5f0ce; background: #1a2d20; border-color: #50725a; }
.button-quiet { color: #c5d2c8; }
.button-danger { color: #ff9f93; background: #38221f; border-color: #70413a; }
.date-chip { color: #c7d4ca; background: rgba(18, 26, 21, .88); }
.demo-banner { color: #eed7af; background: #2a241a; border-color: #51432e; }
.demo-banner strong, .demo-banner a { color: #ffdfa8; }
.demo-banner .demo-badge { color: #ffdda0; background: #483820; }
.router-ops-banner { color: #c5f0cd; background: #14291b; border-color: #31543a; }
.router-ops-banner strong { color: #c4f5ce; }
.router-ops-banner .demo-badge { color: #b6edc1; background: #1c3925; }
.router-ops-warning { color: #ffd1ca; background: #321d1c; border-color: #70403b; }
.router-ops-warning strong, .router-ops-warning .demo-badge { color: #ffb0a6; }
.router-ops-warning .demo-badge { background: #492724; }
.stat-icon { color: #9ce2ad; background: #1a3021; }
.stat-icon.amber { color: #f4c57f; background: #392a18; }
.stat-icon.red { color: #ff9a8e; background: #3c211f; }
.panel, .stat-card, .gateway-card, .map-card, .map-side, .operations-panel,
.fiber-map-panel, .fiber-list-panel, .fiber-metrics article,
.portal-card, .portal-history { color: var(--ink); background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.panel-header, .portal-section-heading { border-bottom-color: var(--line); }
.text-link, .gateway-methods input, .portal-history a { color: #a0e2b0; }
.text-link:hover { color: #c3efcd; }
.panel-header p, .portal-login > p, .portal-greeting p, .portal-section-heading p { color: var(--muted); }
.connection-bars { border-color: var(--line); }
.bar-col, .chart-legend { color: #9aa89d; }
.bar-track { background: linear-gradient(180deg, #659c73, #315b3a); }
.bar-col:nth-child(3n) .bar-track { background: linear-gradient(180deg, #c79656, #6b4d2b); }
.bar-col:nth-child(5n) .bar-track { background: linear-gradient(180deg, #70a781, #315640); }
.alert-row, .data-table td, .map-customer, .detail-item, .portal-history td,
.fiber-list, .fiber-list-row, .operation-row { border-color: #29372e; }
.alert-info strong, .customer-name strong, .map-customer-copy strong,
.operation-copy strong, .detail-item strong, .gateway-status strong,
.portal-brand strong, .portal-summary strong, .portal-greeting h1,
.portal-bill h2, .portal-section-heading h2, .page-heading h1,
.stat-number, .activity-topline strong, .distribution-label strong { color: var(--ink); }
.alert-avatar { color: #f1cf98; background: #342a1b; }
.alert-avatar.red, .operation-mark.critical { color: #ffaaa0; background: #3b2422; }
.alert-amount strong { color: #e9c58f; }
.pay-row-button, .table-action.primary { color: #a1e3b1; background: #1a3021; border-color: #2d4b35; }
.pay-row-button:hover, .table-action.primary:hover { background: #24422d; }
.table-action { color: #c1cec4; border-color: #3a4940; }
.table-action:hover { color: #b2eac0; background: #1b2c21; border-color: #4a7054; }
.table-action.danger { color: #ff9f93; background: #38221f; border-color: #633a35; }
.data-table { color: var(--ink); background: var(--surface); }
.data-table th, .portal-history th { color: #b1beb4; background: #151e18; }
.data-table td, .portal-history td { color: #c4d1c7; }
.data-table tbody tr:hover { background: #151e18; }
.customer-name small, .portal-bill p, .payment-id, .customer-name small { color: var(--muted); }
.person-avatar { color: #a7e2b3; background: #1c3322; }
.person-avatar.p2 { color: #e8c294; background: #34291d; }
.person-avatar.p3 { color: #b9c9e8; background: #202b3a; }
.person-avatar.p4 { color: #e5b7cf; background: #34232e; }
.person-avatar.p5 { color: #a9dfda; background: #1b302e; }
.status-online, .status-paid { color: #aee9b4; background: #183322; }
.status-offline, .status-other { color: #c1cbc4; background: #202923; }
.status-isolated, .status-pending { color: #ffd18c; background: #392a19; }
.access-label { color: #a1aea4; }
.due-soon { color: #f3c57d; }
.due-late, .text-danger { color: #ff9d91 !important; }
.metric-strip { color: var(--ink-2); background: var(--surface-2); border-color: var(--line); }
.metric-item { color: var(--muted); }
.voucher-code { color: #cee6d2; background: #1b2920; }
.copy-button { color: #adbbb0; }
.copy-button:hover { color: #b4e8c0; background: #1b2c21; }
.amount-cell { color: #e2eee5 !important; }
.map-frame, .fiber-map-frame { background: #0b110d; }
.map-overlay-label, .map-legend, .fiber-legend { color: #d0ddd2; background: rgba(12, 18, 14, .95); border-color: rgba(69, 87, 74, .9); box-shadow: 0 4px 14px rgba(0, 0, 0, .38); }
.map-overlay-label strong { color: #f1d4a8; }
.map-side-foot { color: var(--muted); background: var(--surface-2); }
.map-customer-copy strong { color: var(--ink); }
.map-customer-copy small { color: var(--muted); }
.customer-pin { border-color: rgba(17, 23, 19, .98); }
.leaflet-container { background: #0b110d; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { color: var(--ink); background: var(--surface); }
.demo-popup { color: var(--ink); }
.demo-popup span { color: var(--muted); }
.modal-backdrop { background: rgba(0, 0, 0, .68); }
.modal { color: var(--ink); background: var(--surface); border-color: #35443a; box-shadow: 0 24px 70px rgba(0, 0, 0, .58); }
.modal-close, .password-wrap button { color: #c2cec4; background: #1b251f; }
.field label, .gateway-methods legend, .gateway-methods label,
.router-switch, .clear-secret { color: #c7d3ca; }
.field input:focus, .field select:focus, .field textarea:focus,
.auth-card input:focus, .portal-login input:focus,
.portal-channel-area select:focus { outline: 3px solid rgba(139, 218, 161, .34); border-color: #81bd91; }
.field-help, .gateway-foot span, .portal-help { color: #a3b0a6; }
.modal-note, .credential-note, .portal-sandbox { color: #efd4a7; background: #2b2419; border-color: #51432d; }
.modal-note strong, .credential-note strong, .portal-sandbox strong { color: #ffe1ad; }
.gateway-status strong { color: #eaf4ec; }
.gateway-side ol { color: #c2cfc5; }
.gateway-side p { color: var(--muted); }
.gateway-form input:disabled, .gateway-form textarea:disabled { color: #a2afa5; background: #1b241e; border-color: #38473d; }
.toast { color: #d5ead9; background: #15221a; border-color: #35543d; box-shadow: 0 10px 30px rgba(0, 0, 0, .38); }
.toast.warn { color: #f1d4a7; background: #2d2519; border-color: #59452b; }
.mobile-nav { background: rgba(12, 18, 14, .97); border-color: var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .4); }
.distribution-label { color: #bdc9bf; }
.distribution-label strong { color: #edf5ef; }
.distribution-track { background: #25322a; }
.distribution-fill { background: #74bc87; }
.distribution-fill.fill-1 { background: #8d9a90; }
.distribution-fill.fill-2 { background: #d2a05e; }
.router-switch, .automation-control { color: var(--ink-2); }
.automation-control { background: #151e18; border-color: var(--line); }
.automation-control small { color: #b0bdb3; }
.network-tool-status { color: #c1cec4; }
.fiber-legend { color: #d2ded4; }
.fiber-node-marker { border-color: #dce9de; }
.fiber-vertex-wrap span { background: #dce9de; }
.fiber-list-copy small { color: var(--muted); }
.fiber-node-chip, .fiber-route-chip { color: #f1d0a3; background: #35291d; }
.fiber-node-chip.odp, .fiber-route-chip.distribution { color: #b5d9ed; background: #1e2d37; }
.fiber-route-chip { color: #b6e2c2; background: #1b3022; }
.fiber-route-chip.drop { color: #ffd08d; background: #382919; }
.fiber-alert { color: #ffd1ca; border-color: #70403b; }
.fiber-alert small { color: #ecb8af; }
.operation-mark { color: #b4e7bf; background: #1c3222; }
.operation-mark.warning { color: #f1ca8b; background: #382b1b; }
.operation-mark.resolved { color: #c1cec4; background: #202923; }
.operation-copy .operation-runbook { color: #c7d4a9; }
.olt-summary { color: #bdc9bf; background: var(--surface-2); }
.provider-check-warning { color: #ffaaa0; }

.login-background, .portal-page.login-background {
  min-height: 100vh;
  color: var(--ink);
  background-color: #050907 !important;
  background-image: linear-gradient(120deg, rgba(3, 9, 6, .78), rgba(4, 11, 8, .68)), url('/assets/login-network-bg.jpg') !important;
  background-position: center;
  background-size: cover;
  background-attachment: scroll;
  background-repeat: no-repeat;
}
.auth-root { color: var(--ink); }
.auth-card, .portal-page.login-background .portal-login {
  color: var(--ink);
  background: rgba(9, 15, 11, .93);
  border-color: rgba(194, 225, 201, .2);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .48);
  backdrop-filter: blur(16px);
}
.auth-card label { color: #e1ece3; }
.auth-card p, .auth-card > small { color: #b6c4b9; }
.auth-error, .portal-inline-error { color: #ffb2a7 !important; background: #3a211e; border-color: #70413a; }
.portal-page { color: var(--ink); background: var(--paper); }
.portal-root { background: transparent; }
.portal-login label, .portal-channel-area label { color: #d1ded4; }
.portal-message p { color: #c3d0c6; }
.portal-message.is-error { border-color: #70413a; }
.portal-page .portal-card { color: var(--ink); background: var(--surface); border-color: var(--line); }
.portal-page.login-background .portal-card.portal-login { background: rgba(9, 15, 11, .93); border-color: rgba(194, 225, 201, .2); }
.portal-summary article, .portal-bill { color: var(--ink); background: #151e18; }
.portal-summary span, .portal-bill p, .portal-footer { color: #a7b4aa; }
.portal-history th { color: #b7c3b9; background: #151e18; }
.portal-history td { color: #cbd7cd; border-color: var(--line); }
.portal-button:focus-visible, .button:focus-visible, .table-action:focus-visible,
.portal-logout:focus-visible { outline: 3px solid #a5e8b6; outline-offset: 3px; }
:focus-visible { outline: 3px solid #a5e8b6 !important; outline-offset: 2px !important; }
#networkMapCanvas:focus-visible { outline: 3px solid #173e25 !important; outline-offset: -3px !important; }
@media (max-width: 700px) {
  .mobile-nav { background: rgba(12, 18, 14, .98); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-card, .portal-login { backdrop-filter: none; }
}


/* Map topology controls and distinct network markers */
.map-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.map-quick-actions .button { min-height: 42px; font-size: 10px; }
.map-tool-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 7px 14px; color: #c6d3c8; background: #111a14; border-bottom: 1px solid var(--line); }
.map-tool-line p { margin: 0; font-size: 10px; line-height: 1.5; }
.map-tool-line [hidden] { display: none; }
.map-legend-topology { left: 12px; right: auto; max-width: calc(100% - 24px); flex-wrap: wrap; gap: 7px 10px; color: #e0e9e2; background: rgba(9, 15, 11, .94); border-color: #34443a; }
.map-legend i.legend-headend, .fiber-legend i.legend-headend { background: #a981d2; }
.map-legend i.legend-odc, .fiber-legend i.legend-odc { background: #d89554; }
.map-legend i.legend-odp, .fiber-legend i.legend-odp { background: #55a9d2; }
.map-legend i.legend-home, .fiber-legend i.legend-home { background: #62b77d; }
.map-legend i.los, .fiber-legend i.los { background: #ed5147; box-shadow: 0 0 0 2px rgba(237, 81, 71, .24); }
.map-legend i.offline, .fiber-legend i.offline { background: #e34b42; }
.map-legend i.isolated { background: #e49c43; }
.map-legend span, .fiber-legend span { white-space: nowrap; }
.customer-pin { width: 30px; height: 30px; color: #f5fff7; background: #247843; }
.customer-pin svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transform: rotate(45deg); }
.customer-pin.online { background: #247843; }
.customer-pin.offline { background: #d6423b; }
.customer-pin.unknown { background: #65736a; }
.customer-pin.isolated { background: #bf7423; }
.fiber-node-marker { min-width: 58px; width: 64px; height: 38px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 2px 4px; color: #f8edff; background: #45345a; border: 2px solid #e9d9ff; border-radius: 9px; }
.fiber-node-marker svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fiber-node-marker small { color: inherit; font-size: 7px; font-weight: 900; line-height: 1; letter-spacing: .25px; }
.fiber-node-marker.odc { color: #fff0df; background: #754620; border-color: #f3c48d; border-radius: 9px; }
.fiber-node-marker.odp { color: #e1f5ff; background: #185575; border-color: #9ed7f1; border-radius: 50%; }
.fiber-node-chip.headend { color: #e2caff; background: #352744; }
.fiber-node-chip.odc { color: #ffdfb7; background: #3d2b1b; }
.fiber-node-chip.odp { color: #bde7fc; background: #1b303c; }
.fiber-route-chip.los { color: #ffd1cb; background: #49231f; }
.fiber-los-badge { display: inline-flex; align-items: center; margin: 3px 0 0 5px; padding: 2px 7px; border: 1px solid #9b4b42; border-radius: 999px; color: #ffd1cb; background: #49231f; font-size: .75rem; font-weight: 750; line-height: 1.35; }
.fiber-los-badge[hidden] { display: none; }
.fiber-list-actions .table-action { min-height: 38px; }
.fiber-legend { color: #e0e9e2; background: rgba(9, 15, 11, .94); border-color: #34443a; }
.fiber-legend i.feeder { background: #40a07b; }
.fiber-legend i.distribution { background: #52a8d2; }
.fiber-legend i.drop { background: #e7a550; }
.fiber-legend i.route-status-online { background: #40a07b; }
.fiber-legend i.route-status-los { background: #e54239; }
.fiber-legend i.route-status-unknown { background: #7b8980; }
.demo-popup { color: #19251d; }
.demo-popup span { color: #46564b; }
.network-node-popup { min-width: 190px; }
.network-node-popup .popup-hint { margin-top: 7px; font-size: 10px; }
.network-node-popup .popup-actions { display: flex; gap: 8px; margin-top: 10px; }
.network-node-popup .popup-actions .table-action { min-width: 68px; min-height: 40px; font-size: 11px; }
.network-node-popup .popup-actions .danger-text { color: #a43f35; border-color: #e9c7c2; }
.fiber-state-badge { display: inline-flex; align-items: center; margin: 4px 0 0 5px; padding: 3px 8px; border: 1px solid #43574a; border-radius: 999px; font-size: .75rem; font-weight: 750; line-height: 1.35; }
.fiber-state-badge.online, .fiber-route-chip.online { color: #b7ebc2; background: #1a3021; border-color: #375841; }
.fiber-state-badge.los, .fiber-route-chip.los { color: #ffd1cb; background: #49231f; border-color: #9b4b42; }
.fiber-state-badge.unknown, .fiber-route-chip.unknown { color: #d1ddd4; background: #2b3530; border-color: #4b5a50; }
@keyframes fiber-online-flow { to { stroke-dashoffset: -32; } }
.leaflet-overlay-pane path.fiber-route-online { animation: fiber-online-flow 2.8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .leaflet-overlay-pane path.fiber-route-online { animation: none !important; } }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { color: #19251d; background: #f8fbf8; }
#mapCanvas:focus-visible { outline: 3px solid #173e25 !important; outline-offset: -3px !important; }
@media (max-width: 980px) {
  .map-layout { grid-template-columns: minmax(0, 1fr); }
  .map-side { min-height: 260px; }
  .map-customer-list { max-height: 310px; }
}
@media (max-width: 680px) {
  .map-card-header { align-items: flex-start; flex-direction: column; }
  .map-controls { width: 100%; }
  .map-controls select { width: 100%; max-width: none; min-height: 42px; font-size: 11px; }
  .map-quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; }
  .map-quick-actions .button { min-width: 0; min-height: 46px; justify-content: center; padding-inline: 8px; white-space: normal; }
  .map-quick-actions .button-quiet { grid-column: 1 / -1; }
  .map-tool-line { align-items: flex-start; flex-direction: column; padding: 9px 11px; }
  .map-tool-line p { font-size: 10px; }
  .map-tool-line .table-action { min-height: 42px; }
  .map-frame { height: min(58vh, 600px); min-height: 390px; }
  .map-legend-topology, .fiber-legend { left: 8px; right: 8px; bottom: 8px; max-width: calc(100% - 16px); justify-content: center; gap: 6px 8px; padding: 8px; font-size: 8px; }
  .map-legend span, .fiber-legend span { font-size: 8px; }
  .fiber-toolbar .button { min-height: 44px; justify-content: center; padding-inline: 7px; }
  .fiber-map-frame { height: 58vh; min-height: 390px; }
  #networkMapCanvas { min-height: 390px; }
  .fiber-node-marker { min-width: 52px; width: 58px; height: 36px; }
  .fiber-list-actions .table-action { min-height: 40px; }
}

/* Unified customer + fiber map */
.unified-map-layout { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); align-items: stretch; }
.unified-map-frame { height: clamp(460px, 61vh, 720px); min-height: 460px; }
#networkMapCanvas { min-height: 460px; }
.map-base-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.map-base-label { color: var(--ink-2); font-size: 10px; font-weight: 750; }
.map-base-options { display: flex; flex-wrap: wrap; gap: 6px; }
.map-base-toggle { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-size: 10px; font-weight: 700; cursor: pointer; }
.map-base-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.map-base-toggle:focus-within { outline: 3px solid rgba(139, 218, 161, .34); outline-offset: 2px; }
.map-base-note { color: var(--muted); font-size: 10px; }
.map-layer-toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.map-layer-toggle { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-size: 10px; font-weight: 700; cursor: pointer; }
.map-layer-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.map-layer-toggle:focus-within { outline: 3px solid rgba(139, 218, 161, .34); outline-offset: 2px; }
.map-layer-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; }
.customer-layer-dot { background: #62b77d; }
.node-layer-dot { background: #d89554; }
.route-layer-dot { width: 14px; height: 3px; flex-basis: 14px; border-radius: 99px; background: #7b8980; }
.map-management-panel { max-height: clamp(560px, 72vh, 850px); }
.map-panel-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.map-panel-tabs [role="tab"] { min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 5px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 7px; font-size: 9px; font-weight: 750; cursor: pointer; }
.map-panel-tabs [role="tab"] span { min-width: 18px; padding: 2px 4px; color: var(--ink-2); background: var(--surface-2); border-radius: 99px; font-size: 8px; }
.map-panel-tabs [role="tab"].active, .map-panel-tabs [role="tab"][aria-selected="true"] { color: #a9e2b5; background: #1a3021; border-color: #35543d; }
.map-panel-tabs [role="tab"]:focus-visible { outline: 3px solid #a5e8b6; outline-offset: 2px; }
.map-management-list { display: block; max-height: none; min-height: 260px; flex: 1; overflow-y: auto; }
.map-management-list .map-customer { min-height: 54px; }
.map-card-header .map-title small { max-width: 480px; }
@media (max-width: 1100px) {
  .unified-map-layout { grid-template-columns: minmax(0, 1fr); }
  .map-management-panel { max-height: none; min-height: 340px; }
  .map-management-list { max-height: 420px; }
}
@media (max-width: 680px) {
  .map-base-toolbar { align-items: flex-start; padding: 8px; }
  .map-base-label { width: 100%; }
  .map-base-options { gap: 5px; }
  .map-base-toggle { min-height: 42px; gap: 5px; padding: 5px 7px; font-size: 9px; }
  .map-base-toggle input { width: 15px; height: 15px; }
  .map-base-note { align-self: center; }
  .map-layer-toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 8px; }
  .map-layer-toggle { min-height: 42px; justify-content: center; gap: 5px; padding: 5px 4px; font-size: 9px; }
  .map-layer-toggle input { width: 15px; height: 15px; }
  .unified-map-frame { height: 58vh; min-height: 410px; }
  #networkMapCanvas { min-height: 410px; }
  .map-panel-tabs { padding: 7px; }
  .map-panel-tabs [role="tab"] { min-height: 42px; font-size: 8px; }
}

/* Safe CRUD and provisioning status states */
.provisioning-state { display: block; margin-top: 4px; font-size: .72rem; line-height: 1.35; }
.provisioning-state.state-ready { color: #237447; }
.provisioning-state.state-pending { color: #8b601e; }
.provisioning-state.state-unknown { color: #a13c35; font-weight: 700; }
.data-table .row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 190px; }
.data-table .row-actions .table-action { min-height: 38px; }
.print-choice { display: grid; gap: 16px; }
.print-choice .field { max-width: 240px; }
#voucherBatchProgress { display: block; margin-top: 8px; color: #415b49; font-weight: 650; }
@media (max-width: 680px) {
  .data-table .row-actions { min-width: 180px; gap: 5px; }
  .data-table .row-actions .table-action { min-height: 42px; padding-inline: 9px; }
}

/* Secure customer complaint portal and support operations */
.portal-complaints { margin-top: 18px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.portal-complaints h2, .portal-complaints h3 { margin: 0; }
.portal-complaints h3 { margin: 20px 0 10px; font-size: 13px; }
.portal-complaints form { display: grid; gap: 12px; }
.portal-field { display: grid; gap: 6px; }
.portal-field label { font-size: 11px; font-weight: 700; }
.portal-field input, .portal-field select, .portal-field textarea { width: 100%; min-height: 40px; padding: 9px 10px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-dark); border-radius: 8px; }
.portal-field textarea { min-height: 100px; resize: vertical; }
.portal-field small { color: var(--muted); font-size: 10px; }
.portal-live-note { min-height: 1.3em; color: var(--green); }
.portal-complaint-history { margin-top: 18px; }
.portal-complaint-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.portal-complaint-item strong, .portal-complaint-item small { display: block; }
.portal-complaint-item small { margin-top: 4px; color: var(--muted); }
.portal-complaint-item details { grid-column: 1 / -1; }
.portal-complaint-item summary { min-height: 28px; cursor: pointer; color: var(--ink-2); font-size: 11px; }
.portal-complaint-item details p { white-space: pre-wrap; overflow-wrap: anywhere; }
.support-row { align-items: start; }
.support-row select { max-width: 150px; min-height: 34px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-dark); border-radius: 7px; }
.support-row details summary { cursor: pointer; font-size: 11px; }
@media (max-width: 600px) {
  .portal-complaints { padding: 14px; }
  .support-row { flex-wrap: wrap; }
  .support-row .operation-copy { min-width: calc(100% - 48px); }
  .support-row select { margin-left: 40px; }
}
.webhook-copy-line { display: flex; align-items: center; justify-content: space-between; gap: 9px; flex-wrap: wrap; margin-top: 7px; }
.webhook-copy-line code { min-width: 0; overflow-wrap: anywhere; font-size: 10px; line-height: 1.5; }
.webhook-copy-line .button { flex: 0 0 auto; min-height: 32px; }
.webhook-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 9px; }
.webhook-actions [role="status"] { min-width: 0; flex: 1 1 220px; color: var(--muted); font-size: 9px; line-height: 1.5; }
@media (max-width: 680px) {
  .webhook-copy-line { align-items: flex-start; }
  .webhook-copy-line .button { width: 100%; }
}
}
