/* ==========================================================================
   NXIS SOLUÇÕES - SecureCam Painel Administrativo (admin/css/admin.css)
   Design System Dark Navy & Vibrant Gradient UI
   ========================================================================== */
@import url('../../core/css/base.css');

:root {
    --ns-bg: #080D1B;
    --ns-bg-elevated: #0C1326;
    --ns-sidebar: #0A1021;
    --ns-sidebar-hover: rgba(255, 255, 255, 0.06);
    --ns-topbar: #0B1224;
    --ns-surface: #10172B;
    --ns-surface-2: #151E36;
    --ns-surface-hover: #1A2542;
    --ns-border: rgba(148, 163, 184, 0.11);
    --ns-border-strong: rgba(148, 163, 184, 0.20);
    --ns-border-card: rgba(148, 163, 184, 0.11);
    --ns-text: #F8FAFC;
    --ns-text-soft: #CBD5E1;
    --ns-muted: #8B9BB4;

    --ns-primary: #5B35F5;
    --ns-primary-hover: #4C28E0;
    --ns-blue: #1E90FF;
    --ns-cyan: #38BDF8;
    --ns-purple: #8B5CF6;
    --ns-green: #22C55E;
    --ns-emerald: #10B981;
    --ns-orange: #F97316;
    --ns-amber: #F59E0B;
    --ns-red: #EF4444;

    --ns-sidebar-width: 236px;
    --ns-topbar-height: 68px;
    --ns-radius-lg: 14px;
    --ns-radius-md: 10px;
}

html,
body {
    background: var(--ns-bg);
    color: var(--ns-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Scrollbar escura elegante */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #080D1B;
}
::-webkit-scrollbar-thumb {
    background: #1E2942;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #2C3C5E;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */
.ns-layout {
    display: flex;
    min-height: 100vh;
    background: radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.08), transparent 45%),
                radial-gradient(circle at 85% 10%, rgba(124, 58, 237, 0.08), transparent 40%),
                var(--ns-bg);
}

.ns-main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.ns-content {
    flex: 1;
    padding: 22px 26px 26px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* ==========================================================================
   SIDEBAR (admin/views/partials/sidebar.html)
   ========================================================================== */
.ns-sidebar {
    width: var(--ns-sidebar-width);
    background: linear-gradient(180deg, #0B1124 0%, #090E1D 100%);
    border-right: 1px solid var(--ns-border);
    color: var(--ns-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 900;
    transition: transform 0.25s ease, width 0.25s ease;
}

.ns-sidebar.is-collapsed {
    width: 78px;
}

.ns-sidebar.is-collapsed .ns-brand-titles,
.ns-sidebar.is-collapsed .ns-nav-item span:last-child,
.ns-sidebar.is-collapsed .ns-enterprise-card,
.ns-sidebar.is-collapsed .ns-sidebar-status-text,
.ns-sidebar.is-collapsed .ns-sidebar-version {
    display: none;
}

.ns-sidebar.is-collapsed .ns-sidebar-brand {
    padding: 18px 10px;
}

.ns-sidebar.is-collapsed .ns-nav-item {
    justify-content: center;
    padding: 11px;
}

.ns-sidebar-brand {
    height: auto;
    padding: 20px 18px 16px;
    border-bottom: none;
    display: flex;
    justify-content: center;
}

.ns-brand-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    gap: 4px;
}

.ns-brand-mark {
    width: 58px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 14px rgba(30, 144, 255, 0.35));
}

.ns-brand-svg {
    width: 56px;
    height: 48px;
}

.ns-brand-titles {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ns-brand-name {
    font-size: 1.48rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #FFFFFF;
    line-height: 1.1;
}

.ns-brand-accent {
    color: #2196F3;
}

.ns-brand-sub {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--ns-muted);
    margin-top: 3px;
}

.ns-sidebar-nav {
    padding: 8px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.ns-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.90rem;
    font-weight: 500;
    color: #B4C2D8;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.ns-nav-icon {
    width: 19px;
    height: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #93A5C0;
    transition: color 0.18s ease;
}

.ns-nav-icon svg {
    width: 18px;
    height: 18px;
}

.ns-nav-item:hover {
    background: var(--ns-sidebar-hover);
    color: #FFFFFF;
}

.ns-nav-item:hover .ns-nav-icon {
    color: #FFFFFF;
}

.ns-nav-item.active {
    background: linear-gradient(90deg, #6A2CFF 0%, #4638F6 100%);
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(98, 49, 255, 0.38);
}

.ns-nav-item.active .ns-nav-icon {
    color: #FFFFFF;
}

/* Sidebar Footer: Enterprise Promo Card + Status */
.ns-sidebar-footer {
    padding: 10px 14px 16px;
    border-top: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ns-enterprise-card {
    background: linear-gradient(155deg, rgba(32, 41, 82, 0.82) 0%, rgba(18, 22, 48, 0.95) 100%);
    border: 1px solid rgba(112, 92, 255, 0.24);
    border-radius: 14px;
    padding: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ns-enterprise-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.ns-crown-icon {
    width: 26px;
    height: 26px;
    color: #FBBF24;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 6px rgba(251, 191, 36, 0.35));
}

.ns-crown-icon svg {
    width: 24px;
    height: 24px;
}

.ns-enterprise-title {
    display: block;
    font-size: 0.90rem;
    font-weight: 700;
    color: #FBBF24;
    line-height: 1.2;
    margin-bottom: 4px;
}

.ns-enterprise-desc {
    font-size: 0.74rem;
    color: #CBD5E1;
    line-height: 1.38;
}

.ns-btn-enterprise {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 9px;
    background: linear-gradient(90deg, #6B38FB 0%, #4E46F6 100%);
    color: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(99, 56, 251, 0.36);
    transition: filter 0.18s ease, transform 0.15s ease;
}

.ns-btn-enterprise:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.ns-sidebar-status {
    padding: 0 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ns-sidebar-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ns-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.ns-status-dot.is-online {
    background: #22C55E;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.75);
}

.ns-status-dot.is-offline {
    background: #F59E0B;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.65);
}

.ns-status-dot.is-danger {
    background: #EF4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.65);
}

.ns-sidebar-status-text {
    font-size: 0.79rem;
    color: #CBD5E1;
    font-weight: 500;
}

.ns-sidebar-version {
    font-size: 0.72rem;
    color: #64748B;
    padding-left: 16px;
}

.ns-sidebar-overlay {
    display: none;
}

/* ==========================================================================
   TOPBAR (admin/views/partials/topbar.html)
   ========================================================================== */
.ns-topbar {
    height: var(--ns-topbar-height);
    background: rgba(11, 18, 36, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ns-border);
    padding: 0 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 800;
    gap: 16px;
}

.ns-topbar-left,
.ns-topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ns-menu-toggle {
    background: transparent;
    border: none;
    color: #CBD5E1;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.18s ease, color 0.18s ease;
}

.ns-menu-toggle svg {
    width: 21px;
    height: 21px;
}

.ns-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #FFFFFF;
}

.ns-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 999px;
    padding: 0 18px;
    height: 40px;
    width: 390px;
    max-width: 100%;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.ns-search-box:focus-within {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(56, 189, 248, 0.5);
}

.ns-search-icon {
    width: 17px;
    height: 17px;
    color: #94A3B8;
    flex-shrink: 0;
}

.ns-search-box input {
    border: none;
    background: transparent;
    outline: none;
    color: #F8FAFC;
    font-size: 0.87rem;
    width: 100%;
}

.ns-search-box input::placeholder {
    color: #7D8DA8;
}

/* Notification Bell */
.ns-topbar-notify-wrap,
.ns-profile-wrap {
    position: relative;
}

.ns-notify-btn {
    position: relative;
    background: transparent;
    border: none;
    color: #CBD5E1;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.ns-notify-btn svg {
    width: 21px;
    height: 21px;
}

.ns-notify-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #FFFFFF;
}

.ns-notify-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 0.67rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0B1224;
    line-height: 1;
}

/* Profile Trigger */
.ns-admin-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    background: transparent;
    border: none;
    padding: 4px 8px 4px 4px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: background 0.18s ease;
}

.ns-admin-profile-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.ns-admin-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(148, 163, 184, 0.25);
    background: #1E293B;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ns-avatar-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ns-admin-info {
    display: flex;
    flex-direction: column;
    line-height: 1.22;
}

.ns-admin-info strong {
    font-size: 0.87rem;
    font-weight: 600;
    color: #F8FAFC;
}

.ns-admin-info span {
    font-size: 0.72rem;
    color: #8B9BB4;
}

.ns-chevron-icon {
    width: 16px;
    height: 16px;
    color: #94A3B8;
    margin-left: 2px;
}

/* Dropdown Menus */
.ns-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #121B33;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    min-width: 220px;
    padding: 6px;
    z-index: 1200;
}

.ns-notify-dropdown {
    min-width: 300px;
    padding: 0;
    overflow: hidden;
}

.ns-dropdown-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--ns-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.83rem;
}

.ns-dropdown-header a {
    color: var(--ns-cyan);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.78rem;
}

.ns-dropdown-list {
    display: flex;
    flex-direction: column;
}

.ns-dropdown-notify-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    text-decoration: none;
    color: var(--ns-text);
    border-bottom: 1px solid rgba(148, 163, 184, 0.07);
    transition: background 0.15s ease;
}

.ns-dropdown-notify-item:last-child {
    border-bottom: none;
}

.ns-dropdown-notify-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.ns-dropdown-notify-item strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
}

.ns-dropdown-notify-item small {
    font-size: 0.74rem;
    color: var(--ns-muted);
}

.ns-dot-badge {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}
.ns-dot-badge.is-green { background: #10B981; }
.ns-dot-badge.is-blue { background: #38BDF8; }
.ns-dot-badge.is-purple { background: #A855F7; }
.ns-dot-badge.is-orange { background: #F59E0B; }

.ns-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #CBD5E1;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.ns-dropdown-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #FFFFFF;
}

.ns-dropdown-link.is-danger {
    color: #F87171;
}

.ns-dropdown-link.is-danger:hover {
    background: rgba(239, 68, 68, 0.14);
    color: #FCA5A5;
}

.ns-dropdown-divider {
    height: 1px;
    background: var(--ns-border);
    margin: 5px 4px;
}

/* ==========================================================================
   FOOTER (admin/views/partials/footer.html)
   ========================================================================== */
.ns-footer {
    border-top: 1px solid var(--ns-border);
    background: rgba(10, 16, 33, 0.85);
    padding: 15px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--ns-muted);
}

.ns-footer-left,
.ns-footer-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ns-footer-brand {
    color: #FFFFFF;
    font-weight: 700;
}

.ns-footer-brand strong {
    color: #2196F3;
}

.ns-footer-sep {
    color: rgba(148, 163, 184, 0.35);
}

.ns-footer-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #CBD5E1;
}

.ns-footer-version {
    color: #94A3B8;
    font-weight: 500;
}

.ns-footer-links {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.ns-footer-links a {
    color: #94A3B8;
    text-decoration: none;
    transition: color 0.15s ease;
}

.ns-footer-links a:hover {
    color: var(--ns-cyan);
}

/* ==========================================================================
   CABEÇALHOS DE PÁGINA E PAINÉIS DARK
   ========================================================================== */
.ns-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

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

.ns-page-title-wrap h1 {
    font-size: 1.50rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.ns-page-title-wrap p {
    font-size: 0.88rem;
    color: var(--ns-muted);
    margin-top: 2px;
}

.ns-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ns-panel-card {
    background: linear-gradient(180deg, #11192E 0%, #0E1527 100%);
    border: 1px solid var(--ns-border);
    border-radius: var(--ns-radius-lg);
    padding: 20px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.ns-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ns-panel-title-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.ns-panel-title-row h2 {
    font-size: 1.02rem;
    font-weight: 700;
    color: #FFFFFF;
}

.ns-panel-title-icon {
    width: 20px;
    height: 20px;
    color: #CBD5E1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ns-panel-title-icon.is-gold {
    color: #FBBF24;
}

.ns-panel-title-icon.is-cyan {
    color: #38BDF8;
}

.ns-panel-title-icon svg {
    width: 18px;
    height: 18px;
}

.ns-panel-title h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #FFFFFF;
}

.ns-panel-title p {
    font-size: 0.84rem;
    color: var(--ns-muted);
    margin-top: 2px;
}

.ns-link-arrow {
    color: #38BDF8;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease, transform 0.15s ease;
}

.ns-link-arrow:hover {
    color: #7DD3FC;
    transform: translateX(2px);
}

/* ==========================================================================
   KPI CARDS GRADIENTE (IDENTICOS À IMAGEM)
   ========================================================================== */
.ns-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.ns-kpi-card {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.30);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ns-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38);
}

.ns-kpi-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, transparent 45%);
    pointer-events: none;
}

.ns-kpi-card.kpi-blue {
    background: linear-gradient(118deg, #0082FF 0%, #0A52DB 52%, #0B215D 100%);
}

.ns-kpi-card.kpi-purple {
    background: linear-gradient(118deg, #7C3AED 0%, #5B21B6 52%, #221250 100%);
}

.ns-kpi-card.kpi-green {
    background: linear-gradient(118deg, #10B981 0%, #05835B 52%, #0A373E 100%);
}

.ns-kpi-card.kpi-orange {
    background: linear-gradient(118deg, #F97316 0%, #C84B11 52%, #6D2121 100%);
}

.ns-kpi-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.17);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.ns-kpi-icon svg {
    width: 28px;
    height: 28px;
}

.ns-kpi-info {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.ns-kpi-value {
    display: block;
    font-size: 1.62rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.02em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.ns-kpi-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
}

.ns-kpi-label {
    font-size: 0.80rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.86);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ns-kpi-trend {
    font-size: 0.77rem;
    font-weight: 700;
    padding: 0;
    background: transparent;
    border-radius: 0;
    white-space: nowrap;
}

.ns-kpi-trend.up {
    color: #4ADE80;
}

.ns-kpi-trend.down {
    color: #FCA5A5;
}

/* ==========================================================================
   BOTÕES E FILTROS
   ========================================================================== */
.ns-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(90deg, #6833FF 0%, #4143F6 100%);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(91, 53, 245, 0.35);
    transition: filter 0.18s ease, transform 0.15s ease;
}

.ns-btn-primary:hover {
    background: linear-gradient(90deg, #7444FF 0%, #4E50FF 100%);
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.ns-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--ns-surface-2);
    color: #E2E8F0;
    border: 1px solid var(--ns-border);
    font-size: 0.86rem;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ns-btn-secondary:hover {
    background: var(--ns-surface-hover);
    border-color: var(--ns-border-strong);
    color: #FFFFFF;
}

.ns-btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: #94A3B8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ns-btn-icon svg {
    width: 15px;
    height: 15px;
}

.ns-btn-icon:hover {
    background: rgba(56, 189, 248, 0.16);
    border-color: rgba(56, 189, 248, 0.35);
    color: #38BDF8;
}

.ns-btn-icon.is-danger:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.35);
    color: #F87171;
}

.ns-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.ns-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ns-filter-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ns-border);
    color: #CBD5E1;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.80rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s ease;
}

.ns-filter-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #FFFFFF;
}

.ns-filter-pill.active {
    background: linear-gradient(90deg, #6833FF 0%, #4143F6 100%);
    border-color: transparent;
    color: #FFFFFF;
}

/* ==========================================================================
   TABELAS, AVATARES E BADGES
   ========================================================================== */
.ns-table-wrap {
    overflow-x: auto;
    margin-top: 6px;
}

.ns-table {
    width: 100%;
    border-collapse: collapse;
}

.ns-table th {
    text-align: left;
    font-size: 0.77rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.01em;
    color: #8B9BB4;
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--ns-border);
    white-space: nowrap;
}

.ns-table td {
    font-size: 0.86rem;
    color: #E2E8F0;
    padding: 12px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.07);
    vertical-align: middle;
}

.ns-table tbody tr:last-child td {
    border-bottom: none;
}

.ns-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.ns-user-cell {
    display: flex;
    align-items: center;
    gap: 11px;
}

.ns-avatar-initials {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 700;
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ns-avatar-initials.is-blue { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.ns-avatar-initials.is-sky { background: linear-gradient(135deg, #0EA5E9, #2563EB); }
.ns-avatar-initials.is-teal { background: linear-gradient(135deg, #06B6D4, #0284C7); }
.ns-avatar-initials.is-purple { background: linear-gradient(135deg, #8B5CF6, #6D28D9); }
.ns-avatar-initials.is-emerald { background: linear-gradient(135deg, #10B981, #047857); }
.ns-avatar-initials.is-orange { background: linear-gradient(135deg, #F97316, #C2410C); }

.ns-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.ns-user-meta strong {
    font-size: 0.87rem;
    font-weight: 600;
    color: #F8FAFC;
}

.ns-user-meta small {
    font-size: 0.74rem;
    color: #8B9BB4;
}

.ns-plan-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.73rem;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 999px;
    white-space: nowrap;
}

.ns-plan-badge.is-premium {
    background: linear-gradient(90deg, #7C3AED, #6366F1);
    color: #FFFFFF;
}

.ns-plan-badge.is-pro {
    background: linear-gradient(90deg, #2563EB, #0EA5E9);
    color: #FFFFFF;
}

.ns-plan-badge.is-basico {
    background: rgba(148, 163, 184, 0.22);
    color: #E2E8F0;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.ns-plan-badge.is-enterprise {
    background: linear-gradient(90deg, #F59E0B, #EA580C);
    color: #FFFFFF;
}

.ns-status-inline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #E2E8F0;
    white-space: nowrap;
}

.ns-status-inline.is-online { color: #4ADE80; }
.ns-status-inline.is-offline { color: #FBBF24; }
.ns-status-inline.is-danger { color: #F87171; }

.ns-actions-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ns-badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 600;
}

.ns-badge-soft.is-green {
    background: rgba(34, 197, 94, 0.14);
    color: #4ADE80;
    border: 1px solid rgba(34, 197, 94, 0.28);
}

.ns-badge-soft.is-blue {
    background: rgba(56, 189, 248, 0.14);
    color: #38BDF8;
    border: 1px solid rgba(56, 189, 248, 0.28);
}

.ns-badge-soft.is-purple {
    background: rgba(168, 85, 247, 0.15);
    color: #C084FC;
    border: 1px solid rgba(168, 85, 247, 0.28);
}

.ns-badge-soft.is-orange {
    background: rgba(245, 158, 11, 0.15);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.ns-badge-soft.is-red {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.28);
}

/* ==========================================================================
   GRIDS DE CARDS INTERNOS (Câmeras, Planos, Relatórios, Suporte)
   ========================================================================== */
.ns-cards-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.ns-cards-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.ns-cards-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ns-plan-card {
    background: linear-gradient(180deg, #121B33 0%, #0E1528 100%);
    border: 1px solid var(--ns-border);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.ns-plan-card.is-featured {
    border-color: rgba(124, 58, 237, 0.55);
    box-shadow: 0 12px 32px rgba(91, 53, 245, 0.22);
}

.ns-plan-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: #FFFFFF;
}

.ns-plan-price span {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ns-muted);
}

.ns-plan-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1;
}

.ns-plan-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    color: #CBD5E1;
}

.ns-check-mark {
    color: #22C55E;
    font-weight: 700;
}

/* Câmera Preview Card */
.ns-camera-card {
    background: linear-gradient(180deg, #121B33 0%, #0E1528 100%);
    border: 1px solid var(--ns-border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ns-camera-preview {
    height: 138px;
    background: radial-gradient(circle at 50% 45%, #1E2C4F 0%, #0A1021 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--ns-border);
}

.ns-camera-preview-icon {
    width: 44px;
    height: 44px;
    color: rgba(148, 163, 184, 0.35);
}

.ns-camera-live-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.70rem;
    font-weight: 700;
    background: rgba(8, 13, 27, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
}

.ns-camera-res-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.69rem;
    font-weight: 700;
    background: rgba(37, 99, 235, 0.25);
    color: #7DD3FC;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.ns-camera-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ns-camera-body h3 {
    font-size: 0.94rem;
    font-weight: 700;
    color: #FFFFFF;
}

.ns-camera-meta {
    font-size: 0.78rem;
    color: var(--ns-muted);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.ns-camera-footer {
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================================================
   FORMULÁRIOS E MODAIS DARK
   ========================================================================== */
.ns-form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ns-form-group {
    margin-bottom: 16px;
}

.ns-form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #CBD5E1;
    margin-bottom: 6px;
}

.ns-form-group input,
.ns-form-group select,
.ns-form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 10px;
    font-size: 0.88rem;
    font-family: inherit;
    background: #0B1224;
    color: #F8FAFC;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ns-form-group input::placeholder,
.ns-form-group textarea::placeholder {
    color: #64748B;
}

.ns-form-group input:focus,
.ns-form-group select:focus,
.ns-form-group textarea:focus {
    outline: none;
    border-color: #38BDF8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.ns-switch-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: #E2E8F0;
    cursor: pointer;
}

.ns-switch-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6338F6;
}

.ns-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 18, 0.76);
    backdrop-filter: blur(4px);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ns-modal-card {
    background: #10172B;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    padding: 24px;
    max-width: 490px;
    width: 100%;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.6);
    color: #F8FAFC;
}

.ns-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ns-border);
}

.ns-modal-head h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #FFFFFF;
}

.ns-iab-close-panel {
    background: rgba(255, 255, 255, 0.06);
    color: #CBD5E1;
    border: 1px solid var(--ns-border);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.79rem;
    font-weight: 600;
    cursor: pointer;
}

.ns-iab-close-panel:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
}

/* ==========================================================================
   LOGIN DARK (admin/views/login.html)
   ========================================================================== */
.ns-login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 20% 20%, rgba(30, 144, 255, 0.15), transparent 45%),
                radial-gradient(circle at 80% 80%, rgba(104, 51, 255, 0.18), transparent 45%),
                #080D1B;
    padding: 20px;
}

.ns-login-wrapper {
    width: 100%;
    max-width: 430px;
}

.ns-login-card {
    background: linear-gradient(180deg, #11192E 0%, #0D1426 100%);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    padding: 34px 30px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.ns-login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 22px;
}

.ns-login-header {
    text-align: center;
    margin-bottom: 24px;
}

.ns-login-header h1 {
    font-size: 1.32rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 6px;
}

.ns-login-header p {
    font-size: 0.85rem;
    color: var(--ns-muted);
}

.ns-login-footer {
    margin-top: 22px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--ns-muted);
}

/* ==========================================================================
   TOASTS & CONFIRM MODAL DARK OVERRIDES (NSAlert)
   ========================================================================== */
.ns-toast {
    background: #121B33;
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}

.ns-toast-title {
    color: #FFFFFF;
}

.ns-toast-msg {
    color: #94A3B8;
}

.ns-confirm-backdrop {
    background: rgba(4, 8, 18, 0.76);
    backdrop-filter: blur(4px);
}

.ns-confirm-modal {
    background: #10172B;
    border-color: rgba(148, 163, 184, 0.2);
    color: #FFFFFF;
}

.ns-confirm-title {
    color: #FFFFFF;
}

.ns-confirm-text {
    color: #94A3B8;
}

.ns-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: #E2E8F0;
}

.ns-btn-confirm {
    background: linear-gradient(90deg, #6833FF, #4143F6);
    color: #FFFFFF;
}

/* Espaçamentos utilitários */
.ns-mt-16 { margin-top: 16px; }
.ns-mt-20 { margin-top: 20px; }
.ns-mb-16 { margin-bottom: 16px; }
.ns-mb-20 { margin-bottom: 20px; }

.ns-hidden {
    display: none !important;
}

/* ==========================================================================
   RESPONSIVIDADE
   ========================================================================== */
@media (max-width: 1280px) {
    .ns-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ns-cards-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .ns-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        transform: translateX(-100%);
        width: var(--ns-sidebar-width);
        display: flex;
    }
    .ns-sidebar.open {
        transform: translateX(0);
        box-shadow: 12px 0 40px rgba(0, 0, 0, 0.65);
    }
    .ns-sidebar-overlay.active {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(4, 8, 18, 0.65);
        z-index: 850;
    }
    .ns-search-box {
        width: 220px;
    }
    .ns-cards-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ns-form-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ns-topbar {
        padding: 0 14px;
    }
    .ns-content {
        padding: 16px 14px 20px;
    }
    .ns-search-box {
        display: none;
    }
    .ns-admin-info {
        display: none;
    }
    .ns-kpi-grid,
    .ns-cards-grid-4,
    .ns-cards-grid-3,
    .ns-cards-grid-2 {
        grid-template-columns: 1fr;
    }
    .ns-footer {
        padding: 14px;
        flex-direction: column;
        align-items: flex-start;
    }
}
