:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-elevated: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --border: #334155;
    --border-light: #475569;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.2s ease;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

/* ===== TOPOLOGY ===== */
.topology-container {
    width: 100%;
    height: 300px;
    position: relative;
    overflow: auto;
    background: var(--bg);
    border-radius: var(--radius-sm);
}
.topology-svg {
    width: 100%;
    height: 100%;
    min-width: 800px;
}
.topology-node {
    cursor: pointer;
    transition: var(--transition);
}
.topology-node:hover {
    filter: brightness(1.2);
}
.topology-node-olt {
    fill: var(--primary);
    stroke: var(--primary-light);
    stroke-width: 2;
}
.topology-node-pon {
    fill: var(--bg-card);
    stroke: var(--border-light);
    stroke-width: 2;
}
.topology-node-pon.cluster-critical {
    fill: #7f1d1d;
    stroke: var(--danger);
    stroke-width: 3;
    animation: pulse-red 1.5s infinite;
}
.topology-node-pon.cluster-major {
    fill: #713f12;
    stroke: var(--warning);
    stroke-width: 3;
}
.topology-node-pon.cluster-minor {
    fill: #1e3a5f;
    stroke: var(--info);
    stroke-width: 2;
}
.topology-node-onu {
    fill: var(--success);
    stroke: #059669;
    stroke-width: 1.5;
}
.topology-node-onu.offline {
    fill: var(--danger);
    stroke: #b91c1c;
}
.topology-node-onu.alarm {
    fill: var(--warning);
    stroke: #d97706;
}
.topology-link {
    stroke: var(--border-light);
    stroke-width: 2;
    fill: none;
}
.topology-link-active {
    stroke: var(--success);
    stroke-width: 2;
    fill: none;
}
.topology-link-offline {
    stroke: var(--danger);
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 5,5;
}
.topology-label {
    font-size: 11px;
    fill: var(--text);
    font-weight: 600;
    text-anchor: middle;
    pointer-events: none;
}
.topology-sublabel {
    font-size: 9px;
    fill: var(--text-muted);
    text-anchor: middle;
    pointer-events: none;
}
.topology-badge {
    font-size: 10px;
    font-weight: 700;
    fill: #fff;
    text-anchor: middle;
    pointer-events: none;
}
.topology-tooltip {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    z-index: 1000;
    display: none;
    max-width: 250px;
}
@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ===== LOGIN ===== */
.login-screen {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    position: relative;
}
.login-screen::before {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%; max-width: 400px;
    box-shadow: var(--shadow-lg);
    position: relative; z-index: 1;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.logo-icon { font-size: 48px; margin-bottom: 12px; }
.login-logo h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.login-logo p { color: var(--text-muted); font-size: 14px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
select option { background: var(--bg-card); color: var(--text); }
.toolbar select { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.form-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-top: 12px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px;
    border: none; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: var(--transition);
    color: white;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4); }
.btn-success { background: linear-gradient(135deg, var(--success), #059669); }
.btn-danger { background: linear-gradient(135deg, var(--danger), #dc2626); }
.btn-warning { background: linear-gradient(135deg, var(--warning), #d97706); color: #1f2937; }
.btn-info { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.btn-info:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4); }
.btn-secondary { background: transparent; border: 1px solid #3b82f6; color: #3b82f6; }
.btn-secondary:hover { background: rgba(59, 130, 246, 0.1); border-color: #60a5fa; color: #60a5fa; }
.btn-log { background: linear-gradient(135deg, #4f46e5, #4338ca); }
.btn-log:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4); }
.btn-teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.btn-teal:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text); }
.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    min-width: 64px;
    height: 32px;
    line-height: 1;
    flex-shrink: 0;
}
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary:disabled { background: linear-gradient(135deg, #4a4b6b, #3a3b5b); }
.btn-success:disabled { background: linear-gradient(135deg, #2d6b4f, #1e4d36); }
.btn-danger:disabled { background: linear-gradient(135deg, #6b2d2d, #4d1e1e); }
.btn-info:disabled { background: linear-gradient(135deg, #2a5a7a, #1e3f5a); }
.btn-log:disabled { background: linear-gradient(135deg, #3a3a6b, #2a2a4b); }
.btn-teal:disabled { background: linear-gradient(135deg, #2a6b5f, #1e4d45); }
.btn-secondary:disabled { background: transparent; border-color: #334155; color: #64748b; }

/* ===== LAYOUT ===== */
.main-app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    transition: width 0.3s ease;
    z-index: 100;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-title,
.sidebar.collapsed .user-meta,
.sidebar.collapsed .sidebar-footer .btn { display: none; }
.sidebar-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    height: var(--topbar-height);
}
.sidebar-header .logo-icon { font-size: 28px; }
.sidebar-header .logo-text { font-size: 18px; font-weight: 700; flex: 1; }
.sidebar-toggle {
    background: none; border: none; color: var(--text-muted);
    font-size: 20px; cursor: pointer; padding: 4px; border-radius: 4px;
}
.sidebar-toggle:hover { background: var(--bg-card-hover); color: var(--text); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section { margin-bottom: 8px; }
.nav-title {
    padding: 8px 20px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-dim);
}
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px; margin: 2px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted); text-decoration: none;
    font-size: 14px; font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}
.nav-link:hover { background: var(--bg-card-hover); color: var(--text); }
.nav-link.active { background: rgba(99, 102, 241, 0.15); color: var(--primary-light); }
.nav-icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar-footer {
    padding: 16px 20px; border-top: 1px solid var(--border);
}
.user-info { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.user-avatar { font-size: 28px; }
.user-name { font-weight: 600; font-size: 14px; }
.user-role { font-size: 12px; color: var(--text-dim); }
.sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 90; opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
}
.sidebar-overlay.active { opacity: 1; pointer-events: all; }

.content {
    flex: 1; display: flex; flex-direction: column;
    overflow: hidden; background: var(--bg);
}
.topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.mobile-menu-btn {
    display: none; background: none; border: none;
    color: var(--text); font-size: 22px; cursor: pointer;
}
.page-title { font-size: 20px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.search-box {
    display: flex; align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    position: relative;
}
.search-box input {
    background: none; border: none; color: var(--text);
    padding: 10px 8px; font-size: 14px; width: 220px;
}
.search-box input:focus { outline: none; }
.search-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; }
/* ONU search input - responsive */
.onu-search { flex: 1; min-width: 220px; max-width: 400px; }
.topbar-actions { display: flex; gap: 8px; }
.action-btn {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--bg-card-hover); border: 1px solid var(--border);
    color: var(--text); cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.action-btn:hover { background: var(--primary); border-color: var(--primary); }

.page-content {
    flex: 1; overflow-y: auto; padding: 24px;
}

/* ===== STICKY TABLE HEADERS ===== */
.data-table thead tr {
    position: sticky;
    top: 0;
    z-index: 10;
}
.data-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-card);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* ===== CARDS / STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px; margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-light); }
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.online::before { background: var(--success); }
.stat-card.offline::before { background: var(--danger); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.info::before { background: var(--info); }
.stat-card.total::before { background: var(--primary); }
.stat-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.stat-icon { font-size: 28px; background: rgba(99, 102, 241, 0.1); padding: 10px; border-radius: 10px; }
.stat-card.online .stat-icon { background: rgba(16, 185, 129, 0.1); }
.stat-card.offline .stat-icon { background: rgba(239, 68, 68, 0.1); }
.stat-card.warning .stat-icon { background: rgba(245, 158, 11, 0.1); }
.stat-card.info .stat-icon { background: rgba(59, 130, 246, 0.1); }
.stat-value { font-size: 32px; font-weight: 700; margin-bottom: 4px; }
.stat-label { font-size: 13px; color: var(--text-muted); }
.stat-change { font-size: 12px; margin-top: 8px; font-weight: 600; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ===== PANEL / TABLE ===== */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
}
.panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px; border-bottom: 1px solid var(--border);
}
.panel-title { font-size: 16px; font-weight: 600; }
.panel-body { padding: 20px 24px; overflow: auto; max-height: 70vh; }

.toolbar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.toolbar-left, .toolbar-right { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left; padding: 14px 16px; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted); border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 14px 16px; font-size: 14px;
    border-bottom: 1px solid var(--border); color: var(--text);
    white-space: nowrap;
}
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: rgba(99, 102, 241, 0.05); }
.data-table .actions { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: nowrap; }

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
}
.badge-online { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-offline { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.badge-default { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }

/* Power badges */
.power-badge { padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.power-good { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.power-weak { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.power-bad { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
    padding: 12px 20px; cursor: pointer;
    color: var(--text-muted); font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: var(--transition); white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary-light); border-bottom-color: var(--primary); }

/* ===== FORMS IN MODALS ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.form-grid .form-group.full-width { grid-column: span 2; }
.form-grid .form-group label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px); z-index: 200;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
}
.modal-overlay.visible { opacity: 1; pointer-events: all; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%; max-width: 600px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px); transition: transform 0.3s;
}
.modal-overlay.visible .modal { transform: translateY(0); }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 12px;
    padding: 16px 24px; border-top: 1px solid var(--border);
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed; top: 24px; right: 24px; z-index: 300;
    display: flex; flex-direction: column; gap: 12px;
}
.toast {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 12px;
    min-width: 280px; max-width: 400px;
    animation: slideIn 0.3s ease;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(100%); }
}
.toast.hiding { animation: fadeOut 0.3s ease forwards; }

/* ===== DROPDOWN ===== */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: 100%; right: 0; margin-top: 8px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); min-width: 180px;
    box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden;
    display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
    padding: 10px 16px; cursor: pointer; font-size: 13px;
    display: flex; align-items: center; gap: 10px;
    transition: var(--transition);
}
.dropdown-item:hover { background: var(--bg-card-hover); }

/* ===== SWITCH / TOGGLE ===== */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch-input { display: none; }
.switch-track {
    width: 40px; height: 22px; border-radius: 11px;
    background: var(--border); position: relative;
    transition: var(--transition);
}
.switch-track::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; border-radius: 50%;
    background: white; transition: var(--transition);
}
.switch-input:checked + .switch-track { background: var(--primary); }
.switch-input:checked + .switch-track::after { left: 20px; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; }

/* ===== PROGRESS / CHARTS ===== */
.chart-placeholder {
    background: rgba(99, 102, 241, 0.05);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 40px; text-align: center;
    color: var(--text-muted); font-size: 13px;
}

/* ===== IMPORT PASTE AREA ===== */
.paste-area {
    width: 100%; min-height: 200px;
    background: rgba(15, 23, 42, 0.6);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px; color: var(--text-muted);
    font-family: monospace; font-size: 13px;
    resize: vertical; transition: var(--transition);
}
.paste-area:focus { outline: none; border-color: var(--primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .form-group.full-width { grid-column: span 1; }
}

@media (max-width: 768px) {
    .sidebar { position: fixed; left: -260px; height: 100vh; }
    .sidebar.open { left: 0; }
    .sidebar.collapsed { width: var(--sidebar-width); left: -260px; }
    .mobile-menu-btn { display: block; }
    .search-box input { width: 140px; }
    .onu-search { width: 100%; max-width: 100%; min-width: unset; }
    .stats-grid { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-left, .toolbar-right { width: 100%; justify-content: space-between; }
    .data-table { display: block; overflow-x: auto; }
    .page-content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .topbar-right { gap: 8px; }
    .modal { max-width: 100%; margin: 10px; }
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.w-full { width: 100%; }
.spinner { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== ALARM PANELS ===== */
.alarm-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}
.alarm-panel-registration {
    grid-column: 1 / 3;
}
.alarm-panel-wire {
    grid-row: span 3;
}
.alarm-panel-weak {
    grid-column: 1 / 3;
}
.alarm-panel-long {
    grid-column: 1 / 3;
}
.alarm-panel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 500;
}
.alarm-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.alarm-panel:hover { border-color: var(--border-light); }
.alarm-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.alarm-panel-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.alarm-panel-count {
    padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.alarm-panel-count.critical { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.alarm-panel-count.major { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.alarm-panel-count.minor { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.alarm-panel-count.warning { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }
.alarm-panel-body { padding: 0; max-height: 300px; overflow-y: auto; }
.alarm-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; border-bottom: 1px solid var(--border);
    transition: var(--transition); cursor: pointer;
}
.alarm-item:hover { background: rgba(99, 102, 241, 0.05); }
.alarm-item:last-child { border-bottom: none; }
.alarm-indicator {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
    animation: blink 1.5s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.alarm-indicator.critical { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.alarm-indicator.major { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.alarm-indicator.minor { background: var(--info); }
.alarm-indicator.warning { background: var(--text-muted); }
.alarm-indicator.success { background: var(--success); box-shadow: 0 0 6px var(--success); animation: none; }
.alarm-resolved .alarm-title { color: var(--text-dim); text-decoration: line-through; opacity: 0.6; }
.alarm-resolved .alarm-meta { opacity: 0.5; }
.alarm-info { flex: 1; min-width: 0; }
.alarm-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alarm-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.alarm-time { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }

/* ===== FIBER CUT BANNER ===== */
.fiber-cut-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(245, 158, 11, 0.15));
    border: 2px solid var(--danger);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    display: flex; align-items: center; gap: 20px;
    animation: pulse-danger 2s infinite;
}
@keyframes pulse-danger {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}
.fiber-cut-icon { font-size: 48px; }
.fiber-cut-content { flex: 1; }
.fiber-cut-title { font-size: 20px; font-weight: 700; color: var(--danger); margin-bottom: 8px; }
.fiber-cut-desc { font-size: 14px; color: var(--text-muted); }
.fiber-cut-actions { display: flex; gap: 12px; flex-shrink: 0; }

/* ===== SIGNAL HEALTH ===== */
.signal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px; margin-bottom: 24px;
}
.signal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}
.signal-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.signal-card.critical { border-top: 4px solid var(--danger); }
.signal-card.warning { border-top: 4px solid var(--warning); }
.signal-card.good { border-top: 4px solid var(--success); }
.signal-value { font-size: 36px; font-weight: 700; margin: 12px 0; }
.signal-label { font-size: 13px; color: var(--text-muted); }

/* ===== GIS MAP ===== */
#map-container {
    width: 100%; height: 600px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}
#map-container .leaflet-container { background: #1e293b; }
.map-legend {
    display: flex; gap: 16px; flex-wrap: wrap;
    padding: 12px 0; margin-bottom: 12px;
}
.map-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.map-legend-dot { width: 12px; height: 12px; border-radius: 50%; }

/* ===== TICKET CARDS ===== */
.ticket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.ticket-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}
.ticket-card:hover { border-color: var(--border-light); box-shadow: var(--shadow); }
.ticket-card.critical { border-left: 4px solid var(--danger); }
.ticket-card.major { border-left: 4px solid var(--warning); }
.ticket-card.minor { border-left: 4px solid var(--info); }
.ticket-card.resolved { opacity: 0.6; }
.ticket-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.ticket-id { font-size: 12px; color: var(--text-dim); }
.ticket-priority { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.ticket-priority.critical { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.ticket-priority.major { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.ticket-priority.minor { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.ticket-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.ticket-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.ticket-footer { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-dim); }
.ticket-assignee { display: flex; align-items: center; gap: 6px; }
.ticket-status { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.ticket-status.open { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.ticket-status.in-progress { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.ticket-status.resolved { background: rgba(16, 185, 129, 0.15); color: var(--success); }

/* ===== NOTIFICATION LOG ===== */
.notification-item {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.notification-item:hover { background: rgba(99, 102, 241, 0.05); }
.notification-icon { font-size: 24px; flex-shrink: 0; }
.notification-content { flex: 1; min-width: 0; }
.notification-channel { font-size: 12px; font-weight: 600; color: var(--primary-light); margin-bottom: 4px; }
.notification-message { font-size: 14px; color: var(--text); }
.notification-recipient { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.notification-status { padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.notification-status.sent { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.notification-status.pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.notification-status.failed { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* ===== POWER CHART ===== */
.power-chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    height: 300px;
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 8px;
}
.power-bar {
    flex: 1; background: var(--primary); border-radius: 4px 4px 0 0;
    min-height: 20px; transition: var(--transition); opacity: 0.8;
}
.power-bar:hover { opacity: 1; }
.power-bar.good { background: var(--success); }
.power-bar.weak { background: var(--warning); }
.power-bar.bad { background: var(--danger); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .form-group.full-width { grid-column: span 1; }
    .alarm-grid { grid-template-columns: 1fr; }
    .alarm-panel-registration { grid-column: 1; }
    .signal-grid { grid-template-columns: 1fr; }
    #map-container { height: 400px; }
}

@media (max-width: 768px) {
    .sidebar { position: fixed; left: -260px; height: 100vh; }
    .sidebar.open { left: 0; }
    .sidebar.collapsed { width: var(--sidebar-width); left: -260px; }
    .mobile-menu-btn { display: block; }
    .search-box input { width: 140px; }
    .onu-search { width: 100%; max-width: 100%; min-width: unset; }
    .stats-grid { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-left, .toolbar-right { width: 100%; justify-content: space-between; }
    .data-table { display: block; overflow-x: auto; }
    .page-content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .topbar-right { gap: 8px; }
    .modal { max-width: 100%; margin: 10px; }
    .alarm-grid { grid-template-columns: 1fr; }
    .signal-grid { grid-template-columns: 1fr; }
    .ticket-grid { grid-template-columns: 1fr; }
    #map-container { height: 300px; }
    .fiber-cut-banner { flex-direction: column; text-align: center; }
}

/* ===== Checkbox Styles for Hard Delete ===== */
.onu-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--danger);
}

#select-all-onu {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.data-table th:first-child,
.data-table td:first-child {
    width: 40px;
    text-align: center;
    padding: 8px;
}

.data-table tr:has(.onu-checkbox:checked) {
    background: rgba(239, 68, 68, 0.1) !important;
}

/* ===== SEARCH DROPDOWN ===== */
#search-results .search-result-item:hover {
    background: var(--bg-card-hover);
}
#search-results .search-result-item:last-child {
    border-bottom: none;
}

/* ===== LAST POWER HISTORY ===== */
.last-power-history {
    color: var(--text-muted);
    font-style: italic;
}
.last-power-history::before {
    content: "↻ ";
    font-style: normal;
}

/* ===== ENTERPRISE ZONE MANAGER (TASK ZONE-UI) — dark theme, rounded cards ===== */
.zn-panel { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 16px; overflow: hidden; }
.zn-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; background: rgba(99,102,241,.07); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.zn-title { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.zn-meta { font-size: 11px; color: var(--text-muted); font-weight: 400; margin-top: 2px; }
.zn-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.zn-body { padding: 12px 18px 16px; }
.zn-areas-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); padding: 4px 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.zn-tg { background: var(--primary); color: #fff; border-radius: 8px; padding: 0 6px; font-size: 10px; }

.zt-area { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.zt-area-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; user-select: none; background: rgba(255,255,255,.02); }
.zt-area-head:hover { background: rgba(99,102,241,.08); }
.zt-name { font-weight: 600; font-size: 14px; }
.zt-arrow { width: 20px; text-align: center; }
.zt-acts { margin-left: auto; display: flex; gap: 10px; }
.zt-acts span { cursor: pointer; }
.zt-children { padding: 6px 10px 10px 30px; }
.zt-olt { border-left: 2px solid var(--border); margin: 4px 0; }
.zt-olt-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; user-select: none; border-radius: 8px; }
.zt-olt-head:hover { background: rgba(99,102,241,.08); }
.zt-pon { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 28px; font-size: 13px; border-left: 2px solid var(--border); margin-left: 0; }

/* ===== ZONE NOTIFICATION MANAGER — full-screen enterprise overlay ===== */
.znm-overlay { position: fixed; inset: 0; background: rgba(2,6,23,.88); backdrop-filter: blur(3px); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.znm-screen { width: 100%; max-width: 1020px; max-height: 92vh; background: var(--panel-bg, #1e293b); border: 1px solid var(--border); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.znm-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: rgba(99,102,241,.08); }
.znm-scroll { overflow-y: auto; padding: 16px 20px; flex: 1; }
.znm-section { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.znm-sec-title { font-weight: 700; margin-bottom: 10px; font-size: 14px; }
.znm-master-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-color: var(--primary); }
.znm-switch { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.znm-switch-label { font-size: 12px; font-weight: 700; color: var(--primary); }
.znm-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 13px; }
.znm-chip-future { border-style: dashed; opacity: .75; }
.znm-groups { max-height: 170px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; }
.znm-dim { opacity: .45; pointer-events: none; }
.znm-matrix { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.znm-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(255,255,255,.02); border: 1px solid var(--border); border-radius: 10px; flex-wrap: wrap; }
.znm-row-group { padding: 6px 8px; background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 8px; font-size: 12px; max-width: 170px; }
.znm-chans { display: flex; gap: 4px; margin-left: auto; }
.znm-chan { cursor: pointer; font-size: 14px; padding: 3px 6px; border-radius: 7px; border: 1px solid var(--border); opacity: .35; user-select: none; }
.znm-chan.on { opacity: 1; border-color: var(--primary); background: rgba(99,102,241,.15); }
.znm-chan.dim { filter: grayscale(.6); }
.znm-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: rgba(255,255,255,.02); }
@media (max-width: 720px) { .znm-row { flex-direction: column; align-items: stretch; } .znm-chans { margin-left: 0; } .zn-head { flex-direction: column; align-items: stretch; } }

/* ===== TASK OLT-UI-REDESIGN-01 (V2.9.82) — Edit OLT modal redesign (additive, fully scoped) ===== */
.olt-edit-modal { max-width: 1180px; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.olt-edit-modal .modal-header { flex: none; }
.olt-edit-modal .modal-title { font-size: 22px; font-weight: 700; }
.olted-subtitle { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-top: 3px; }
.olt-edit-modal .modal-body { padding: 0; display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.olt-edit-modal .modal-footer { justify-content: space-between; background: var(--bg-card); flex: none; }
.olted { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.olted-tabs { display: flex; gap: 4px; padding: 10px 24px 0; border-bottom: 1px solid var(--border); overflow-x: auto; flex: none; }
.olted-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); font-size: 13px; font-weight: 600; padding: 10px 14px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 7px; font-family: inherit; }
.olted-tab:hover { color: var(--text); }
.olted-tab.active { color: var(--primary-light); border-bottom-color: var(--primary); }
.olted-main { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px; }
.olted-grid { display: grid; grid-template-columns: 7fr 3fr; gap: 20px; align-items: start; }
.olted-grid > div { min-width: 0; }
.olted-card { background: rgba(15,23,42,0.55); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 20px; min-width: 0; }
.olted-card:last-child { margin-bottom: 0; }
.olted-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.olted-card-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.olted-fg { margin-bottom: 0; }
.olted-fg label { font-size: 12px; margin-bottom: 6px; }
.olted-req { color: var(--danger); }
.olted-input { position: relative; }
.olted-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: 0.65; pointer-events: none; }
.olted-input input, .olted-input select { width: 100%; height: 44px; padding: 0 12px 0 38px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 13px; }
.olted-input input:focus, .olted-input select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.18); }
.olted-input input[type="password"] { padding-right: 40px; }
.olted-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 14px; opacity: 0.7; color: var(--text-muted); padding: 4px; }
.olted-eye:hover { opacity: 1; }
.olted-g2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.olted-g3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.olted-g4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.olted-warn { grid-column: 1 / -1; font-size: 12px; color: var(--text-muted); }
.olted-checks { display: flex; gap: 12px; flex-wrap: wrap; }
.olted-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; padding: 9px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); transition: border-color 0.15s; }
.olted-check:hover { border-color: var(--primary); }
.olted-check input { accent-color: var(--primary); width: 16px; height: 16px; margin: 0; cursor: pointer; }
.olted-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 600; }
.olted-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.olted-slider { width: 40px; height: 22px; background: var(--border); border-radius: 22px; position: relative; transition: background 0.2s; flex: none; }
.olted-slider::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform 0.2s; }
.olted-switch input:checked + .olted-slider { background: var(--primary); }
.olted-switch input:checked + .olted-slider::after { transform: translateX(18px); }
.olted-map { height: 220px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); margin-top: 16px; background: var(--bg-card); }
.olted-gps-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.olted-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.olted-badge-live { background: rgba(34,197,94,0.15); color: #22c55e; }
.olted-badge-off { background: rgba(239,68,68,0.15); color: #ef4444; }
.olted-badge-manual { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.olted-kv { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; font-size: 12px; border-bottom: 1px dashed rgba(51,65,85,0.5); }
.olted-kv:last-child { border-bottom: none; }
.olted-kv > span:first-child { color: var(--text-muted); }
.olted-kv > span:last-child { font-weight: 600; text-align: right; word-break: break-all; }
.olted-photo-preview { width: 100%; height: 150px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); background: var(--bg-card); display: block; }
.olted-photo-empty { height: 150px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 12px; color: var(--text-dim); font-size: 12px; background: var(--bg-card); }
.olted-photo-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-muted); min-height: 20px; }
.olted-photo-del { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 15px; padding: 2px 6px; }
.olted-drop { margin-top: 12px; border: 1.5px dashed var(--border-light); border-radius: 12px; padding: 18px 12px; text-align: center; font-size: 12px; color: var(--text-muted); cursor: pointer; line-height: 1.7; transition: border-color 0.15s; }
.olted-drop:hover { border-color: var(--primary); color: var(--text); }
.olted-btn { width: 100%; height: 42px; border: none; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; margin-bottom: 10px; font-family: inherit; transition: transform 0.12s, box-shadow 0.12s; }
.olted-btn:last-child { margin-bottom: 0; }
.olted-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.35); }
.olted-btn:disabled { opacity: 0.6; cursor: wait; transform: none; box-shadow: none; }
.olted-btn-green { background: linear-gradient(135deg, #16a34a, #15803d); }
.olted-btn-purple { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.olted-btn-blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.olted-ta { width: 100%; min-height: 150px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 13px; padding: 12px; resize: vertical; font-family: inherit; }
.olted-ta:focus { outline: none; border-color: var(--primary); }
.olted-note { margin-top: 14px; padding: 10px 12px; background: rgba(99,102,241,0.08); border-left: 3px solid var(--primary); border-radius: 8px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.olted-right { position: sticky; top: 0; }
@media (max-width: 1199px) { .olted-grid { grid-template-columns: 3fr 2fr; } .olted-g4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 991px) { .olted-g3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 767px) {
    .olted-grid { grid-template-columns: 1fr; }
    .olted-right { position: static; }
    .olted-g2, .olted-g3, .olted-g4 { grid-template-columns: 1fr; }
    .olt-edit-modal { max-width: 100%; max-height: 100vh; border-radius: 0; }
    .olted-main { padding: 16px; }
    .olted-tabs { padding: 8px 16px 0; }
    .olted-card { padding: 16px; }
    .olt-edit-modal .modal-footer .btn { flex: 1; }
}

/* ===== TASK OLT-UI-NAVIGATE-01 (V2.9.83) — Google Navigate buttons (additive, scoped) ===== */
.olted-map-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.olted-map-actions .olted-nav-btn { flex: 1 1 150px; margin: 0; }
.olted-nav-btn { height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.olted-nav-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
@media (max-width: 480px) { .olted-map-actions { flex-direction: column; } .olted-map-actions .olted-nav-btn { flex: 1 1 100%; width: 100%; } }

/* ===== TASK JAZE-LOCATION-POPUP-01 (V2.9.84) — scoped, additive-only ===== */
.jzloc-wide { max-width: 860px; }
.jzloc-modal { display: flex; flex-direction: column; gap: 14px; }
.jzloc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.jzloc-map { height: 260px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg-main, #0f172a); }
.jzloc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.jzloc-actions .btn { flex: 1 1 130px; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.jzloc-actions .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.jzloc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jzloc-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--bg-main, #0f172a); }
.jzloc-card-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.jzloc-card-row { font-size: 12px; margin: 4px 0; word-break: break-word; }
.jzloc-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.jzloc-status-dirty { color: #f59e0b; background: rgba(245, 158, 11, 0.12); }
.jzloc-status-clean { color: #22c55e; background: rgba(34, 197, 94, 0.12); }
.jzloc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jzloc-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--text-muted); font-weight: 600; }
.jzloc-form input { height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-main, #0f172a); color: var(--text-main, #e2e8f0); font-size: 13px; }
.jzloc-form input:disabled { opacity: 0.6; }
.jzloc-footer { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; }
.jzloc-footer .btn { min-width: 140px; height: 40px; }
.jzloc-footer .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.jzloc-cell-btn { background: none; border: none; padding: 0; margin: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; width: 100%; }
.jzloc-cell-btn:hover span:last-child { text-decoration: underline; }
@media (max-width: 640px) {
    .jzloc-cards { grid-template-columns: 1fr; }
    .jzloc-form { grid-template-columns: 1fr; }
    .jzloc-map { height: 200px; }
    .jzloc-actions .btn { flex: 1 1 100%; }
    .jzloc-footer .btn { flex: 1 1 100%; }
    .jzloc-wide { max-width: 100%; }
}

/* ===== TASK BRANDING-SETTINGS-02 (V2.9.85) — scoped, additive-only ===== */
.brand-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.brand-preview { border: 1px solid var(--border); border-radius: 12px; padding: 24px 16px; margin-top: 6px; background: var(--bg-main, #0f172a); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-height: 160px; justify-content: center; }
.brand-preview-name { font-size: 20px; font-weight: 800; }
.brand-preview-sub { font-size: 12px; color: var(--text-muted); }
.brand-logo-img { max-width: 96px; max-height: 96px; object-fit: contain; border-radius: 10px; display: inline-block; }
.brand-logo-lg { max-width: 110px; max-height: 110px; }
.brand-logo-sm { max-width: 34px; max-height: 34px; border-radius: 8px; }
.brand-logo-placeholder { font-size: 44px; line-height: 1; }
.login-brand-footer { margin-top: 18px; font-size: 11px; color: var(--text-muted); text-align: center; }
.login-brand-footer a { color: var(--accent, #3b82f6); text-decoration: none; }
.login-brand-footer a:hover { text-decoration: underline; }
.sidebar-brand-footer { margin-top: 10px; font-size: 10px; color: var(--text-muted); text-align: center; word-break: break-word; }
.login-logo .brand-logo-img { max-width: 84px; max-height: 84px; margin: 0 auto 6px; }
@media (max-width: 640px) {
    .brand-grid { grid-template-columns: 1fr; }
    .brand-logo-img { max-width: 72px; max-height: 72px; }
}

/* ===== TASK ONU-LAST-REASON-MAP-01 (V2.9.86) — scoped, additive-only ===== */
.onu-reason-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 132px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.reason-wire-down { background: #331313; color: #ffb4b4; border-color: #7f1d1d; }
.reason-power-off { background: #2f2310; color: #ffd59e; border-color: #92400e; }
.reason-dying-gasp { background: #2a1538; color: #e9c7ff; border-color: #6b21a8; }
.reason-los { background: #331313; color: #ffb4b4; border-color: #991b1b; }
.reason-omci { background: #10283f; color: #cfe2ff; border-color: #1d4ed8; }
.reason-other { background: #1f2937; color: #e5e7eb; border-color: #4b5563; }
.reason-unknown { background: #111827; color: #9ca3af; border-color: #374151; }
@media (max-width: 768px) {
    .onu-reason-badge { min-width: 120px; font-size: 11px; }
}

/* ===== TASK ONU-REG-DEREG-TIME-UI-01 (V2.9.87) — scoped, additive-only ===== */
.onu-time-stack { display: flex; flex-direction: column; gap: 4px; min-width: 210px; }
.onu-time-row { display: flex; align-items: center; gap: 6px; line-height: 1.2; white-space: nowrap; }
.onu-time-tag { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; height: 22px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .4px; border: 1px solid transparent; }
.onu-time-tag.reg { background: #10281a; color: #86efac; border-color: #166534; }
.onu-time-tag.dereg { background: #2f2310; color: #fde68a; border-color: #92400e; }
.onu-time-value { font-size: 12px; color: #e5e7eb; }
@media (max-width: 768px) {
    .onu-time-stack { min-width: 170px; }
    .onu-time-value { font-size: 11px; }
}

/* ===== TASK OLT-ADD-UI-MATCH-EDIT-01 (V2.9.88) — scoped, additive-only ===== */
.olted-pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.olted-pthumb { position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--bg); }
.olted-pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.olted-ptag { position: absolute; left: 4px; bottom: 4px; background: rgba(15, 23, 42, .85); color: #e5e7eb; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 999px; }
.olted-pdel { position: absolute; top: 4px; right: 4px; background: rgba(15, 23, 42, .85); border: 1px solid var(--border); color: #ffb4b4; border-radius: 6px; width: 22px; height: 22px; font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.olted-pcount { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.olted-pcount.ok { color: var(--success, #22c55e); }
.olted-pbar-wrap { height: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.olted-pbar { height: 100%; width: 0; background: var(--primary, #3b82f6); border-radius: 999px; transition: width .2s; }
.olted-pdone { font-size: 11px; color: var(--success, #22c55e); font-weight: 700; }
@media (max-width: 768px) {
    .olted-pgrid { gap: 6px; }
}

/* ===== TASK OLT-SCROLL + AUTO-VERSION-RESTART-01 (V2.9.89) — scoped, additive-only ===== */
/* Modal container: viewport-based sizing (Add+Edit दोनों — same class) */
.olt-edit-modal { width: min(96vw, 1480px); max-width: min(96vw, 1480px); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.olt-edit-modal .modal-header { flex: 0 0 auto; }
/* Tab bar fixed (non-shrinking), scroll container के ऊपर */
.olted-tabs { flex: 0 0 auto; background: var(--bg); }
/* Only content area scrolls (flex chain: modal → body → .olted → .olted-main) */
.olted-main { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; min-height: 0; }
/* Footer sticky/always visible */
.olt-edit-modal .modal-footer { flex: 0 0 auto; position: sticky; bottom: 0; z-index: 5; background: var(--bg-card); border-top: 1px solid var(--border); }
/* Mobile */
@media (max-width: 767px) {
    .olted-main { padding: 12px; }
    .olt-edit-modal .modal-footer { flex-wrap: wrap; gap: 8px; }
    .olt-edit-modal .modal-footer .btn { flex: 1 1 100%; }
    .olt-edit-modal, .olted, .olted-main { overflow-x: hidden; }
}

/* ===== TASK SYSLOG-SNMP-ALERTS-LAYOUT-01 (V2.9.93) — scoped, additive ===== */
.syslog-alerts-wrap { overflow-x: auto; }
@media (max-width: 767px) {
    .syslog-alerts-wrap .data-table { font-size: 11px; }
}

/* ===== TASK SYSLOG-SNMP-ALERTS-ENHANCE-02 (V2.9.94) — scoped, additive ===== */
/* PART 3: Time dropdown हमेशा नीचे open हो (no portal/fixed) */
.sa-time-dropdown { position: relative; }
.sa-time-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    bottom: auto;
    transform: none;
    z-index: 50;
    min-width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.sa-time-menu .sa-time-opt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
}
.sa-time-menu .sa-time-opt:hover { background: rgba(255, 255, 255, 0.06); }
.sa-time-menu .sa-time-opt.active { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
@media (max-width: 767px) {
    .syslog-alerts-filters { grid-template-columns: 1fr !important; }
    .sa-time-menu { min-width: 100%; }
}

/* ENHANCE-02 fix: global .panel-body { overflow:auto } menu ko clip kar रहा था —
   सिर्फ इस section के filters panel पर overflow खोलना (scoped) */
.syslog-alerts-filters { overflow: visible; max-height: none; }

/* ===== TASK SYSLOG-SNMP-ALERTS-FIX-03 (V2.9.95) — scoped, additive ===== */
/* PART 3: pagination disabled button white/unreadable fix (no global .btn override) */
.syslog-alerts-wrap .pagination .btn[disabled],
.syslog-alerts-wrap .pagination .btn:disabled {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: not-allowed;
    opacity: 1;
}
.syslog-alerts-wrap .pagination .btn:not([disabled]):not(:disabled):hover {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.45);
}

/* ===== TASK SYSLOG-WIREDOWN-GROUPING-01 (V2.9.96) — scoped, additive ===== */
.wd-group-panel { margin: 0; }
.wd-group-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.wd-sum { flex: 1; min-width: 120px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; text-align: center; }
.wd-sum-num { font-size: 18px; font-weight: 800; color: var(--text); }
.wd-sum-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.wd-group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.wd-group-card { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.wd-group-head { font-weight: 700; font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.wd-group-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(99, 102, 241, 0.18); color: #a5b4fc; font-size: 11px; font-weight: 800; border: 1px solid rgba(99, 102, 241, 0.45); }
.wd-group-meta { font-size: 12px; color: var(--text-muted); }
.wd-group-customers { font-size: 12px; color: var(--text); max-height: 120px; overflow-y: auto; line-height: 1.6; }
.wd-group-empty { padding: 14px; text-align: center; color: var(--text-muted); font-size: 13px; }
.wd-group-note { margin-top: 8px; font-size: 11px; color: var(--text-muted); }
@media (max-width: 767px) {
    .wd-group-grid { grid-template-columns: 1fr; }
    .wd-sum { min-width: 100px; }
}

/* ===== TASK SYSLOG-PON-DROPDOWN + LIVE-REFRESH-01 (V2.9.98) — Syslog page scoped ===== */
/* PON searchable dropdown (replaces plain text input) — theme-matched, scoped to Syslog page */
#syslogPonFilter.form-select {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    outline: none;
    cursor: pointer;
}
#syslogPonFilter.form-select:focus { border-color: var(--accent, #3b82f6); }
#syslogPonFilter.form-select option { background: var(--panel-bg, #1e1e1e); color: var(--text); }
/* Live-update flash on Total badge (1s pulse, no layout shift) */
.syslog-live-updated { animation: syslogPulse 1s ease; }
@keyframes syslogPulse {
    0%   { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    50%  { box-shadow: 0 0 0 7px rgba(59, 130, 246, 0.25); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}
@media (max-width: 767px) {
    #syslogPonFilter.form-select { width: 100%; max-width: 100%; }
}

/* ============================================================
   PERMANENT UI RULE — DARK THEME INPUT/CONTROL CONSISTENCY
   (SYS-BACKUP-01 UI fix, V2.14.1)
   NSB SmartISP dark theme mein koi bhi newly added input, select,
   textarea, file/number/time/date/confirmation control default
   browser white style mein render nahi hona chahiye.
   New components MUST reuse .form-input / .form-select (or
   .form-group controls) — NO DEFAULT BROWSER WHITE CONTROL.
   Base style mirrors the canonical .form-group control style
   (app.css:182-194).
   ============================================================ */
.form-input, .form-select {
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    transition: var(--transition);
    color-scheme: dark; /* native time/number/date pickers + scrollbars dark */
}
.form-input:focus, .form-select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.form-input::placeholder { color: var(--text-muted); opacity: 0.8; }
.form-input:disabled, .form-select:disabled { opacity: 0.55; cursor: not-allowed; }
.form-select option { background: var(--bg-card); color: var(--text); }
/* File chooser: native white button → dark themed selector button */
.form-input[type="file"] { padding: 6px 12px; }
.form-input[type="file"]::file-selector-button {
    background: var(--bg-card); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 6px 12px; margin-right: 10px; cursor: pointer;
    font-size: 12px; transition: var(--transition);
}
.form-input[type="file"]::file-selector-button:hover { border-color: var(--primary); color: var(--primary-light, #818cf8); }
/* Checkboxes in new sections follow theme accent, not browser default */
#system-backup-content input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }

/* ============================================================
   PERMANENT UI RULE — DARK THEME DISABLED/BARE BUTTON GUARD
   (V2.14.1 follow-up)
   NO DEFAULT BROWSER WHITE DISABLED BUTTON.
   Root cause: .btn base (app.css:208) sets color/border but NO
   background — variant-less .btn / .btn-sm / .btn-disabled fall
   back to UA default white ButtonFace. Variants untouched.
   ============================================================ */
/* Bare .btn (no variant class) → dark neutral, never UA white */
.btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-info):not(.btn-secondary):not(.btn-log):not(.btn-teal):not(.btn-ghost):not(.btn-disabled) {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
}
.btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-info):not(.btn-secondary):not(.btn-log):not(.btn-teal):not(.btn-ghost):not(.btn-disabled):hover:not(:disabled):not([disabled]) {
    background: var(--bg-card-hover, var(--bg-card));
    border-color: var(--primary);
    color: var(--text);
}
/* .btn-disabled utility (was completely unstyled → UA white) */
.btn-disabled, .btn-disabled:disabled, .btn-disabled[disabled] {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    opacity: 0.55; cursor: not-allowed;
}
/* Disabled state — dark/muted, no misleading active hover/focus */
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover, .btn[disabled]:hover,
.btn:disabled:focus, .btn[disabled]:focus {
    transform: none; box-shadow: none; outline: none;
}
.btn-ghost:disabled, .btn-ghost[disabled] { color: var(--text-muted); border-color: var(--border); background: transparent; }

/* ============================================================
   SETTINGS-CATEGORY-ORGANIZATION-01 (V2.14.2)
   6 collapsible categories on Settings page — dark themed,
   multi-open allowed, single page scrollbar (no nested scroll),
   content never clipped.
   ============================================================ */
.settings-cat { margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); }
.settings-cat-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; cursor: pointer; user-select: none;
    font-weight: 700; font-size: 14px; letter-spacing: 0.4px; color: var(--text);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.settings-cat-header:hover { background: var(--bg-card-hover, rgba(99, 102, 241, 0.08)); }
.settings-cat-ind { font-size: 16px; color: var(--text-muted); transition: var(--transition); }
.settings-cat.open .settings-cat-ind { color: var(--primary); }
.settings-cat-body { padding: 4px 14px 14px; }
.settings-cat-body .panel:last-child { margin-bottom: 8px; }
/* Single scrollbar rule — Settings page panels must not scroll internally or clip content */
.settings-page .panel-body { overflow: visible; max-height: none; }
@media (max-width: 767px) {
    .settings-cat-header { padding: 12px 14px; font-size: 13px; }
    .settings-cat-body { padding: 2px 8px 10px; }
}

/* ===== ALARM-UX-FIX-01 (V2.14.4): manual-close / close-all modal =====
   Full-viewport backdrop ABOVE every other popup (.customer-popup = 1000).
   Background page is NOT clickable/navigable while open. NEVER reuse the
   .customer-popup class for these modals — the auto-refresh rebuild logic
   removes/rebuilds .customer-popup nodes (V2.14.3 modal bug). */
.mc-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.65); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.mc-modal-content { background: var(--bg-card); border-radius: var(--radius); max-width: 480px; width: 92%; max-height: 84vh; overflow-y: auto; border: 1px solid var(--border); }
.mc-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.mc-modal-body { padding: 12px 16px; font-size: 13px; line-height: 1.7; }
.mc-modal-footer { display: flex; gap: 8px; padding: 0 16px 14px; }
