:root {
    --bg: #071018;
    --bg-2: #0b1621;
    --panel: rgba(10, 18, 28, 0.94);
    --panel-2: rgba(14, 24, 36, 0.96);
    --line: rgba(154, 174, 196, 0.18);
    --line-strong: rgba(154, 174, 196, 0.28);
    --text: #f4f8fc;
    --text-strong: #ffffff;
    --text-soft: #dce9f6;
    --muted: #a7bdd1;
    --accent: #2dd4bf;
    --accent-2: #38bdf8;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    --radius: 12px;
    --radius-sm: 8px;
    --max-width: 1380px;
}

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
    margin: 0;
}

body {
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(56, 189, 248, 0.06), transparent 200px),
        linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: inherit;
}

.app-background,
.login-background {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bg-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(28px);
    opacity: 0.18;
}

.bg-orb-1 {
    width: 280px;
    height: 280px;
    top: -90px;
    right: -60px;
    background: var(--accent);
}

.bg-orb-2 {
    width: 320px;
    height: 320px;
    bottom: -120px;
    left: -80px;
    background: var(--accent-2);
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 100%);
}

.site-header,
.app-shell,
.site-footer,
.login-layout {
    position: relative;
    z-index: 1;
}

.site-header {
    padding: 8px 10px 0;
    z-index: 30;
}

.nav-shell {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(7, 15, 23, 0.9);
    box-shadow: var(--shadow);
    overflow: visible;
    position: relative;
    z-index: 31;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #041018;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-copy strong {
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand-copy small {
    color: var(--muted);
    font-size: 0.72rem;
}

.nav-pills-shell {
    gap: 4px;
    margin-left: 16px;
}

.nav-pills-shell .nav-link {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.86rem;
}

.nav-pills-shell .nav-link:hover,
.nav-pills-shell .nav-link:focus {
    color: var(--text);
    background: rgba(56, 189, 248, 0.1);
}

.navbar-collapse {
    position: relative;
    z-index: 32;
}

.navbar-toggler {
    padding: 6px 8px;
    border-color: var(--line-strong);
    box-shadow: none;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    min-width: 180px;
    margin-top: 6px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: rgba(12, 20, 30, 0.98);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.38);
    z-index: 2000;
}

.dropdown-item {
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 0.84rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(56, 189, 248, 0.12);
    color: var(--text);
}

.nav-utility {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-shell {
    max-width: var(--max-width);
    padding: 8px 10px 18px;
    position: relative;
    z-index: 1;
}

.flash-stack {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.flash-stack.compact {
    margin-bottom: 12px;
}

.flash-card {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--panel-2);
    font-size: 0.88rem;
}

.success {
    color: #d6ffe4;
    background: rgba(16, 60, 32, 0.95);
    border-color: rgba(34, 197, 94, 0.28);
}

.warning {
    color: #ffefcf;
    background: rgba(70, 49, 8, 0.95);
    border-color: rgba(245, 158, 11, 0.28);
}

.danger {
    color: #ffd9dd;
    background: rgba(72, 18, 24, 0.95);
    border-color: rgba(239, 68, 68, 0.28);
}

.info {
    color: #d8f4ff;
    background: rgba(11, 45, 65, 0.95);
    border-color: rgba(56, 189, 248, 0.28);
}

.compact-toolbar,
.data-panel,
form,
#config_adicionais,
table,
.login-card {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.compact-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-left h1 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-strong) !important;
    opacity: 1;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.08);
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.toolbar-metrics {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.metric-inline {
    min-width: 96px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.metric-inline span {
    display: block;
    color: var(--muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.metric-inline strong {
    display: block;
    margin-top: 2px;
    font-size: 0.9rem;
}

.compact-panel {
    padding: 8px;
    border-radius: var(--radius);
}

.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-title h1 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-strong) !important;
    font-weight: 700;
    opacity: 1;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.08);
}

.page-count {
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
    font-size: 0.74rem;
}

.page-actions,
.action-group,
.filter-grid,
.quick-links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.action-group {
    align-items: center;
    position: relative;
    flex-wrap: nowrap;
}

.page-actions .btn,
.quick-links .btn,
.action-group .btn,
.action-group a {
    width: auto;
    min-width: 86px;
    white-space: nowrap;
}

.action-group .action-primary {
    min-width: 108px;
}

.page-actions form,
.quick-links form,
.action-group form {
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.page-actions button,
.quick-links button,
.action-group button {
    width: auto;
}

.page-actions .auth-form button,
.quick-links .auth-form button,
.action-group .auth-form button {
    margin-top: 0;
}

.filter-grid {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    align-items: end;
}

.pon-usage-panel {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.pon-usage-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.pon-usage-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.pon-usage-item.ok {
    border-color: rgba(34, 197, 94, 0.28);
}

.pon-usage-item.alerta {
    border-color: rgba(245, 158, 11, 0.35);
}

.pon-usage-item.critico {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.08);
}

.pon-id {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-strong);
}

.pon-bar {
    font-size: 0.8rem;
    color: #d7ebff;
}

.pon-pct {
    font-size: 0.8rem;
    font-weight: 700;
}

.pon-total {
    font-size: 0.76rem;
    color: var(--muted);
}

.filter-item {
    min-width: 150px;
    flex: 1 1 150px;
}

.filter-item input,
.filter-item select {
    margin-bottom: 0;
}

.filter-grid .page-actions {
    align-items: end;
    align-self: end;
    flex: 0 0 auto;
}

.filter-grid .page-actions .btn,
.filter-grid .page-actions button {
    min-height: 42px;
    height: 42px;
    padding: 0 14px;
    flex: 0 0 auto;
    width: auto;
    border-radius: 12px;
}

.table-panel {
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    overflow: visible;
}

.low-usage {
    color: #86efac;
    font-weight: 700;
}

.medium-usage {
    color: #fcd34d;
    font-weight: 700;
}

.high-usage {
    color: #fca5a5;
    font-weight: 700;
}

.table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.table-sticky th:first-child,
.table-sticky td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: rgba(10, 18, 28, 0.98);
}

.table-sticky thead th:first-child {
    z-index: 3;
    background: rgba(17, 40, 57, 0.98);
}

.mono {
    font-family: Consolas, "Courier New", monospace;
    letter-spacing: 0.02em;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status-badge.online {
    color: #dcffe7;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.24);
}

.status-badge.offline {
    color: #ffd8dd;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.24);
}

.quick-links {
    margin-bottom: 10px;
}

.section-stack {
    display: grid;
    gap: 10px;
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.kv-item {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(12, 20, 30, 0.62);
}

.kv-item-wide {
    grid-column: 1 / -1;
}

.kv-label {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kv-value {
    display: block;
    margin-top: 6px;
    color: var(--text-strong);
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.3;
}

.tab-switch {
    display: inline-flex;
    gap: 6px;
    margin-bottom: 10px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.tab-btn {
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.tab-btn.is-active {
    color: var(--text-strong);
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
}

.tab-pane {
    display: none;
}

.tab-pane.is-active {
    display: block;
}

.monitor-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.monitor-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.monitor-card span {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.monitor-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.6rem;
    color: var(--text-strong);
}

.monitor-online {
    border-color: rgba(34, 197, 94, 0.35);
}

.monitor-offline {
    border-color: rgba(239, 68, 68, 0.35);
}

.monitor-unknown {
    border-color: rgba(245, 158, 11, 0.35);
}

.monitor-sections {
    display: grid;
    gap: 10px;
}

#tabelaAlarmes td:nth-child(3),
#tabelaAlarmes td:nth-child(4) {
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}

.search-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(12, 20, 30, 0.92);
    color: var(--text-soft);
    font-size: 0.82rem;
}

.search-loader-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.5);
    animation: pulse-dot 0.9s ease-in-out infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(0.85); opacity: 0.65; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.85); opacity: 0.65; }
}

.table-shell {
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
}

h1, h2, h3 {
    color: var(--text-strong);
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: visible;
}

th, td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    vertical-align: middle;
    font-size: 0.88rem;
}

th {
    background: rgba(56, 189, 248, 0.08);
    color: #dff7ff;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

td {
    color: var(--text-soft);
}

tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

tr:hover {
    background: rgba(45, 212, 191, 0.05);
}

.row-online {
    background: rgba(255, 255, 255, 0.01);
}

.row-offline {
    background: rgba(239, 68, 68, 0.12) !important;
}

.row-offline:hover {
    background: rgba(239, 68, 68, 0.18) !important;
}

.dense-table th,
.dense-table td {
    padding: 7px 10px;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 18px 12px;
}

form {
    width: min(760px, 100%);
    margin: 10px auto;
    padding: 16px;
    border-radius: var(--radius);
}

label {
    display: block;
    margin-bottom: 6px;
    color: #d8e8f8;
    font-size: 0.82rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(6, 12, 19, 0.88);
    color: var(--text-strong);
    font-size: 0.9rem;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(45, 212, 191, 0.55);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
}

button,
.btn,
a[href*='visualizar'],
a[href*='editar'],
a[href*='reiniciar'],
a[href*='excluir'] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

button,
.btn-primary,
.btn.btn-primary,
#search-button,
#tabelaLista td button {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #04131d;
}

.btn-outline-light {
    background: transparent;
    color: var(--text);
    border-color: var(--line-strong);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-warning,
a[href*='editar'] {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.34);
    color: #ffd998;
}

.btn-danger,
a[href*='excluir'] {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.34);
    color: #ffb7bf;
}

a[href*='visualizar'] {
    background: rgba(56, 189, 248, 0.16);
    border-color: rgba(56, 189, 248, 0.34);
    color: #b8ecff;
}

.action-group a[href*='/alarmes'] {
    background: rgba(129, 140, 248, 0.16);
    border-color: rgba(129, 140, 248, 0.34);
    color: #e0e7ff;
}

.action-group .btn-alarm-link {
    background: rgba(99, 102, 241, 0.14);
    border: 1px solid rgba(129, 140, 248, 0.4);
    color: #dbe4ff;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
}

.action-group .btn-alarm-link:hover,
.action-group .btn-alarm-link:focus {
    background: rgba(99, 102, 241, 0.24);
    border-color: rgba(165, 180, 252, 0.56);
    color: #f3f6ff;
}

.row-menu {
    position: relative;
}

.row-menu summary {
    list-style: none;
}

.row-menu summary::-webkit-details-marker {
    display: none;
}

.row-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
}

.row-menu-trigger:hover {
    border-color: rgba(56, 189, 248, 0.42);
    color: var(--text-strong);
    background: rgba(56, 189, 248, 0.1);
}

.row-menu-list {
    position: fixed;
    z-index: 4000;
    display: none;
    width: 180px;
    min-width: 180px;
    padding: 6px 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: rgba(10, 18, 28, 0.98);
    box-shadow: none;
}

.row-menu[open] .row-menu-list {
    display: grid;
    gap: 0;
}

.row-menu-list a {
    width: 100%;
    min-height: 30px;
    padding: 6px 10px;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--text-soft) !important;
    justify-content: flex-start;
    text-decoration: none !important;
    box-shadow: none !important;
    font-weight: 600;
}

.row-menu-list a:hover,
.row-menu-list a:focus {
    background: rgba(56, 189, 248, 0.18) !important;
    color: #dff7ff !important;
}

.row-menu-list a:last-child:hover,
.row-menu-list a:last-child:focus {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #ffd6dc !important;
}

.row-menu-list a:last-child {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--line) !important;
}

.alarm-open-link {
    min-height: 26px !important;
    padding: 4px 10px !important;
    font-size: 0.76rem !important;
    border-radius: 8px !important;
    white-space: nowrap;
}

a[href*='reiniciar'] {
    background: rgba(45, 212, 191, 0.16);
    border-color: rgba(45, 212, 191, 0.34);
    color: #b9fff2;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--line);
    color: var(--text);
}

button[type="submit"] {
    width: 100%;
}

#botaoCarregar {
    width: auto;
}

#tabelaLista td button {
    border-radius: 12px;
}

.btn-loading::after {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border-top: 2px solid rgba(4, 19, 29, 0.95);
    border-right: 2px solid transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#config_adicionais {
    width: 100%;
    margin: 0;
    border-radius: var(--radius);
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    vertical-align: middle;
}

.status-online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.45);
}

.status-offline {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.45);
}

main {
    flex: 1;
}

.site-footer {
    padding: 2px 10px 10px;
    text-align: center;
    color: var(--muted);
    font-size: 0.75rem;
}

.site-footer p {
    margin: 0 auto;
    max-width: var(--max-width);
}

.onu-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(4, 10, 16, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.onu-modal {
    width: min(760px, 100%);
    max-height: 86vh;
    overflow: auto;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(9, 17, 27, 0.98);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.onu-modal-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(9, 17, 27, 0.98);
}

.onu-modal-header h2 {
    margin: 0;
    font-size: 0.98rem;
}

.onu-modal-body {
    padding: 12px;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-layout {
    flex: 0 1 420px;
    width: 100%;
    max-width: 420px;
}

.login-card {
    width: 100%;
    padding: 18px;
    border-radius: var(--radius);
}

.login-card-header h2 {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.compact-panel,
.data-panel,
.table-shell,
table,
form,
#config_adicionais,
.login-card {
    color: var(--text);
}

.auth-form {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.auth-form button {
    margin-top: 4px;
}

@media (max-width: 992px) {
    .nav-shell {
        padding: 8px 10px;
    }

    .navbar-brand {
        margin-right: 8px;
    }

    .nav-pills-shell {
        margin: 10px 0 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .nav-pills-shell .nav-link,
    .nav-pills-shell .dropdown-toggle {
        width: 100%;
    }

    .navbar-collapse {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--line);
    }

    .nav-utility {
        margin-top: 8px;
        width: 100%;
    }

    .nav-utility .btn {
        width: 100%;
    }

    .dropdown-menu {
        position: static !important;
        min-width: 100%;
        margin-top: 6px;
    }
}

@media (max-width: 768px) {
    .kv-grid {
        grid-template-columns: 1fr;
    }

    .kv-item-wide {
        grid-column: auto;
    }

    .tab-switch {
        width: 100%;
    }

    .tab-btn {
        flex: 1 1 auto;
    }

    .monitor-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .monitor-sections .page-title {
        margin-bottom: 8px;
    }

    .site-header {
        padding: 6px 6px 0;
    }

    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions,
    .quick-links,
    .action-group {
        width: 100%;
    }

    .page-actions .btn,
    .quick-links .btn,
    .action-group .btn,
    .action-group a {
        flex: 1 1 auto;
    }

    .filter-item {
        min-width: 100%;
    }

    .brand-copy strong {
        font-size: 0.82rem;
    }

    .brand-copy small {
        font-size: 0.68rem;
    }

    .compact-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-metrics {
        width: 100%;
    }

    .metric-inline {
        flex: 1;
    }

    th, td {
        padding: 8px;
    }

    .app-shell {
        padding: 6px 6px 14px;
    }

    .compact-toolbar,
    .compact-panel,
    .login-card,
    form {
        padding: 10px;
    }

    .toolbar-left {
        align-items: stretch;
    }

    .toolbar-actions {
        width: 100%;
    }

    .toolbar-actions .btn,
    .toolbar-actions button {
        flex: 1 1 auto;
    }

    .table-panel table:not(.table-sticky) tbody,
    .table-panel table:not(.table-sticky) tr,
    .table-panel table:not(.table-sticky) th,
    .table-panel table:not(.table-sticky) td {
        display: block;
        width: 100%;
    }

    .table-panel table:not(.table-sticky) tr {
        padding: 6px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .table-panel table:not(.table-sticky) th {
        padding: 8px 8px 4px;
        border-bottom: 0;
        background: transparent;
        color: var(--muted);
    }

    .table-panel table:not(.table-sticky) td {
        padding: 0 8px 8px;
        border-bottom: 0;
    }
}
