/* ==========================================================================
   NexLog — AdminLTE theme overrides
   Look & feel: deep navy chrome (sidebar, navbar, footer) + teal brand
   accents, light content area, colored icon tiles everywhere.
   Brand color is injected per company through --nl-brand.
   ========================================================================== */

:root {
    --nl-brand: #0f766e;
    --nl-brand-dark: #115e59;
    --nl-brand-soft: #e6faf5;
    --nl-chrome-1: #0b1526;   /* sidebar / navbar top     */
    --nl-chrome-2: #101d33;   /* sidebar / navbar bottom  */
    --nl-chrome-line: rgba(45, 212, 191, .28);
    --nl-chrome-text: #a7b6c9;
    --nl-chrome-text-strong: #e7eef6;
    --nl-bg: #eef1f5;
    --nl-card: #ffffff;
    --nl-border: #e4e8ee;
    --nl-text: #17202a;
    --nl-muted: #66748a;
    --nl-blue: #2563eb;
    --nl-violet: #7c3aed;
    --nl-cyan: #0891b2;
    --nl-orange: #ea580c;
    --nl-green: #16a34a;
    --nl-red: #dc2626;
    --nl-pink: #db2777;
}

html, body {
    background: var(--nl-bg);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
    color: var(--nl-text);
    font-size: 14px;
}

/* ==========================================================================
   Sidebar — dark navy, teal accents (never white)
   ========================================================================== */
.main-sidebar {
    background: linear-gradient(180deg, var(--nl-chrome-1) 0%, var(--nl-chrome-2) 100%) !important;
    border-right: 1px solid var(--nl-chrome-line);
    box-shadow: none !important;
}

.brand-link {
    border-bottom: 1px solid rgba(167, 182, 201, .14);
    padding: 14px 16px !important;
    height: 60px;
}

.brand-link .brand-text {
    color: var(--nl-chrome-text-strong) !important;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .01em;
}

.brand-link .brand-accent { color: #2dd4bf; }

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--nl-brand), #0d9488);
    color: #fff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(13, 148, 136, .35);
}

.nav-sidebar { padding: 10px 10px 0 10px; }

.nav-sidebar .nav-header {
    color: #64748b;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    padding: 16px 8px 4px 8px;
    background: transparent !important;
    color: #64748b !important;
}

.nav-sidebar .nav-header i.nl-nav-header-icon {
    color: #2dd4bf;
    font-size: 10px;
    margin-right: 5px;
}

.nav-sidebar .nav-item > .nav-link {
    color: var(--nl-chrome-text) !important;
    border-radius: 10px;
    margin-bottom: 2px;
    padding: 9px 10px;
    font-weight: 500;
}

.nav-sidebar .nav-item > .nav-link i {
    color: #7d93ad !important;
    width: 20px;
    font-size: 14px;
    transition: color .15s ease;
}

.nav-sidebar .nav-item > .nav-link:hover {
    background: rgba(45, 212, 191, .08) !important;
    color: #fff !important;
}

.nav-sidebar .nav-item > .nav-link:hover i { color: #2dd4bf !important; }

.nav-sidebar .nav-item.active > .nav-link,
.nav-sidebar .nav-link.active {
    background: linear-gradient(90deg, var(--nl-brand), #0d9488) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 6px 14px rgba(13, 148, 136, .35);
}

.nav-sidebar .nav-item.active > .nav-link i,
.nav-sidebar .nav-link.active i { color: #ccfbf1 !important; }

/* user card at the bottom of the sidebar */
.sidebar-footer {
    border-top: 1px solid rgba(167, 182, 201, .14);
    padding: 12px 14px 14px 14px;
    font-size: 12.5px;
    color: var(--nl-chrome-text);
}

.nl-side-user { display: flex; align-items: center; gap: 10px; }

.nl-side-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: rgba(45, 212, 191, .15);
    border: 1px solid rgba(45, 212, 191, .35);
    color: #2dd4bf;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

.nl-side-user-meta { display: flex; flex-direction: column; min-width: 0; }
.nl-side-name {
    color: var(--nl-chrome-text-strong);
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nl-side-role { color: #64748b; font-size: 11px; }
.nl-side-role i { color: #2dd4bf; margin-right: 4px; }

/* ==========================================================================
   Top navbar — dark navy with page chip
   ========================================================================== */
.main-header.navbar {
    background: linear-gradient(90deg, var(--nl-chrome-1) 0%, var(--nl-chrome-2) 100%);
    border-bottom: 1px solid var(--nl-chrome-line);
    z-index: 1030;
    min-height: 60px;
}

.main-header .nav-link { color: var(--nl-chrome-text) !important; }
.main-header .nav-link:hover { color: #fff !important; }

.nl-page-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(167, 182, 201, .18);
    color: var(--nl-chrome-text-strong);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
}

.nl-chip-home { color: #2dd4bf; font-size: 11.5px; }
.nl-chip-sep { color: #64748b; }

.nl-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--nl-brand), #0d9488);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    box-shadow: 0 3px 8px rgba(13, 148, 136, .4);
}

.nl-user-name {
    color: var(--nl-chrome-text-strong);
    font-weight: 600;
    font-size: 13px;
    margin-left: 8px;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* dropdown */
.nl-dropdown {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(11, 21, 38, .22);
    padding: 6px;
    min-width: 210px;
}

.nl-dropdown .dropdown-header {
    color: var(--nl-muted);
    font-size: 12px;
    font-weight: 700;
    padding: 8px 12px 4px 12px;
}

.nl-dropdown .dropdown-item {
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 12px;
    color: #334155;
}

.nl-dropdown .dropdown-item:hover { background: var(--nl-brand-soft); color: var(--nl-brand-dark); }
.nl-dropdown .dropdown-item .nl-dd-icon {
    width: 20px;
    color: var(--nl-brand);
    margin-right: 2px;
}
.nl-dropdown .dropdown-item.nl-dd-danger { color: #b91c1c; }
.nl-dropdown .dropdown-item.nl-dd-danger:hover { background: #fee2e2; }
.nl-dropdown .dropdown-item.nl-dd-danger .nl-dd-icon { color: #dc2626; }

/* ==========================================================================
   Footer — dark chrome strip
   ========================================================================== */
.main-footer {
    background: linear-gradient(90deg, var(--nl-chrome-1) 0%, var(--nl-chrome-2) 100%);
    border-top: 1px solid var(--nl-chrome-line);
    color: var(--nl-chrome-text);
    font-size: 12.5px;
    padding: 12px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.main-footer strong { color: var(--nl-chrome-text-strong); }
.main-footer .footer-left, .main-footer .footer-right {
    display: flex;
    align-items: center;
    gap: 7px;
}
.nl-footer-icon { color: #2dd4bf; }
.nl-footer-sep { color: #475569; }
.main-footer .hint { color: #64748b; font-size: 12px; }

/* ==========================================================================
   Content area
   ========================================================================== */
.content-wrapper {
    background: var(--nl-bg) !important;
}

.content-header { padding: 18px 22px 6px 22px; }

.content-header h1 { font-size: 19px; font-weight: 700; margin: 0; }
.content-header h1 i { color: var(--nl-brand); margin-right: 8px; font-size: 17px; }
.content-header .subtitle { color: var(--nl-muted); font-size: 13px; }

.content { padding: 8px 22px 26px 22px; }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    border-radius: 14px;
    border: 1px solid var(--nl-border);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05) !important;
    background: var(--nl-card);
    margin-bottom: 16px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--nl-border);
    padding: 13px 16px;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--nl-text);
    display: flex;
    align-items: center;
    gap: 9px;
}

.card-title > i { color: var(--nl-brand); font-size: 14px; }
.card-title .sub {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--nl-muted);
}

.card-body { padding: 16px; }

/* ==========================================================================
   Stat cards with colored icon tiles
   ========================================================================== */
.stat-card .card-body {
    display: flex;
    align-items: center;
    gap: 13px;
}

.stat-card .label {
    color: var(--nl-muted);
    font-size: 12px;
    font-weight: 500;
}

.stat-card .value {
    font-size: 21px;
    font-weight: 700;
    color: var(--nl-text);
    line-height: 1.15;
}

.stat-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}

.tile-teal   { background: linear-gradient(135deg, #0f766e, #14b8a6); box-shadow: 0 6px 14px rgba(13, 148, 136, .28); }
.tile-blue   { background: linear-gradient(135deg, #1d4ed8, #3b82f6); box-shadow: 0 6px 14px rgba(37, 99, 235, .28); }
.tile-violet { background: linear-gradient(135deg, #6d28d9, #8b5cf6); box-shadow: 0 6px 14px rgba(109, 40, 217, .28); }
.tile-cyan   { background: linear-gradient(135deg, #0e7490, #22d3ee); box-shadow: 0 6px 14px rgba(8, 145, 178, .28); }
.tile-orange { background: linear-gradient(135deg, #c2410c, #fb923c); box-shadow: 0 6px 14px rgba(234, 88, 12, .28); }
.tile-green  { background: linear-gradient(135deg, #15803d, #22c55e); box-shadow: 0 6px 14px rgba(22, 163, 74, .28); }
.tile-red    { background: linear-gradient(135deg, #b91c1c, #f87171); box-shadow: 0 6px 14px rgba(220, 38, 38, .28); }
.tile-pink   { background: linear-gradient(135deg, #be185d, #f472b6); box-shadow: 0 6px 14px rgba(219, 39, 119, .28); }

.progress { background: #e9edf2; border-radius: 6px; }
.progress-bar { background: var(--nl-brand); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    border-radius: 9px;
    font-weight: 600;
    font-size: 13px;
    padding: 7px 14px;
}

.btn i { margin-right: 6px; }
.btn-primary, .btn-teal {
    background: linear-gradient(135deg, var(--nl-brand), #0d9488) !important;
    border-color: var(--nl-brand) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(13, 148, 136, .25);
}

.btn-primary:hover, .btn-teal:hover {
    background: var(--nl-brand-dark) !important;
    border-color: var(--nl-brand-dark) !important;
}

.btn-outline-secondary {
    border-color: #cbd5df;
    color: #475569;
}
.btn-outline-secondary:hover { background: #f1f5f9; }
.btn-outline-secondary i { margin-right: 6px; color: var(--nl-brand); }

.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-danger-soft {
    background: #fee2e2;
    color: #b91c1c;
    border: 0;
}
.btn-danger-soft:hover { background: #fecaca; color: #991b1b; }

/* quick range pills */
.range-btn {
    border-radius: 999px;
    padding: 5px 13px;
    font-size: 12.5px;
    border: 1px solid #cbd5df;
    background: #fff;
    color: #475569;
    font-weight: 600;
}
.range-btn.active {
    background: linear-gradient(135deg, var(--nl-brand), #0d9488);
    border-color: var(--nl-brand);
    color: #fff;
    box-shadow: 0 4px 10px rgba(13, 148, 136, .25);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-control, .custom-select {
    border-radius: 9px;
    border-color: #cbd5df;
    font-size: 13.5px;
    box-shadow: none !important;
}

.form-control:focus, .custom-select:focus {
    border-color: var(--nl-brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .12) !important;
}

.form-group label {
    font-weight: 600;
    font-size: 12.5px;
    color: #374151;
    margin-bottom: 4px;
}

.hint { color: var(--nl-muted); font-size: 12px; }

.input-group-text.nl-input-icon {
    background: var(--nl-brand-soft);
    border-color: #cbd5df;
    color: var(--nl-brand);
    width: 42px;
    justify-content: center;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table th {
    color: var(--nl-muted);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: none;
    border-top: 0;
    white-space: nowrap;
}

.table td {
    font-size: 13px;
    color: var(--nl-text);
    vertical-align: middle;
}

.table thead th { background: #f6f8fb; }
.table-sm td, .table-sm th { padding: 8px 10px; }

/* ==========================================================================
   Badges
   ========================================================================== */
.badge-soft {
    background: var(--nl-brand-soft);
    color: var(--nl-brand-dark);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-gray {
    background: #eef1f5;
    color: var(--nl-muted);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-red-soft {
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-amber-soft {
    background: #fef3c7;
    color: #b45309;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-blue-soft {
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* severity colors */
.sev-error, .sev-critical, .sev-alert, .sev-emergency { color: var(--nl-red); font-weight: 600; }
.sev-warning { color: #b45309; font-weight: 600; }
.sev-info { color: var(--nl-muted); }

/* ==========================================================================
   Switches (teal)
   ========================================================================== */
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--nl-brand);
    border-color: var(--nl-brand);
}

.custom-switch .custom-control-input:focus:not(:checked) ~ .custom-control-label::before {
    border-color: var(--nl-brand);
}

/* ==========================================================================
   Lists (top users / destinations)
   ========================================================================== */
.rank-list { margin: 0; padding: 0; list-style: none; }

.rank-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 2px;
    border-bottom: 1px solid #f1f4f8;
    font-size: 13px;
}

.rank-list li:last-child { border-bottom: 0; }

.rank-list .num { width: 22px; color: var(--nl-muted); font-size: 12px; }
.rank-list .bytes { color: var(--nl-muted); font-size: 12.5px; white-space: nowrap; }
.rank-list li > span > i { color: var(--nl-brand); opacity: .75; }

.flag { font-size: 12px; margin-right: 6px; }

/* ==========================================================================
   Login pages
   ========================================================================== */
.login-page {
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(13, 148, 136, .35), transparent 60%),
        radial-gradient(900px 480px at -10% 110%, rgba(37, 99, 235, .22), transparent 55%),
        linear-gradient(160deg, #0a1220 0%, var(--nl-chrome-2) 55%, #0a2337 100%) !important;
    min-height: 100vh;
}

.login-box { width: 420px; }

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.login-logo .brand-icon {
    width: 46px;
    height: 46px;
    font-size: 20px;
    border-radius: 13px;
}

.login-logo .name {
    font-size: 23px;
    font-weight: 800;
    color: #f1f5f9;
}

.login-sub {
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 16px;
}

.login-scope-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(45, 212, 191, .12);
    border: 1px solid rgba(45, 212, 191, .4);
    color: #5eead4;
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}

.login-card-body, .register-card-body {
    background: var(--nl-card);
    border-radius: 18px;
    border: 0;
    box-shadow: 0 24px 60px rgba(4, 12, 24, .45);
}

.login-card-body .input-group i { pointer-events: none; }

.login-footnote {
    text-align: center;
    color: #64748b;
    font-size: 12px;
    margin-top: 14px;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-content { border-radius: 16px; border: 0; }
.modal-header, .modal-footer { border-color: var(--nl-border); }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-title i { color: var(--nl-brand); margin-right: 8px; }

/* ==========================================================================
   Terminal block
   ========================================================================== */
.terminal {
    background: #0a1220;
    color: #86efac;
    border: 1px solid rgba(45, 212, 191, .25);
    border-radius: 12px;
    padding: 14px 16px;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.65;
    white-space: pre;
    overflow-x: auto;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.nl-pagination { display: flex; align-items: center; gap: 6px; }

.nl-pagination .page-link {
    border-radius: 8px;
    border-color: #cbd5df;
    color: #475569;
    padding: 5px 11px;
    font-size: 13px;
}

.nl-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--nl-brand), #0d9488);
    border-color: var(--nl-brand);
    color: #fff;
}

.nl-pagination .page-item.disabled .page-link { opacity: .5; }

/* ==========================================================================
   Utility
   ========================================================================== */
.text-muted2 { color: var(--nl-muted) !important; }
.mono { font-family: Consolas, 'JetBrains Mono', monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* ==========================================================================
   Dark theme (body.dark-mode) — content switches to dark too
   ========================================================================== */
body.dark-mode {
    --nl-bg: #0d1117;
    --nl-card: #161d27;
    --nl-border: #26303c;
    --nl-text: #e5e7eb;
    --nl-muted: #94a3b8;
    --nl-brand-soft: #123b37;
    background: var(--nl-bg);
}

body.dark-mode .main-header.navbar,
body.dark-mode .main-sidebar,
body.dark-mode .main-footer { background: linear-gradient(90deg, #080f1c, #0c1626); }
body.dark-mode .main-sidebar { background: linear-gradient(180deg, #080f1c, #0c1626) !important; }
body.dark-mode .table thead th { background: #1b2430; }
body.dark-mode .table td, body.dark-mode .table th { border-color: var(--nl-border); }
body.dark-mode .form-control, body.dark-mode .custom-select {
    background: #1b2430;
    border-color: #37414c;
    color: #e5e7eb;
}
body.dark-mode .card { background: var(--nl-card); }
body.dark-mode .rank-list li { border-color: #222c38; }
body.dark-mode .range-btn { background: #161d27; border-color: #26303c; color: #cbd5e1; }
body.dark-mode .range-btn.active { color: #fff; }
body.dark-mode .modal-content { background: #161d27; color: #e5e7eb; }
body.dark-mode .nl-dropdown { background: #161d27; }
body.dark-mode .nl-dropdown .dropdown-item { color: #cbd5e1; }
body.dark-mode .nl-dropdown .dropdown-item:hover { background: #1b2430; color: #5eead4; }
body.dark-mode .stat-card .value, body.dark-mode .card-title { color: #e5e7eb; }
body.dark-mode .input-group-text.nl-input-icon { background: #123b37; border-color: #37414c; color: #2dd4bf; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991px) {
    .content, .content-header { padding-left: 14px; padding-right: 14px; }
    .main-footer { padding: 10px 14px; }
}
