:root {
    --navy-950: #04142c;
    --navy-900: #071d3d;
    --navy-800: #0b2b57;
    --blue-700: #0756c9;
    --blue-600: #0d67e8;
    --blue-500: #2480f4;
    --gold-500: #c9bd43;
    --gold-100: #fffbe2;
    --green-700: #0c8d4b;
    --green-100: #e7f8ef;
    --red-700: #d62c3a;
    --red-100: #ffedf0;
    --orange-100: #fff4df;
    --slate-900: #172033;
    --slate-700: #46536b;
    --slate-500: #758197;
    --slate-300: #cfd7e5;
    --slate-200: #e4eaf3;
    --slate-100: #f1f5fa;
    --page: #f5f8fc;
    --white: #ffffff;
    --shadow-sm: 0 7px 20px rgba(13, 46, 91, 0.08);
    --shadow-md: 0 16px 40px rgba(13, 46, 91, 0.12);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --sidebar-width: 218px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--slate-900);
    background:
        radial-gradient(circle at 84% 4%, rgba(36, 128, 244, .11), transparent 28rem),
        linear-gradient(180deg, #f7faff 0, #f3f7fc 100%);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input, select { font: inherit; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    color: #fff;
    overflow-y: auto;
    background:
        radial-gradient(circle at 25% 82%, rgba(19, 112, 232, .42), transparent 15rem),
        linear-gradient(170deg, var(--navy-950), var(--navy-900) 55%, #05275a);
    box-shadow: 12px 0 35px rgba(5, 27, 60, .16);
}
.sidebar::after {
    content: "";
    position: absolute;
    right: -45px;
    bottom: 65px;
    width: 150px;
    height: 150px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 50%;
    box-shadow: 0 0 0 30px rgba(255,255,255,.025), 0 0 0 60px rgba(255,255,255,.018);
    pointer-events: none;
}
.brand {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    min-height: 58px;
    padding: 6px 8px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,.16);
}
.brand img { width: 100%; max-height: 44px; object-fit: contain; display: block; }
.sidebar-label {
    margin: 0 10px 7px;
    color: rgba(255,255,255,.45);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.navigation { display: grid; gap: 5px; position: relative; z-index: 1; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: rgba(255,255,255,.78);
    font-size: 12.5px;
    font-weight: 650;
    text-decoration: none;
    transition: .18s ease;
}
.nav-item svg { width: 18px; height: 18px; fill: currentColor; flex: 0 0 auto; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); transform: translateX(2px); }
.nav-item.active {
    color: #fff;
    border-color: rgba(255,255,255,.13);
    background: linear-gradient(90deg, rgba(13,103,232,.85), rgba(36,128,244,.55));
    box-shadow: 0 10px 20px rgba(0, 76, 181, .25), inset 3px 0 0 var(--gold-500);
}
.sidebar-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding: 11px 10px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 11px;
    background: rgba(255,255,255,.055);
}
.sidebar-footer-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--navy-950);
    background: var(--gold-500);
    font-size: 12px;
    font-weight: 900;
}
.sidebar-footer strong, .sidebar-footer span { display: block; }
.sidebar-footer strong { font-size: 11px; }
.sidebar-footer span { margin-top: 2px; color: rgba(255,255,255,.55); font-size: 9px; line-height: 1.35; }
.sidebar-backdrop { display: none; }

.main-area { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 92px;
    padding: 18px clamp(22px, 3vw, 46px);
    border-bottom: 1px solid rgba(202, 213, 229, .75);
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(16px);
}
.eyebrow, .section-kicker {
    margin: 0 0 5px;
    color: var(--blue-600);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.topbar h1 { margin: 0; font-size: clamp(21px, 2vw, 28px); letter-spacing: -.035em; }
.topbar-meta { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.status-chip, .timezone-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid #caead8;
    border-radius: 999px;
    color: var(--green-700);
    background: #f4fcf7;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
    white-space: nowrap;
}
.status-chip.disconnected { color: var(--red-700); border-color: #ffd2d7; background: #fff6f7; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(12,141,75,.1); }
.status-chip.disconnected .status-dot { box-shadow: 0 0 0 4px rgba(214,44,58,.1); }
.timezone-chip { color: var(--slate-700); border-color: var(--slate-200); background: var(--slate-100); }
.mobile-menu { display: none; width: 42px; height: 42px; padding: 10px; border: 0; border-radius: 10px; background: var(--slate-100); cursor: pointer; }
.mobile-menu span { display: block; height: 2px; margin: 4px 0; border-radius: 2px; background: var(--navy-900); }
.page-content { width: min(1560px, 100%); margin: 0 auto; padding: 30px clamp(22px, 3vw, 46px) 50px; }

.flash-stack { display: grid; gap: 10px; margin-bottom: 20px; }
.flash { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 14px 16px; border-radius: 12px; font-size: 14px; font-weight: 650; box-shadow: var(--shadow-sm); }
.flash-success { color: #08673a; border: 1px solid #bce8cf; background: #edfbf3; }
.flash-error { color: #a51d2a; border: 1px solid #ffc4cb; background: #fff0f2; }
.flash button { border: 0; color: inherit; background: transparent; font-size: 20px; cursor: pointer; }

.hero-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    min-height: 150px;
    padding: 28px 30px;
    margin-bottom: 22px;
    color: #fff;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 85% 50%, rgba(255,255,255,.13), transparent 15rem),
        linear-gradient(115deg, var(--navy-900), #0b4caa 65%, #1476e4);
    box-shadow: var(--shadow-md);
}
.hero-panel::before, .hero-panel::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50%;
    pointer-events: none;
}
.hero-panel::before { width: 250px; height: 250px; right: 90px; top: -165px; box-shadow: 0 0 0 32px rgba(255,255,255,.025), 0 0 0 64px rgba(255,255,255,.018); }
.hero-panel::after { width: 110px; height: 110px; right: -30px; bottom: -60px; }
.hero-panel > * { position: relative; z-index: 1; }
.hero-panel .section-kicker { color: #94c7ff; }
.hero-panel h2, .page-intro h2, .table-card-header h2 { margin: 0; letter-spacing: -.035em; }
.hero-panel h2 { font-size: clamp(24px, 2.5vw, 34px); }
.hero-panel p { max-width: 680px; margin: 9px 0 0; color: rgba(255,255,255,.72); font-size: 14px; line-height: 1.6; }
.hero-actions { display: flex; align-items: stretch; gap: 12px; flex: 0 0 auto; }
.refresh-box { min-width: 135px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 12px; background: rgba(255,255,255,.08); }
.refresh-box span, .refresh-box strong { display: block; }
.refresh-box > span { color: rgba(255,255,255,.62); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.refresh-box strong { margin-top: 4px; font-size: 20px; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button svg { width: 18px; height: 18px; fill: currentColor; }
.button-primary { color: #fff; background: linear-gradient(135deg, var(--blue-600), #0450bd); box-shadow: 0 9px 20px rgba(4,80,189,.23); }
.hero-panel .button-primary { color: var(--navy-900); background: #fff; box-shadow: 0 10px 25px rgba(0,0,0,.15); }
.button-secondary { color: var(--blue-700); border-color: #cfe0f7; background: #eef6ff; }
.button-ghost { color: var(--slate-700); border-color: var(--slate-200); background: #fff; }
.button-icon { font-size: 21px; line-height: 1; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 126px;
    padding: 21px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,.94);
    box-shadow: var(--shadow-sm);
}
.metric-card::after { content: ""; position: absolute; right: -28px; bottom: -38px; width: 95px; height: 95px; border-radius: 50%; background: currentColor; opacity: .035; }
.metric-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; flex: 0 0 auto; }
.metric-icon svg { width: 27px; height: 27px; fill: currentColor; }
.metric-card span, .metric-card small { display: block; }
.metric-card > div:last-child > span { color: var(--slate-500); font-size: 12px; font-weight: 700; }
.metric-card strong { display: block; margin: 3px 0; font-size: 27px; letter-spacing: -.04em; }
.metric-card small { color: var(--slate-500); font-size: 11px; }
.metric-total { color: var(--blue-600); }
.metric-total .metric-icon { background: #eaf3ff; }
.metric-online { color: var(--green-700); }
.metric-online .metric-icon { background: var(--green-100); }
.metric-offline { color: var(--red-700); }
.metric-offline .metric-icon { background: var(--red-100); }
.metric-refresh { color: #9b7415; }
.metric-refresh .metric-icon { background: var(--gold-100); }
.metric-card .metric-time { max-width: 190px; font-size: 15px; line-height: 1.35; letter-spacing: -.01em; }

.table-card, .form-card, .info-card, .logs-filter-card {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow-sm);
}
.table-card { overflow: hidden; }
.table-card-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--slate-200); }
.table-card-header h2 { font-size: 21px; }
.search-field { display: flex; align-items: center; gap: 9px; width: min(330px, 100%); padding: 0 13px; border: 1px solid var(--slate-200); border-radius: 11px; background: #f9fbfe; }
.search-field:focus-within { border-color: #8abaf5; box-shadow: 0 0 0 3px rgba(36,128,244,.1); }
.search-field svg { width: 19px; height: 19px; fill: var(--slate-500); }
.search-field input { width: 100%; height: 42px; border: 0; outline: 0; background: transparent; color: var(--slate-900); }
.table-wrap { overflow-x: auto; }
.device-table { width: 100%; min-width: 1040px; border-collapse: collapse; }
.device-table th { padding: 13px 18px; color: var(--slate-500); background: #f8fafd; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.device-table td { padding: 16px 18px; border-top: 1px solid #edf1f6; color: var(--slate-700); font-size: 12px; vertical-align: middle; }
.device-table tbody tr:hover { background: #fbfdff; }
.device-table td strong { color: var(--slate-900); }
.device-id { font-size: 13px; letter-spacing: .01em; }
.device-status { display: inline-flex; align-items: center; gap: 7px; min-width: 76px; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 850; }
.device-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255,255,255,.8); }
.device-status.online { color: var(--green-700); background: var(--green-100); }
.device-status.offline { color: var(--red-700); background: var(--red-100); }
.topic-code { display: inline-block; max-width: 220px; padding: 5px 7px; overflow: hidden; border-radius: 7px; color: #174a83; background: #eff6ff; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.cell-subtext { display: block; margin-top: 4px; color: var(--slate-500); }
.payload-preview { max-width: 230px; overflow: hidden; color: var(--slate-700); font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 8px; }
.row-actions a { padding: 6px 9px; border: 1px solid #d8e5f5; border-radius: 8px; color: var(--blue-700); background: #f6faff; font-size: 10px; font-weight: 800; text-decoration: none; }
.row-actions a:hover { background: #eaf3ff; }
.empty-row:hover { background: transparent !important; }
.empty-state { display: grid; place-items: center; min-height: 210px; padding: 30px; color: var(--slate-500); text-align: center; }
.empty-state::before { content: ""; width: 55px; height: 55px; margin-bottom: 12px; border: 8px solid #e9eff7; border-top-color: #b9d5f7; border-radius: 50%; }
.empty-state strong { margin-bottom: 5px; font-size: 15px; }
.empty-state span { font-size: 12px; }
.empty-state a { margin-top: 12px; color: var(--blue-600); font-size: 12px; font-weight: 800; }
.table-footer { display: flex; justify-content: space-between; gap: 20px; padding: 13px 20px; border-top: 1px solid var(--slate-200); color: var(--slate-500); background: #fbfcfe; font-size: 10px; }

.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 22px; }
.page-intro h2 { font-size: clamp(25px, 3vw, 36px); }
.page-intro p { max-width: 760px; margin: 9px 0 0; color: var(--slate-500); line-height: 1.6; }
.onboarding-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .65fr); gap: 22px; align-items: start; }
.form-card { padding: 28px; }
.device-form { display: grid; gap: 22px; }
.form-section-heading { display: flex; align-items: center; gap: 13px; }
.step-number { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--blue-600), #074cae); font-size: 14px; font-weight: 900; box-shadow: 0 8px 16px rgba(13,103,232,.2); }
.form-section-heading h3 { margin: 0; font-size: 17px; }
.form-section-heading p { margin: 4px 0 0; color: var(--slate-500); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 8px; }
.field-full { grid-column: 1 / -1; }
.field > span { color: var(--slate-700); font-size: 12px; font-weight: 800; }
.field em { color: var(--red-700); font-style: normal; }
.field input, .field select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--slate-300);
    border-radius: 11px;
    outline: 0;
    color: var(--slate-900);
    background: #fff;
    transition: .16s ease;
}
.field input:focus, .field select:focus { border-color: #75acf0; box-shadow: 0 0 0 4px rgba(36,128,244,.1); }
.field small { color: var(--slate-500); font-size: 10px; line-height: 1.5; }
.field small code { padding: 2px 5px; border-radius: 4px; background: var(--slate-100); }
.input-with-icon { display: flex; align-items: center; padding-left: 13px; border: 1px solid var(--slate-300); border-radius: 11px; background: #fff; }
.input-with-icon:focus-within { border-color: #75acf0; box-shadow: 0 0 0 4px rgba(36,128,244,.1); }
.input-with-icon svg { width: 21px; height: 21px; fill: var(--blue-600); }
.input-with-icon input { border: 0; box-shadow: none !important; }
.form-divider { height: 1px; background: var(--slate-200); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.info-card { position: sticky; top: 115px; padding: 25px; overflow: hidden; }
.info-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 145px; height: 145px; border-radius: 50%; background: rgba(201,189,67,.08); }
.info-illustration { display: grid; place-items: center; height: 155px; margin: -5px -5px 20px; border-radius: 16px; background: linear-gradient(145deg, #eef6ff, #f9fbff); }
.info-illustration svg { width: 150px; height: 125px; fill: none; stroke: var(--blue-600); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.info-illustration .signal { stroke: var(--gold-500); }
.info-card h3 { margin: 0; font-size: 18px; }
.info-card > p { margin: 8px 0 18px; color: var(--slate-500); font-size: 12px; line-height: 1.6; }
.rule-card { display: flex; align-items: center; gap: 11px; padding: 12px; margin-top: 10px; border-radius: 11px; }
.rule-card > span { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.rule-card strong, .rule-card small { display: block; }
.rule-card strong { font-size: 12px; }
.rule-card small { margin-top: 2px; color: var(--slate-500); font-size: 9px; }
.rule-online { color: var(--green-700); background: var(--green-100); }
.rule-offline { color: var(--red-700); background: var(--red-100); }
.info-note { padding: 14px; margin-top: 18px; border-left: 3px solid var(--gold-500); border-radius: 0 10px 10px 0; background: var(--gold-100); }
.info-note strong, .info-note span { display: block; }
.info-note strong { color: #765b11; font-size: 11px; }
.info-note span { margin-top: 4px; color: #8a782d; font-size: 9px; line-height: 1.5; }

.logs-intro { align-items: flex-start; }
.logs-filter-card { padding: 18px 20px; margin-bottom: 18px; border-radius: var(--radius-md); }
.logs-filter-form { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.compact-field { width: min(520px, 100%); }
.logs-filter-actions { display: flex; align-items: center; gap: 10px; }
.record-count { padding: 7px 10px; border-radius: 999px; color: var(--blue-700); background: #eaf3ff; font-size: 10px; font-weight: 800; }
.log-table { min-width: 920px; }
.log-table td { vertical-align: top; }
.record-index { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; color: var(--blue-700); background: #eaf3ff; font-size: 10px; font-weight: 850; }
.payload-full { max-width: 620px; max-height: 160px; padding: 12px; margin: 0; overflow: auto; border: 1px solid #e3eaf4; border-radius: 9px; color: #2e405d; background: #f8fafd; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .onboarding-layout { grid-template-columns: 1fr; }
    .info-card { position: static; }
}

@media (max-width: 900px) {
    .sidebar { width: min(var(--sidebar-width), 88vw); transform: translateX(-103%); transition: transform .22s ease; }
    .main-area { margin-left: 0; }
    .mobile-menu { display: block; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; display: block; visibility: hidden; opacity: 0; background: rgba(2,15,34,.56); transition: .22s ease; }
    body.nav-open { overflow: hidden; }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open .sidebar-backdrop { visibility: visible; opacity: 1; }
    .hero-panel { align-items: flex-start; flex-direction: column; }
    .hero-actions { width: 100%; }
}

@media (max-width: 650px) {
    .topbar { min-height: 78px; padding: 14px 16px; }
    .topbar .eyebrow, .timezone-chip { display: none; }
    .topbar h1 { font-size: 19px; }
    .status-chip { padding: 0 9px; font-size: 9px; }
    .page-content { padding: 20px 14px 38px; }
    .hero-panel { padding: 23px 20px; border-radius: 17px; }
    .hero-actions { flex-direction: column; }
    .refresh-box { min-width: 0; }
    .metric-grid { grid-template-columns: 1fr; gap: 11px; }
    .metric-card { min-height: 105px; }
    .table-card-header, .page-intro { align-items: stretch; flex-direction: column; }
    .search-field { width: 100%; }
    .table-footer { flex-direction: column; gap: 5px; }
    .form-card, .info-card { padding: 20px; border-radius: 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
    .logs-filter-form { align-items: stretch; flex-direction: column; }
    .logs-filter-actions .button { width: 100%; }
}

/* --------------------------------------------------------------------------
   Dashboard v2: utility-themed summary and enhanced gateway registry
   -------------------------------------------------------------------------- */
.dashboard-hero {
    min-height: 178px;
    background:
        linear-gradient(90deg, rgba(3, 24, 55, .98), rgba(10, 75, 169, .94) 62%, rgba(24, 119, 229, .88)),
        radial-gradient(circle at 88% 20%, rgba(201, 189, 67, .42), transparent 18rem);
}
.dashboard-hero::before {
    right: 130px;
    top: -190px;
    width: 300px;
    height: 300px;
}
.hero-copy { max-width: 820px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 19px; }
.hero-badges > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 31px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    color: rgba(255,255,255,.82);
    background: rgba(255,255,255,.075);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .015em;
}
.hero-badges svg { width: 15px; height: 15px; fill: #a9d3ff; }
.live-pulse {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5ee39b;
    box-shadow: 0 0 0 4px rgba(94,227,155,.14);
}
.live-pulse::after {
    content: "";
    position: absolute;
    inset: -5px;
    border: 1px solid rgba(94,227,155,.6);
    border-radius: 50%;
    animation: live-pulse-ring 1.8s ease-out infinite;
}
@keyframes live-pulse-ring {
    0% { transform: scale(.55); opacity: .9; }
    100% { transform: scale(1.45); opacity: 0; }
}
.hero-onboard-button { min-width: 168px; }

.utility-summary-stage {
    position: relative;
    isolation: isolate;
    min-height: 190px;
    padding: 24px;
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid rgba(190, 208, 232, .8);
    border-radius: 26px;
    background:
        linear-gradient(120deg, rgba(238,247,255,.96), rgba(249,252,255,.98) 46%, rgba(241,250,247,.96));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 12px 34px rgba(17, 55, 103, .08);
}
.utility-summary-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(30, 103, 196, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 103, 196, .035) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(90deg, #000, transparent 96%);
}
.utility-backdrop { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.utility-visual {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 176px;
    height: 176px;
    border: 1px solid currentColor;
    border-radius: 50%;
    opacity: .11;
    transform: translateY(-50%);
}
.utility-visual::before, .utility-visual::after {
    content: "";
    position: absolute;
    border: 1px solid currentColor;
    border-radius: 50%;
}
.utility-visual::before { inset: 18px; opacity: .55; }
.utility-visual::after { inset: 38px; opacity: .35; }
.utility-visual svg { width: 68px; height: 68px; fill: currentColor; }
.utility-visual span { position: absolute; bottom: 15px; font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.utility-energy { left: 5%; color: #d2a929; }
.utility-water { left: 43%; color: #1678de; }
.utility-temperature { right: 5%; color: #de5260; }
.utility-summary-stage .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 0;
}
.utility-summary-stage .metric-card {
    min-height: 138px;
    border-color: rgba(205, 216, 232, .88);
    background: rgba(255,255,255,.9);
    box-shadow: 0 15px 32px rgba(22, 59, 108, .09), inset 0 1px 0 #fff;
    backdrop-filter: blur(7px);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.utility-summary-stage .metric-card:hover {
    transform: translateY(-3px);
    border-color: #bad2ef;
    box-shadow: 0 19px 38px rgba(22, 59, 108, .13), inset 0 1px 0 #fff;
}
.utility-summary-stage .metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 16px 0 0 16px;
    background: currentColor;
    opacity: .85;
}
.utility-summary-stage .metric-icon { width: 58px; height: 58px; border-radius: 18px; }
.utility-summary-stage .metric-card strong { font-size: 31px; }

.gateway-registry-card {
    position: relative;
    border-color: #d7e3f2;
    box-shadow: 0 20px 48px rgba(15, 50, 97, .1);
}
.registry-accent {
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    height: 4px;
    background: linear-gradient(90deg, var(--gold-500), var(--blue-600) 42%, #62b8f5 72%, #36b878);
}
.registry-header {
    position: relative;
    align-items: center;
    padding: 27px 28px 23px;
    background:
        radial-gradient(circle at 95% 0, rgba(36,128,244,.1), transparent 17rem),
        linear-gradient(180deg, #fff, #fbfdff);
}
.registry-title-group { display: flex; align-items: center; gap: 15px; min-width: 290px; }
.registry-title-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    border: 1px solid #cfe0f5;
    border-radius: 16px;
    color: var(--blue-600);
    background: linear-gradient(145deg, #eaf4ff, #fff);
    box-shadow: 0 9px 20px rgba(13,103,232,.11);
}
.registry-title-icon svg { width: 27px; height: 27px; fill: currentColor; }
.registry-title-group h2 { font-size: 23px; }
.registry-title-group p { margin: 5px 0 0; color: var(--slate-500); font-size: 11px; line-height: 1.5; }
.registry-toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.registry-legends { display: flex; align-items: center; gap: 7px; }
.registry-legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 31px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 850;
}
.registry-legend i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.registry-legend.online { color: var(--green-700); background: var(--green-100); }
.registry-legend.offline { color: var(--red-700); background: var(--red-100); }
.registry-search { width: min(360px, 100%); min-height: 47px; border-color: #d6e1ef; background: #f7faff; }
.registry-search input { height: 45px; }
.registry-table-wrap { background: #fff; }
.registry-table { min-width: 950px; }
.registry-table th {
    padding-top: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dfe8f4;
    color: #62718a;
    background: linear-gradient(180deg, #f7faff, #f2f6fb);
}
.registry-table td { padding-top: 18px; padding-bottom: 18px; }
.registry-row {
    position: relative;
    transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.registry-row td:first-child { border-left: 4px solid transparent; }
.registry-row.is-online td:first-child { border-left-color: #32b873; }
.registry-row.is-offline td:first-child { border-left-color: #e75966; }
.registry-row:hover {
    background: linear-gradient(90deg, rgba(237,246,255,.72), #fff 72%);
    box-shadow: inset 0 1px 0 #e5eef8, inset 0 -1px 0 #e5eef8;
}
.registry-row:hover .device-id { color: var(--blue-600); }
.client-name-cell { color: #3f4e66; font-weight: 650; }
.received-time { display: block; max-width: 230px; line-height: 1.42; }
.registry-table .topic-code { max-width: 260px; padding: 7px 9px; border: 1px solid #dce9f8; background: #f2f7fd; }
.sortable-column { padding: 0 !important; }
.sort-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 47px;
    padding: 0 18px;
    border: 0;
    outline: 0;
    color: inherit;
    background: transparent;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
}
.sort-button:hover, .sort-button:focus-visible { color: var(--blue-600); background: rgba(13,103,232,.055); }
.sort-button:focus-visible { box-shadow: inset 0 0 0 2px rgba(13,103,232,.35); }
.sort-icon { display: grid; grid-template-rows: 8px 8px; width: 16px; height: 17px; }
.sort-chevron { width: 16px; height: 9px; fill: #a9b4c5; }
.sort-button[data-direction="asc"] .sort-chevron-up,
.sort-button[data-direction="desc"] .sort-chevron-down { fill: var(--blue-600); }
.row-actions a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
    padding: 0 10px;
    border-color: #d5e4f6;
    background: linear-gradient(180deg, #fff, #f2f7fd);
    box-shadow: 0 4px 10px rgba(21,80,152,.06);
}
.row-actions a svg { width: 14px; height: 14px; fill: currentColor; }
.row-actions a:hover { border-color: #b8d3f3; background: #eaf4ff; transform: translateY(-1px); }
.registry-footer {
    padding: 14px 24px;
    border-top-color: #dfe8f4;
    background: linear-gradient(180deg, #fbfdff, #f7faff);
    font-size: 10px;
    font-weight: 700;
}
.registry-footer-rule { display: inline-flex; align-items: center; gap: 7px; }
.registry-footer-rule i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-500); box-shadow: 0 0 0 4px rgba(201,189,67,.13); }

@media (max-width: 1180px) {
    .utility-summary-stage .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .utility-visual { width: 145px; height: 145px; }
    .registry-header { align-items: stretch; flex-direction: column; }
    .registry-toolbar { justify-content: space-between; }
    .registry-search { flex: 1 1 300px; }
}

@media (max-width: 820px) {
    .utility-summary-stage { padding: 18px; }
    .utility-summary-stage .metric-grid { grid-template-columns: 1fr; }
    .utility-visual { width: 190px; height: 190px; opacity: .07; }
    .utility-energy { left: -45px; top: 18%; }
    .utility-water { left: auto; right: -50px; top: 50%; }
    .utility-temperature { left: -40px; right: auto; top: 82%; }
    .registry-toolbar { align-items: stretch; flex-direction: column; }
    .registry-legends { order: 2; }
    .registry-search { width: 100%; }
}

@media (max-width: 650px) {
    .dashboard-hero { min-height: 0; }
    .hero-badges { align-items: stretch; flex-direction: column; }
    .hero-badges > span { width: fit-content; }
    .hero-onboard-button { width: 100%; }
    .utility-summary-stage { padding: 13px; border-radius: 19px; }
    .utility-summary-stage .metric-card { min-height: 112px; }
    .registry-header { padding: 23px 18px 19px; }
    .registry-title-group { align-items: flex-start; min-width: 0; }
    .registry-title-icon { width: 46px; height: 46px; border-radius: 14px; }
    .registry-title-group h2 { font-size: 20px; }
    .registry-legends { flex-wrap: wrap; }
}

/* --------------------------------------------------------------------------
   V3 dashboard enhancements
   -------------------------------------------------------------------------- */
.main-area {
    position: relative;
    isolation: isolate;
    overflow: clip;
    background:
        radial-gradient(circle at 84% 12%, rgba(33, 126, 237, .15), transparent 28rem),
        radial-gradient(circle at 22% 62%, rgba(44, 184, 130, .09), transparent 25rem),
        linear-gradient(135deg, rgba(246,250,255,.98), rgba(237,244,253,.98));
}
.main-area::before {
    content: "";
    position: fixed;
    inset: 0 0 0 var(--sidebar-width);
    z-index: 0;
    pointer-events: none;
    opacity: .72;
    background-image: url("../img/technical-grid.svg");
    background-position: top center;
    background-size: 1200px 800px;
    background-repeat: repeat-y;
}
.main-area::after {
    content: "";
    position: fixed;
    inset: 0 0 0 var(--sidebar-width);
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(110deg, rgba(255,255,255,.62), transparent 34%, rgba(255,255,255,.22) 67%, transparent),
        radial-gradient(circle at 72% 74%, rgba(201,189,67,.08), transparent 22rem);
}
.page-content { position: relative; z-index: 1; }
.topbar {
    z-index: 20;
    background:
        linear-gradient(90deg, rgba(255,255,255,.94), rgba(247,251,255,.9)),
        url("../img/technical-grid.svg") center 16% / 980px auto;
}

.flash { transition: opacity .32s ease, transform .32s ease, margin .32s ease, padding .32s ease; }
.flash-auto-dismiss {
    opacity: 0;
    transform: translateY(-8px) scale(.985);
}

.utility-summary-stage {
    background:
        linear-gradient(120deg, rgba(239,248,255,.93), rgba(252,254,255,.96) 46%, rgba(239,250,247,.93)),
        url("../img/technical-grid.svg") center / 1000px auto;
}

.metric-online, .metric-offline {
    isolation: isolate;
}
.metric-online .metric-icon,
.metric-offline .metric-icon {
    position: relative;
    z-index: 1;
}
.metric-online .metric-icon::before,
.metric-online .metric-icon::after,
.metric-offline .metric-icon::before,
.metric-offline .metric-icon::after {
    content: "";
    position: absolute;
    inset: -7px;
    z-index: -1;
    border: 1px solid currentColor;
    border-radius: 21px;
    opacity: 0;
    pointer-events: none;
}
.metric-online .metric-icon {
    animation: online-icon-float 2.6s ease-in-out infinite;
}
.metric-online .metric-icon::before {
    animation: online-signal-ring 2.2s ease-out infinite;
}
.metric-online .metric-icon::after {
    animation: online-signal-ring 2.2s .72s ease-out infinite;
}
.metric-offline .metric-icon {
    animation: offline-alert-breathe 2.4s ease-in-out infinite;
}
.metric-offline .metric-icon::before {
    animation: offline-signal-ring 2.6s ease-out infinite;
}
.metric-offline .metric-icon::after {
    animation: offline-signal-ring 2.6s .86s ease-out infinite;
}
.metric-online strong,
.metric-offline strong {
    transform-origin: left center;
}
.metric-count-updated {
    animation: metric-count-pop .48s cubic-bezier(.2,.85,.32,1.35);
}

@keyframes online-icon-float {
    0%, 100% { transform: translateY(0); box-shadow: 0 0 0 rgba(12,141,75,0); }
    50% { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(12,141,75,.16); }
}
@keyframes online-signal-ring {
    0% { opacity: .48; transform: scale(.72); }
    70%, 100% { opacity: 0; transform: scale(1.28); }
}
@keyframes offline-alert-breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(214,44,58,0); }
    50% { transform: scale(1.045); box-shadow: 0 10px 24px rgba(214,44,58,.15); }
}
@keyframes offline-signal-ring {
    0% { opacity: .34; transform: scale(.78); }
    70%, 100% { opacity: 0; transform: scale(1.22); }
}
@keyframes metric-count-pop {
    0% { opacity: .52; transform: translateY(4px) scale(.88); }
    65% { opacity: 1; transform: translateY(-1px) scale(1.12); }
    100% { transform: translateY(0) scale(1); }
}

.gateway-registry-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,253,255,.98)),
        url("../img/technical-grid.svg") center / 1080px auto;
}
.registry-header {
    background:
        radial-gradient(circle at 95% 0, rgba(36,128,244,.14), transparent 17rem),
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,251,255,.96)),
        url("../img/technical-grid.svg") center / 900px auto;
}
.registry-title-group h2 { margin-top: 2px; }
.registry-title-group > div { display: grid; align-content: center; }

@media (max-width: 900px) {
    .main-area::before, .main-area::after { inset: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .metric-online .metric-icon,
    .metric-offline .metric-icon,
    .metric-online .metric-icon::before,
    .metric-online .metric-icon::after,
    .metric-offline .metric-icon::before,
    .metric-offline .metric-icon::after,
    .metric-count-updated,
    .live-pulse::after {
        animation: none !important;
    }
    .flash { transition: none; }
}

/* Authentication and role-based administration */
.user-menu { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border: 1px solid #d9e5f2; border-radius: 12px; background: #fff; }
.user-menu a { display: grid; color: #17233b; text-decoration: none; line-height: 1.1; }
.user-menu a span { margin-top: 3px; color: #71819a; font-size: 11px; }
.user-menu form { margin: 0; }
.user-menu button { border: 0; border-left: 1px solid #dfe7f0; background: transparent; color: #c02b3d; cursor: pointer; font-weight: 700; padding: 7px 4px 7px 11px; }
.row-actions form { display: inline-flex; margin: 0; }
.row-actions button { font: inherit; }
.row-action-danger { border: 0; border-radius: 7px; background: #fff0f2; color: #c3263b; cursor: pointer; font-weight: 750; padding: 7px 10px; }
.row-action-danger:hover { background: #c3263b; color: #fff; }
.button-small { padding: 7px 12px; font-size: 12px; }
.expiry-badge { display: inline-flex; border-radius: 999px; background: #e8f7ee; color: #08723c; font-weight: 750; padding: 5px 9px; }
.expiry-badge.expired { background: #fff0f2; color: #bd263a; }
.admin-grid { display: grid; grid-template-columns: minmax(330px, .8fr) minmax(520px, 1.2fr); gap: 22px; align-items: start; }
.narrow-card { max-width: 760px; }
.assignment-fieldset { border: 1px solid #dbe6f2; border-radius: 13px; margin: 5px 0 20px; padding: 16px; }
.assignment-fieldset legend { color: #243753; font-weight: 800; padding: 0 7px; }
.device-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 300px; overflow: auto; }
.device-check { display: flex; align-items: flex-start; gap: 10px; border: 1px solid #dfe8f2; border-radius: 10px; cursor: pointer; padding: 11px; }
.device-check:has(input:checked) { border-color: #2676db; background: #f1f7ff; }
.device-check input { margin-top: 4px; }
.device-check span { display: grid; gap: 3px; }
.device-check small { color: #73839a; }
.account-toggle { margin-bottom: 18px; }
.account-status, .audit-action { display: inline-flex; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 5px 9px; text-transform: uppercase; }
.account-status.active { background: #e5f8ed; color: #08713b; }
.account-status.inactive { background: #edf0f4; color: #667389; }
.audit-action { background: #eaf3ff; color: #155fae; }
.auth-body { min-height: 100vh; margin: 0; background: radial-gradient(circle at 20% 20%, #144c91 0, #071f43 40%, #04152e 100%); display: grid; place-items: center; padding: 30px; }
.auth-shell { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(360px, .78fr); width: min(1030px, 100%); min-height: 570px; overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: 26px; box-shadow: 0 35px 90px rgba(0,0,0,.38); }
.auth-brand-panel { display: flex; flex-direction: column; justify-content: center; padding: 55px; color: #fff; background: linear-gradient(145deg, rgba(8,42,88,.78), rgba(9,90,156,.55)); }
.auth-brand-panel img { width: 170px; margin-bottom: 60px; border-radius: 8px; }
.auth-brand-panel h1 { max-width: 570px; margin: 10px 0 17px; font-size: clamp(34px, 4vw, 54px); line-height: 1.04; }
.auth-brand-panel p { max-width: 560px; color: #d5e6fa; font-size: 17px; line-height: 1.65; }
.auth-card { display: flex; flex-direction: column; justify-content: center; gap: 24px; background: #fff; padding: 50px; }
.auth-card h2 { margin: 7px 0; font-size: 34px; color: #14243d; }
.auth-card p { color: #718099; }
.auth-form { gap: 18px; }
.auth-form .button { justify-content: center; width: 100%; margin-top: 4px; }

@media (max-width: 1100px) {
    .admin-grid { grid-template-columns: 1fr; }
    .user-menu span { display: none; }
}
@media (max-width: 760px) {
    .auth-shell { grid-template-columns: 1fr; min-height: auto; }
    .auth-brand-panel { display: none; }
    .auth-card { padding: 34px 24px; }
    .device-check-grid { grid-template-columns: 1fr; }
    .user-menu a { display: none; }
    .user-menu { padding-left: 6px; }
}

/* 2026 utility ecosystem login */
.utility-auth-body {
    --utility-navy: #031b32;
    --utility-blue: #0878d5;
    --utility-cyan: #15c5df;
    --utility-teal: #17b89a;
    --utility-lime: #d0d63a;
    min-height: 100svh;
    overflow-x: hidden;
    position: relative;
    background:
        radial-gradient(circle at 8% 15%, rgba(0, 155, 219, .34), transparent 30%),
        radial-gradient(circle at 93% 85%, rgba(27, 193, 151, .22), transparent 31%),
        linear-gradient(132deg, #021425 0%, #06335b 47%, #03192e 100%);
    color: #10213a;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    padding: clamp(20px, 3vw, 44px);
}
.utility-auth-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: url("../img/technical-grid.svg");
    background-position: center;
    background-size: cover;
    opacity: .085;
    mix-blend-mode: screen;
}
.utility-auth-background { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.utility-orb { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; }
.utility-orb-one { width: 430px; height: 430px; left: -190px; top: -175px; border: 1px solid rgba(49,203,232,.52); box-shadow: inset 0 0 80px rgba(0,151,209,.18), 0 0 90px rgba(0,151,209,.13); }
.utility-orb-two { width: 580px; height: 580px; right: -260px; bottom: -300px; border: 1px solid rgba(43,201,157,.35); box-shadow: inset 0 0 100px rgba(32,188,149,.12); }
.utility-orb-three { width: 160px; height: 160px; right: 12%; top: 7%; background: rgba(207,215,56,.09); filter: blur(35px); }
.utility-circuit-lines { width: 100%; height: 100%; opacity: .18; }
.utility-circuit-lines path { fill: none; stroke: #54d5ea; stroke-width: 1.2; stroke-dasharray: 7 12; }
.utility-circuit-lines circle { fill: #d2d83e; filter: drop-shadow(0 0 7px #d2d83e); }
.utility-auth-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(560px, 1.22fr) minmax(390px, .78fr);
    width: min(1240px, 100%);
    min-height: min(760px, calc(100svh - clamp(40px, 6vw, 88px)));
    margin: auto;
    overflow: hidden;
    border: 1px solid rgba(207, 234, 249, .24);
    border-radius: 30px;
    background: rgba(4, 38, 68, .66);
    box-shadow: 0 40px 120px rgba(0, 10, 28, .56), 0 0 0 1px rgba(255,255,255,.03) inset;
    backdrop-filter: blur(20px);
}
.utility-story-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: clamp(32px, 4vw, 55px);
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(155deg, rgba(10, 85, 139, .74), rgba(3, 42, 73, .25) 58%),
        linear-gradient(145deg, rgba(7,57,96,.94), rgba(2,30,54,.92));
}
.utility-story-panel::after { content: ""; position: absolute; width: 430px; height: 430px; left: 43%; bottom: -250px; border-radius: 50%; background: rgba(15, 190, 184, .16); filter: blur(35px); }
.utility-brand-row { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.utility-logo-wrap { display: inline-flex; align-items: center; height: 57px; padding: 7px 13px; border-radius: 13px; background: #fff; box-shadow: 0 10px 30px rgba(0,14,32,.25); }
.utility-logo-wrap img { display: block; width: 166px; max-height: 43px; object-fit: contain; }
.utility-live-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(126,219,231,.27); border-radius: 999px; background: rgba(2,26,48,.35); color: #cfeef6; font-size: 11px; font-weight: 750; letter-spacing: .06em; padding: 9px 13px; text-transform: uppercase; backdrop-filter: blur(8px); }
.utility-live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #60e5b1; box-shadow: 0 0 0 5px rgba(96,229,177,.12), 0 0 15px rgba(96,229,177,.65); }
.utility-story-copy { position: relative; z-index: 3; max-width: 650px; margin-top: clamp(34px, 5vh, 58px); }
.utility-eyebrow, .utility-login-kicker { display: block; color: #55d9ee; font-size: 11px; font-weight: 850; letter-spacing: .2em; text-transform: uppercase; }
.utility-story-copy h1 { margin: 11px 0 14px; font-size: clamp(36px, 4.1vw, 60px); line-height: .99; letter-spacing: -.045em; }
.utility-story-copy h1 em { color: #d2d93c; font-style: normal; }
.utility-story-copy p { max-width: 600px; margin: 0; color: #c9dfeb; font-size: clamp(14px, 1.4vw, 17px); line-height: 1.62; }
.utility-ecosystem { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-height: 238px; margin-top: clamp(27px, 4vh, 40px); padding-right: 135px; }
.utility-tile { position: relative; z-index: 2; display: flex; align-items: center; gap: 11px; min-height: 94px; overflow: hidden; border: 1px solid rgba(139,210,229,.2); border-radius: 15px; background: linear-gradient(135deg, rgba(255,255,255,.13), rgba(255,255,255,.055)); padding: 10px; box-shadow: 0 15px 32px rgba(0,20,40,.13); backdrop-filter: blur(10px); transition: border-color .3s ease, transform .3s ease, background .3s ease; }
.utility-tile:hover { transform: translateY(-3px); border-color: rgba(89,218,235,.54); background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.08)); }
.utility-tile-image { flex: 0 0 65px; width: 65px; height: 66px; overflow: hidden; border-radius: 11px; background: #fff; }
.utility-tile-image img { width: 100%; height: 100%; object-fit: contain; }
.utility-tile > span:last-child { display: grid; min-width: 0; gap: 5px; }
.utility-tile small { color: #83ddec; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.utility-tile strong { color: #fff; font-size: 13px; line-height: 1.15; }
.utility-tile-energy small { color: #e4e94e; }
.utility-tile-stp small { color: #67e7c2; }
.utility-tile-automation small { color: #b2c5ff; }
.utility-iot-hub { position: absolute; z-index: 4; right: 1px; top: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 118px; height: 118px; border: 1px solid rgba(91,221,235,.45); border-radius: 50%; background: radial-gradient(circle, #0b81ae 0, #07567f 50%, #063456 100%); box-shadow: 0 0 0 8px rgba(23,196,220,.055), 0 15px 35px rgba(0,19,38,.35), 0 0 35px rgba(18,192,216,.15); transform: translateY(-50%); }
.utility-iot-hub svg { width: 36px; height: 36px; fill: #d6df43; filter: drop-shadow(0 0 9px rgba(214,223,67,.42)); }
.utility-iot-hub small { margin-top: 3px; color: #85e6f1; font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.utility-iot-hub strong { color: #fff; font-size: 14px; }
.iot-ring { position: absolute; inset: -11px; border: 1px solid rgba(63,213,231,.27); border-radius: 50%; animation: iot-ring-pulse 3s ease-out infinite; }
.iot-ring-two { inset: -22px; animation-delay: 1.3s; }
.ecosystem-connector { position: absolute; z-index: 1; right: 75px; width: 82px; border-top: 1px dashed rgba(92,218,232,.47); transform-origin: right center; }
.connector-a { top: 24%; transform: rotate(13deg); }.connector-b { top: 42%; transform: rotate(3deg); }.connector-c { top: 62%; transform: rotate(-5deg); }.connector-d { top: 80%; transform: rotate(-14deg); }
.utility-security-note { position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 23px; color: #d5e7ef; }
.utility-security-note svg { width: 28px; height: 28px; fill: #62dfb0; }
.utility-security-note span { display: grid; gap: 3px; }.utility-security-note strong { font-size: 12px; }.utility-security-note small { color: #8eb0c3; font-size: 10px; }
.utility-login-panel { display: flex; align-items: center; background: linear-gradient(160deg, rgba(255,255,255,.98), rgba(241,249,252,.95)); padding: clamp(35px, 4.5vw, 64px); }
.utility-login-inner { width: 100%; max-width: 440px; margin: auto; }
.utility-mobile-brand { display: none; }
.utility-login-kicker { color: #0879c8; }
.utility-login-panel h2 { margin: 10px 0 6px; color: #0a2745; font-size: clamp(36px, 4vw, 49px); line-height: 1.05; letter-spacing: -.04em; }
.utility-login-intro { margin: 0; color: #6e7f93; font-size: 15px; line-height: 1.55; }
.utility-mini-services { display: flex; flex-wrap: wrap; gap: 7px; margin: 23px 0 28px; }
.mini-service { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #dbe8f0; border-radius: 999px; background: #f8fbfd; color: #5b6e82; font-size: 10px; font-weight: 750; padding: 6px 9px; }
.mini-service svg { width: 14px; height: 14px; fill: #118bd1; }.mini-service.energy svg { fill: #c2a900; }.mini-service.automation svg { fill: #12a886; }
.utility-login-flash { margin: -10px 0 18px; }
.utility-login-form { display: grid; gap: 18px; }
.utility-auth-field { display: grid; gap: 8px; }
.utility-auth-field > span { color: #243a52; font-size: 12px; font-weight: 800; }
.utility-input-wrap { position: relative; display: flex; align-items: center; }
.utility-input-wrap > svg { position: absolute; z-index: 1; left: 15px; width: 19px; height: 19px; fill: #7c95aa; transition: fill .2s ease; }
.utility-input-wrap input { width: 100%; height: 55px; border: 1px solid #cddce8; border-radius: 12px; outline: 0; background: #fff; color: #14283e; font: inherit; font-size: 14px; padding: 0 48px 0 47px; box-shadow: 0 4px 12px rgba(13,55,88,.035); transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease; }
.utility-input-wrap input::placeholder { color: #a1afbc; }
.utility-input-wrap:focus-within > svg { fill: #078cd2; }
.utility-input-wrap input:focus { border-color: #0a9ed8; box-shadow: 0 0 0 4px rgba(10,158,216,.12), 0 9px 22px rgba(7,104,159,.08); transform: translateY(-1px); }
.password-visibility { position: absolute; right: 10px; display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.password-visibility:hover { background: #edf6fa; }.password-visibility svg { width: 20px; height: 20px; fill: #758ca0; }
.utility-signin-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 56px; margin-top: 4px; border: 0; border-radius: 12px; background: linear-gradient(105deg, #097ccb, #06a8ce 58%, #12b79b); color: #fff; cursor: pointer; font: inherit; font-size: 14px; font-weight: 850; box-shadow: 0 14px 28px rgba(7,126,181,.22); transition: box-shadow .25s ease, transform .25s ease, filter .25s ease; }
.utility-signin-button svg { width: 19px; height: 19px; fill: currentColor; transition: transform .25s ease; }
.utility-signin-button:hover { transform: translateY(-2px); filter: saturate(1.1); box-shadow: 0 18px 33px rgba(7,126,181,.31); }.utility-signin-button:hover svg { transform: translateX(4px); }
.utility-login-help { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 25px; color: #8495a5; font-size: 10px; }
.utility-login-help span { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; }.utility-login-help i { width: 6px; height: 6px; border-radius: 50%; background: #21b684; box-shadow: 0 0 0 4px rgba(33,182,132,.1); }
@keyframes iot-ring-pulse { 0% { opacity: 0; transform: scale(.82); } 35% { opacity: 1; } 100% { opacity: 0; transform: scale(1.12); } }

@media (max-width: 1080px) {
    .utility-auth-shell { grid-template-columns: minmax(450px, 1fr) minmax(360px, .82fr); }
    .utility-story-panel { padding: 34px; }
    .utility-ecosystem { padding-right: 0; }
    .utility-iot-hub, .ecosystem-connector { display: none; }
    .utility-login-panel { padding: 38px; }
}
@media (max-width: 820px) {
    .utility-auth-body { display: block; padding: 18px; }
    .utility-auth-shell { grid-template-columns: 1fr; min-height: calc(100svh - 36px); }
    .utility-story-panel { min-height: 360px; padding: 27px; }
    .utility-story-copy { margin-top: 27px; }
    .utility-story-copy h1 { font-size: clamp(34px, 8vw, 50px); }
    .utility-story-copy p { max-width: 560px; }
    .utility-ecosystem { grid-template-columns: repeat(4, minmax(130px, 1fr)); min-height: 95px; overflow-x: auto; margin: 26px -27px -8px; padding: 0 27px 13px; scrollbar-width: none; }
    .utility-ecosystem::-webkit-scrollbar { display: none; }
    .utility-tile { min-height: 82px; }
    .utility-tile-image { flex-basis: 52px; width: 52px; height: 55px; }
    .utility-security-note { display: none; }
    .utility-login-panel { padding: 38px 27px; }
    .utility-login-inner { max-width: 520px; }
}
@media (max-width: 520px) {
    .utility-auth-body { padding: 0; background: #f4fafc; }
    .utility-auth-body::before, .utility-auth-background { display: none; }
    .utility-auth-shell { min-height: 100svh; border: 0; border-radius: 0; box-shadow: none; }
    .utility-story-panel { display: none; }
    .utility-login-panel { min-height: 100svh; padding: 30px 23px; }
    .utility-mobile-brand { display: flex; width: 145px; height: 48px; align-items: center; margin-bottom: 46px; }
    .utility-mobile-brand img { width: 100%; max-height: 48px; object-fit: contain; }
    .utility-login-panel h2 { font-size: 40px; }
    .utility-mini-services { margin-bottom: 33px; }
    .utility-login-help { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    .iot-ring { animation: none; }
    .utility-tile, .utility-input-wrap input, .utility-signin-button, .utility-signin-button svg { transition: none; }
}



/* --------------------------------------------------------------------------
   Final interaction and product imagery enhancements
   -------------------------------------------------------------------------- */
.product-showcase {
    position: relative;
    width: 244px;
    height: 58px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(161, 190, 225, .6);
    border-radius: 16px;
    background:
        radial-gradient(circle at 16% 50%, rgba(36,128,244,.14), transparent 6rem),
        linear-gradient(135deg, rgba(255,255,255,.98), rgba(241,247,255,.96));
    box-shadow: 0 10px 26px rgba(13, 55, 108, .1), inset 0 1px 0 rgba(255,255,255,.9);
    isolation: isolate;
    transition: transform .28s cubic-bezier(.18,.86,.3,1.15), box-shadow .28s ease, border-color .28s ease;
}
.product-showcase:hover {
    transform: translateY(-4px) scale(1.035);
    border-color: rgba(78, 150, 235, .78);
    box-shadow: 0 18px 38px rgba(13, 74, 148, .2), 0 0 0 4px rgba(36,128,244,.1);
}
.product-slide {
    position: absolute;
    inset: 0 10px 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(24px) scale(.95);
    animation: product-showcase-cycle 28s ease-in-out infinite;
    pointer-events: none;
}
.product-image-frame {
    display: grid;
    place-items: center;
    width: 68px;
    height: 48px;
    flex: 0 0 68px;
    overflow: hidden;
    border: 1px solid rgba(187,205,228,.8);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 5px 13px rgba(14, 54, 105, .1);
}
.product-image-frame img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    padding: 1px;
}
.product-slide-copy { min-width: 0; }
.product-slide-copy small,
.product-slide-copy strong { display: block; white-space: nowrap; }
.product-slide-copy small {
    margin-bottom: 2px;
    color: var(--blue-600);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
}
.product-slide-copy strong {
    max-width: 130px;
    overflow: hidden;
    color: var(--navy-900);
    font-size: 12px;
    letter-spacing: -.01em;
    text-overflow: ellipsis;
}
.product-progress {
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-500), var(--blue-600), #28ad75);
    transform-origin: left center;
    animation: product-progress-cycle 4s linear infinite;
}

.utility-summary-stage .metric-card {
    z-index: 1;
    overflow: visible;
    transform-origin: center;
    transition:
        transform .34s cubic-bezier(.16,.86,.3,1.2),
        box-shadow .34s ease,
        border-color .34s ease,
        filter .34s ease;
}
.utility-summary-stage .metric-card::after {
    transition: transform .34s ease, opacity .34s ease;
}
.utility-summary-stage .metric-card:hover {
    z-index: 8;
    transform: translateY(-13px) scale(1.045);
    border-color: #7db9ff;
    box-shadow: 0 31px 64px rgba(15, 70, 145, .24), 0 0 0 4px rgba(36,128,244,.14), inset 0 1px 0 #fff;
    filter: saturate(1.09) brightness(1.015);
}
.utility-summary-stage .metric-card:hover::after {
    opacity: .09;
    transform: scale(1.28);
}
.utility-summary-stage .metric-card:hover .metric-icon {
    transform: translateY(-2px) scale(1.15) rotate(-5deg);
    box-shadow: 0 15px 28px rgba(13, 73, 149, .17);
}
.utility-summary-stage .metric-online:hover .metric-icon,
.utility-summary-stage .metric-offline:hover .metric-icon {
    animation: none;
}
.utility-summary-stage .metric-icon {
    transition: transform .34s cubic-bezier(.16,.86,.3,1.2), box-shadow .34s ease;
}
.utility-summary-stage .metric-total:hover {
    border-color: #61a9ff;
    box-shadow: 0 31px 64px rgba(13,103,232,.27), 0 0 0 4px rgba(36,128,244,.16), inset 0 1px 0 #fff;
}
.utility-summary-stage .metric-online:hover {
    border-color: #58ca91;
    box-shadow: 0 31px 64px rgba(12,141,75,.23), 0 0 0 4px rgba(12,141,75,.13), inset 0 1px 0 #fff;
}
.utility-summary-stage .metric-offline:hover {
    border-color: #ef8190;
    box-shadow: 0 31px 64px rgba(214,44,58,.22), 0 0 0 4px rgba(214,44,58,.12), inset 0 1px 0 #fff;
}
.gateway-registry-card {
    transition: transform .34s cubic-bezier(.16,.86,.3,1.2), box-shadow .34s ease, border-color .34s ease;
}
.gateway-registry-card:hover {
    transform: translateY(-7px);
    border-color: #a8c9ed;
    box-shadow: 0 31px 66px rgba(13, 61, 124, .18), 0 0 0 4px rgba(36,128,244,.075);
}
.registry-row:hover {
    position: relative;
    z-index: 2;
    transform: translateX(6px) scale(1.004);
    background: linear-gradient(90deg, rgba(225,241,255,.96), #fff 72%);
    box-shadow: 0 8px 20px rgba(13, 78, 154, .1), inset 0 1px 0 #dce9f7, inset 0 -1px 0 #dce9f7;
}

@keyframes product-showcase-cycle {
    0%, 11.2% { opacity: 1; transform: translateX(0) scale(1); }
    13.8%, 100% { opacity: 0; transform: translateX(-22px) scale(.97); }
}
@keyframes product-progress-cycle {
    0% { transform: scaleX(0); opacity: .45; }
    12% { opacity: 1; }
    100% { transform: scaleX(1); opacity: .9; }
}

@media (max-width: 1280px) {
    .product-showcase { width: 205px; }
    .product-slide-copy strong { max-width: 95px; }
}
@media (max-width: 1080px) {
    .product-showcase { display: none; }
}
@media (max-width: 650px) {
    .utility-summary-stage .metric-card:hover {
        transform: translateY(-8px) scale(1.025);
    }
}
@media (prefers-reduced-motion: reduce) {
    .product-slide,
    .product-progress {
        animation: none !important;
    }
    .product-slide:first-child { opacity: 1; transform: none; }
    .utility-summary-stage .metric-card,
    .gateway-registry-card,
    .registry-row,
    .product-showcase { transition: none !important; }
}
