/*!
 * DashLite Green Glass Overrides
 * Applies SRCOE green glass branding to DashLite framework
 * Load AFTER dashlite.css and green-brand.css
 */

/* ============================================
   DASHLITE VARIABLE OVERRIDES
   ============================================ */
:root {
    /* Override DashLite defaults with green palette */
    --bs-primary: #16a34a;
    --bs-primary-rgb: 22, 163, 74;
    --bs-success: #22c55e;
    --bs-success-rgb: 34, 197, 94;
    --bs-info: #06b6d4;

    /* DashLite specific overrides */
    --nk-body-bg: #f0f2f5;
    --nk-body-color: #1f2b3a;
    --nk-sidebar-bg: #0f172a;
    --nk-sidebar-width: 260px;
}

/* ============================================
   SIDEBAR — Light Theme (is-light)
   ============================================ */
.nk-sidebar.is-light {
    background: #0f172a !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* Sidebar brand area */
.nk-sidebar.is-light .nk-sidebar-head {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nk-sidebar.is-light .nk-sidebar-brand {
    color: #ffffff;
}

.nk-sidebar.is-light .nk-sidebar-brand .nk-sidebar-logo {
    opacity: 0.95;
    transition: opacity 0.2s ease;
}

.nk-sidebar.is-light .nk-sidebar-brand .nk-sidebar-logo:hover {
    opacity: 1;
}

.nk-sidebar.is-light .nk-sidebar-brand b {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    font-size: 0.95rem;
}

/* Menu heading */
.nk-sidebar.is-light .nk-menu-heading h6 {
    color: rgba(255, 255, 255, 0.3) !important;
    text-transform: uppercase;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* Menu items — default state */
.nk-sidebar.is-light .nk-menu-item > .nk-menu-link,
.nk-sidebar.is-light .nk-menu-item .nk-menu-link {
    color: rgba(255, 255, 255, 0.55);
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 1px 12px;
    padding: 0.65rem 0.85rem;
}

.nk-sidebar.is-light .nk-menu-item > .nk-menu-link:hover,
.nk-sidebar.is-light .nk-menu-item .nk-menu-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

/* Menu icons */
.nk-sidebar.is-light .nk-menu-item > .nk-menu-link .nk-menu-icon,
.nk-sidebar.is-light .nk-menu-item .nk-menu-link .nk-menu-icon {
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.2s ease;
}

.nk-sidebar.is-light .nk-menu-item > .nk-menu-link:hover .nk-menu-icon,
.nk-sidebar.is-light .nk-menu-item .nk-menu-link:hover .nk-menu-icon {
    color: rgba(255, 255, 255, 0.7);
}

/* ACTIVE menu item — green highlight */
.nk-sidebar.is-light .nk-menu-item.current-page > .nk-menu-link,
.nk-sidebar.is-light .nk-menu-item.current-page .nk-menu-link {
    background-color: rgba(34, 197, 94, 0.12) !important;
    color: #22c55e !important;
    font-weight: 600;
    border-left: 3px solid #16a34a;
    margin-left: 0;
    padding-left: 0.75rem;
    border-radius: 0 8px 8px 0;
}

.nk-sidebar.is-light .nk-menu-item.current-page > .nk-menu-link .nk-menu-icon,
.nk-sidebar.is-light .nk-menu-item.current-page .nk-menu-link .nk-menu-icon {
    color: #22c55e !important;
}

/* Active hover state */
.nk-sidebar.is-light .nk-menu-item.current-page > .nk-menu-link:hover,
.nk-sidebar.is-light .nk-menu-item.current-page .nk-menu-link:hover {
    background-color: rgba(34, 197, 94, 0.18) !important;
    color: #4ade80 !important;
}

/* Parent item with active child */
.nk-sidebar.is-light .nk-menu-item.has-sub.current-page > .nk-menu-link {
    background-color: rgba(34, 197, 94, 0.08) !important;
    color: #22c55e !important;
}

/* Submenu */
.nk-sidebar.is-light .nk-menu-sub {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    margin: 4px 12px;
    padding: 4px 0;
}

.nk-sidebar.is-light .nk-menu-sub .nk-menu-item > .nk-menu-link,
.nk-sidebar.is-light .nk-menu-sub .nk-menu-item .nk-menu-link {
    color: rgba(255, 255, 255, 0.45);
    margin: 1px 8px;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
}

.nk-sidebar.is-light .nk-menu-sub .nk-menu-item > .nk-menu-link:hover,
.nk-sidebar.is-light .nk-menu-sub .nk-menu-item .nk-menu-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

/* Active submenu item */
.nk-sidebar.is-light .nk-menu-sub .nk-menu-item.current-page > .nk-menu-link,
.nk-sidebar.is-light .nk-menu-sub .nk-menu-item.current-page .nk-menu-link {
    background-color: rgba(34, 197, 94, 0.15) !important;
    color: #22c55e !important;
    font-weight: 600;
    border-left: 2px solid #16a34a;
    padding-left: 12px;
}

/* Sidebar badge */
.nk-sidebar.is-light .nk-menu-badge {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
}

/* Sidebar footer / toggle */
.nk-sidebar.is-light .nk-sidebar-foot {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Sidebar scrollbar */
.nk-sidebar .simplebar-track.simplebar-vertical {
    background: rgba(255, 255, 255, 0.05);
}

.nk-sidebar .simplebar-scrollbar.simplebar-visible:before {
    background: rgba(255, 255, 255, 0.15);
}

/* ============================================
   HEADER / TOPBAR
   ============================================ */
.nk-header.is-light:not([class*=bg-]),
.nk-header:not([class*=bg-]) {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

/* Header brand (inside content area) */
.nk-header-brand {
    color: #1f2b3a;
}

/* Header search */
.nk-header-search .form-control {
    background: rgba(22, 163, 74, 0.04);
    border: 1px solid rgba(22, 163, 74, 0.12);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.nk-header-search .form-control:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
    background: rgba(22, 163, 74, 0.06);
}

.nk-header-search .form-control:focus + .nk-header-search-icon,
.nk-header-search .form-control:focus ~ .icon {
    color: #16a34a;
}

/* Quick nav icons in header */
.nk-quick-nav-icon {
    color: #3c4d62;
    transition: all 0.2s ease;
}

.nk-quick-nav-icon:hover {
    color: #16a34a;
}

/* Header dropdowns */
.nk-header .dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.nk-header .dropdown-item {
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    transition: all 0.15s ease;
}

.nk-header .dropdown-item:hover {
    background: rgba(22, 163, 74, 0.06);
    color: #16a34a;
}

/* ============================================
   CONTENT AREA
   ============================================ */
.nk-content {
    background: #f0f2f5;
}

/* ============================================
   CARDS
   ============================================ */
.nk-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
}

.nk-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.nk-card .nk-card-head {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1.25rem 1.5rem;
}

.nk-card .nk-card-title {
    font-weight: 700;
    color: #1f2b3a;
    font-size: 1rem;
}

.nk-card .nk-card-body {
    padding: 1.5rem;
}

/* Stat cards */
.nk-stat-card {
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.25s ease;
    overflow: hidden;
}

.nk-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* Green accent stat card */
.nk-stat-card .nk-stat-icon {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    border-radius: 12px;
}

.nk-stat-card .nk-stat-icon .icon {
    color: #ffffff;
}

/* ============================================
   TABLES
   ============================================ */
.nk-table {
    border-collapse: separate;
    border-spacing: 0;
}

.nk-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.85rem 1rem;
    border-bottom: 2px solid rgba(22, 163, 74, 0.12);
}

.nk-table tbody td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 0.88rem;
    color: #334155;
}

.nk-table tbody tr {
    transition: background 0.15s ease;
}

.nk-table tbody tr:hover {
    background: rgba(22, 163, 74, 0.03);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #15803d, #16a34a);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.3);
    border-radius: 10px;
}

.btn-outline-primary:hover {
    background: rgba(22, 163, 74, 0.08);
    border-color: #16a34a;
    color: #15803d;
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #15803d, #16a34a);
}

/* ============================================
   FORM CONTROLS
   ============================================ */
.form-control,
.form-select {
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 0.65rem 0.85rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

/* ============================================
   BADGES
   ============================================ */
.badge-primary {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.badge-success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.badge-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.badge-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

.badge-info {
    background: linear-gradient(135deg, #06b6d4, #22d3ee);
}

/* ============================================
   ALERTS
   ============================================ */
.alert-success {
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid rgba(22, 163, 74, 0.2);
    color: #15803d;
    border-radius: 12px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
    border-radius: 12px;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #d97706;
    border-radius: 12px;
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    color: #0891b2;
    border-radius: 12px;
}

/* ============================================
   PAGINATION
   ============================================ */
.nk-pagination .page-item .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #475569;
    transition: all 0.2s ease;
}

.nk-pagination .page-item .page-link:hover {
    background: rgba(22, 163, 74, 0.06);
    border-color: rgba(22, 163, 74, 0.2);
    color: #16a34a;
}

.nk-pagination .page-item.active .page-link {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}

/* ============================================
   MODALS
   ============================================ */
.modal-content {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px 16px 0 0;
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0 0 16px 16px;
    padding: 1rem 1.5rem;
}

/* ============================================
   DROPDOWNS (general)
   ============================================ */
.dropdown-menu {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background: rgba(22, 163, 74, 0.06);
    color: #16a34a;
}

/* ============================================
   TOOLTIP / POPOVER
   ============================================ */
.tooltip-inner {
    background: #0f172a;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

/* ============================================
   PRELOADER / SPINNER
   ============================================ */
.nk-preloader .nk-preloader-box {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.nk-preloader .spinner-border {
    color: #16a34a;
}

/* ============================================
   FOOTER
   ============================================ */
.nk-footer {
    background: #0f172a;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nk-footer .nk-footer-copyright {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.82rem;
}

.nk-footer .nk-footer-links a {
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s ease;
}

.nk-footer .nk-footer-links a:hover {
    color: #22c55e;
}

/* ============================================
   TOGGLE / SWITCH
   ============================================ */
.form-check-input:checked {
    background-color: #16a34a;
    border-color: #16a34a;
}

.form-check-input:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 0.25rem rgba(22, 163, 74, 0.25);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .nk-sidebar.is-light {
        background: #0f172a !important;
    }

    .nk-sidebar.is-light .nk-menu-item > .nk-menu-link,
    .nk-sidebar.is-light .nk-menu-item .nk-menu-link {
        margin: 1px 8px;
    }
}

@media (max-width: 575.98px) {
    .nk-card {
        border-radius: 12px;
    }

    .nk-stat-card {
        border-radius: 10px;
    }

    .btn-primary {
        border-radius: 8px;
        padding: 0.5rem 1rem;
    }
}

/* ============================================
   SELECTION HIGHLIGHT
   ============================================ */
::selection {
    background: rgba(22, 163, 74, 0.2);
    color: inherit;
}

/* ============================================
   SCROLLBAR (Webkit)
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(22, 163, 74, 0.3);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .nk-sidebar,
    .nk-header,
    .nk-footer {
        display: none !important;
    }

    .nk-content {
        margin: 0 !important;
        padding: 0 !important;
    }
}
