/* ============================================================
   Enterprise Security Management System - Premium Theme
   ============================================================ */

/* CSS Variables */
:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --primary-light: #6ea8fe;
    --secondary: #6f42c1;
    --secondary-dark: #5a32a3;
    --secondary-light: #9b72cf;
    --accent: #00bcd4;
    --accent-dark: #0097a7;
    --accent-light: #4dd0e1;
    --success: #198754;
    --success-dark: #157347;
    --success-light: #479f76;
    --info: #0dcaf0;
    --warning: #ffc107;
    --warning-dark: #d39e00;
    --warning-light: #ffd648;
    --danger: #dc3545;
    --danger-dark: #b02a37;
    --danger-light: #e35d6a;
    --dark: #1e1e2d;
    --darker: #151521;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --body-bg: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #3f4254;
    --text-muted: #7e8299;
    --border-color: #e4e6ef;
    --sidebar-bg: #1e1e2d;
    --sidebar-text: #a2a3b7;
    --sidebar-hover: #2a2a3c;
    --sidebar-active: #0d6efd;
    --header-bg: #6f42c1;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    --shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
    --shadow-lg: 0 1rem 3rem rgba(0,0,0,0.15);
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgba(255,255,255,0.7);
    --glass-border: rgba(255,255,255,0.2);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --body-bg: #1a1a2e;
    --card-bg: #16213e;
    --text-color: #e4e6ef;
    --text-muted: #a2a3b7;
    --border-color: #2a2a3c;
    --sidebar-bg: #0f0f1a;
    --sidebar-text: #7e8299;
    --sidebar-hover: #1a1a2e;
    --header-bg: #5a32a3;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0,0,0,0.3);
    --shadow: 0 0.5rem 1rem rgba(0,0,0,0.4);
    --shadow-lg: 0 1rem 3rem rgba(0,0,0,0.5);
    --glass-bg: rgba(22,33,62,0.8);
    --glass-border: rgba(255,255,255,0.05);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Dashboard Theme Scoped Variables */
.dashboard-theme {
    --primary: #5B4BDB;
    --primary-dark: #4A3CC4;
    --primary-light: #7A5FFF;
    --secondary: #6C63FF;
    --secondary-dark: #5A52E0;
    --accent: #4A90E2;
    --accent-dark: #357ABD;
    --success: #26C281;
    --success-dark: #1E9E6B;
    --info: #4A90E2;
    --warning: #F5A623;
    --warning-dark: #D4891A;
    --danger: #E74C3C;
    --danger-dark: #C0392B;
    --gray-100: #F5F7FB;
    --gray-200: #E6EAF2;
    --gray-300: #D5DAE5;
    --gray-400: #B0B8C9;
    --gray-500: #8E96AB;
    --gray-600: #7B8A9B;
    --body-bg: #F5F7FB;
    --card-bg: #FFFFFF;
    --text-color: #2C3E50;
    --text-muted: #7B8A9B;
    --border-color: #E6EAF2;
    --sidebar-bg: #1A1A2E;
    --sidebar-text: #A2A3C7;
    --sidebar-hover: #252540;
    --sidebar-active: #5B4BDB;
    --shadow-sm: 0 2px 8px rgba(91,75,219,0.06);
    --shadow: 0 8px 24px rgba(91,75,219,0.08);
    --shadow-lg: 0 16px 48px rgba(91,75,219,0.12);
}

[data-theme="dark"] .dashboard-theme {
    --body-bg: #1a1a2e;
    --card-bg: #16213e;
    --text-color: #e4e6ef;
    --text-muted: #a2a3b7;
    --border-color: #2a2a3c;
    --sidebar-bg: #0f0f1a;
    --sidebar-text: #7e8299;
    --sidebar-hover: #1a1a2e;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    color: var(--text-color);
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
    padding-top: 70px;
}

.main-content {
    flex: 1;
    margin-left: 200px;
    transition: var(--transition);
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
}

.sidebar-collapsed .main-content {
    margin-left: 70px;
}

.page-content {
    flex: 1;
    padding: 1.25rem;
}

/* Auth Wrapper */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--header-bg);
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    animation: authGlow 15s ease infinite;
}

@keyframes authGlow {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-30px, 20px) rotate(240deg); }
}

.auth-card {
    width: 100%;
    max-width: 450px;
    margin: 1rem;
    position: relative;
    z-index: 1;
}

.auth-card .card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 2.5rem;
}

.auth-card .auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card .auth-logo i {
    font-size: 3rem;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card .auth-logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
    color: var(--dark);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 200px;
    height: calc(100vh - 70px);
    background: var(--sidebar-bg);
    z-index: 1035;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-collapsed .sidebar {
    width: 70px;
    overflow: visible;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-collapsed .sidebar-title,
.sidebar-collapsed .menu-text,
.sidebar-collapsed .menu-arrow,
.sidebar-collapsed .sidebar-footer .menu-text {
    display: none;
}

.sidebar-collapsed .menu-link {
    justify-content: center;
    padding: 0.55rem 0;
    gap: 0;
    border-left: none;
}

.sidebar-collapsed .menu-link i {
    width: auto;
    font-size: 1.15rem;
    margin: 0;
    color: rgba(255,255,255,0.5);
}

.sidebar-collapsed .menu-link:hover i {
    color: rgba(255,255,255,0.85);
}

.sidebar-collapsed .menu-link.active i {
    color: var(--sidebar-active);
}

.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0.75rem 0;
}

.sidebar-collapsed .sidebar-header .sidebar-toggle {
    margin: 0;
}

.sidebar-collapsed .sidebar-footer .menu-link {
    justify-content: center;
    padding: 0.55rem 0;
}

.sidebar-collapsed .submenu {
    display: none;
}

.sidebar-collapsed .has-submenu.open .submenu {
    display: block;
    position: absolute;
    left: 70px;
    top: 0;
    width: 220px;
    background: var(--sidebar-bg);
    border-radius: 0 8px 8px 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    max-height: none;
    z-index: 1040;
    border: 1px solid rgba(255,255,255,0.06);
}

.sidebar-collapsed .submenu-link {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.sidebar-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    min-height: 48px;
}

.sidebar-title {
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.8px;
    font-size: 0.68rem;
    font-weight: 600;
}

.sidebar-toggle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.3) !important;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    color: #fff !important;
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.sidebar-body::-webkit-scrollbar {
    width: 3px;
}

.sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    position: relative;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.813rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.menu-link i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    color: rgba(255,255,255,0.35);
    transition: var(--transition);
}

.menu-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.menu-link:hover i {
    color: rgba(255,255,255,0.7);
}

.menu-link.active {
    background: linear-gradient(90deg, rgba(91,75,219,0.2), transparent);
    color: #fff;
    border-left-color: var(--sidebar-active);
}

.menu-link.active i {
    color: var(--sidebar-active);
}

.menu-arrow {
    margin-left: auto;
    font-size: 0.65rem;
    transition: var(--transition);
    color: rgba(255,255,255,0.3);
}

.has-submenu.open > .menu-link .menu-arrow {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0,0,0,0.15);
}

.has-submenu.open .submenu {
    max-height: 500px;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 0.3rem 0.5rem 0.3rem 2.5rem;
    color: rgba(162,163,199,0.7);
    text-decoration: none;
    font-size: 0.78rem;
    transition: var(--transition);
    border-left: 2px solid transparent;
}

.submenu-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.04);
    border-left-color: var(--sidebar-active);
}

.submenu-link.active {
    color: #fff;
    border-left-color: var(--sidebar-active);
}

.sidebar-footer {
    padding: 0.65rem 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-footer .menu-link {
    margin: 0;
    border-left: none;
}

.sidebar-footer .menu-link.text-danger {
    color: rgba(231,76,60,0.7) !important;
}

.sidebar-footer .menu-link.text-danger:hover {
    color: #E74C3C !important;
    background: rgba(231,76,60,0.1);
}

/* Top Navbar */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(90deg, #5B4BDB, #6C63FF, #7A5FFF);
    z-index: 1040;
    padding: 0 1.5rem;
    box-shadow: 0 4px 24px rgba(91,75,219,0.3);
    backdrop-filter: blur(20px);
    overflow: visible !important;
}

.top-navbar .navbar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon-sm {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    font-size: 1.2rem;
    color: #fff;
    backdrop-filter: blur(4px);
}

@media (min-width: 1200px) {
    .top-navbar .navbar-collapse {
        overflow: visible;
    }
    .top-navbar .navbar-nav {
        flex-wrap: nowrap;
        gap: 0.1rem;
        overflow: visible;
    }
    .top-navbar .navbar-nav .dropdown-menu {
        position: absolute;
    }
}

.top-navbar .navbar-collapse {
    overflow: visible !important;
}

.top-navbar .navbar-nav {
    flex-wrap: nowrap;
    gap: 0.1rem;
}

.top-navbar .navbar-nav .nav-link {
    color: rgba(255,255,255,0.85);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.813rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
}

.top-navbar .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-navbar .navbar-nav .nav-link:hover::after,
.top-navbar .navbar-nav .nav-link.active::after {
    width: 60%;
}

.top-navbar .navbar-nav .nav-link:hover,
.top-navbar .navbar-nav .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.top-navbar .navbar-nav .nav-link.active {
    background: rgba(255,255,255,0.15);
}

.top-navbar .nav-item.dropdown {
    position: relative;
}

.top-navbar .navbar-nav .dropdown-menu {
    margin-top: 0.5rem;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(91,75,219,0.15);
    padding: 0.5rem;
    min-width: 200px;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    z-index: 1050;
}

.top-navbar .navbar-nav .dropdown-menu .dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-color);
    transition: var(--transition);
}

.top-navbar .navbar-nav .dropdown-menu .dropdown-item:hover {
    background: rgba(91,75,219,0.08);
    color: var(--primary);
    transform: translateX(4px);
}

.top-navbar .navbar-nav .dropdown-toggle::after {
    display: none;
}

.top-navbar .dropdown > .dropdown-toggle.active {
    color: #fff;
    background: rgba(255,255,255,0.18);
}

.user-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,0.3);
}

.avatar-initial {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #E74C3C;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.35rem;
    border-radius: 50%;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(231,76,60,0.4);
}

.notification-dropdown {
    width: 380px;
    max-height: 420px;
    overflow-y: auto;
    padding: 0;
}

.notification-list .notification-item {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.notification-list .notification-item:hover {
    background: var(--gray-100);
}

.notification-list .notification-item.unread {
    background: rgba(91,75,219,0.04);
    border-left: 3px solid var(--primary);
}

/* Cards & Glassmorphism */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: var(--radius);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card .stat-change {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Gradient backgrounds for stat cards */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
}

.bg-gradient-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #d39e00 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #084298);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(13,110,253,0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    border: none;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
    color: #fff;
}

.btn-accent:hover {
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-group-sm > .btn, .btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
}

/* Forms */
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    background: var(--card-bg);
    color: var(--text-color);
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.15);
}

.form-floating > .form-control:focus ~ label {
    color: var(--primary);
}

.form-label {
    font-weight: 500;
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
    color: var(--text-color);
}

.input-group-text {
    background: var(--gray-100);
    border-color: var(--border-color);
}

/* Tables */
.dataTables_wrapper {
    padding: 0;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.3rem 1.5rem 0.3rem 0.5rem;
}

table.dataTable {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

table.dataTable thead th {
    border-bottom: 2px solid var(--border-color);
    background: var(--gray-100);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
}

table.dataTable tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

table.dataTable tbody tr:hover {
    background: rgba(13,110,253,0.02);
}

/* Select2 */
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-height: 38px;
}

/* SweetAlert2 */
.swal2-popup {
    border-radius: var(--radius);
}

.swal2-confirm {
    background: var(--primary) !important;
}

/* Avatar Groups */
.avatar-group {
    display: flex;
    align-items: center;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    font-size: 0.875rem;
    background: var(--primary);
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h4 {
    font-weight: 700;
    margin: 0;
}

.page-header .breadcrumb {
    margin: 0;
    background: transparent;
    padding: 0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in {
    animation: slideIn 0.3s ease;
}

.scale-in {
    animation: scaleIn 0.3s ease;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* Profile & Detail Cards */
.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item .detail-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    min-width: 140px;
    flex-shrink: 0;
}

.detail-item .detail-value {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.625rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--card-bg);
}

.timeline-item .timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Chat / Activity Feed */
.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.empty-state h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* File Upload */
.file-upload {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload:hover {
    border-color: var(--primary);
    background: rgba(13,110,253,0.03);
}

.file-upload input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

/* Image Preview */
.image-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.image-preview-sm {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* Map */
.map-container {
    width: 100%;
    height: 400px;
    border-radius: var(--radius);
    overflow: hidden;
}

/* Print */
@media print {
    .sidebar, .top-navbar, .sidebar-toggle, .no-print {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    .page-content {
        margin-top: 0 !important;
        padding: 0 !important;
    }
}

/* Responsive */
@media (max-width: 1199.98px) {
    .top-navbar {
        padding: 0 0.75rem;
    }
    .top-navbar .navbar-brand {
        font-size: 1rem;
    }
    .brand-icon-sm {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: 200px !important;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-collapsed .sidebar {
        width: 200px !important;
        overflow: visible;
        border-right: 1px solid rgba(255,255,255,0.06);
        transform: translateX(-100%);
    }
    .sidebar-collapsed .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-collapsed .main-content {
        margin-left: 0;
    }
    .top-navbar {
        left: 0;
    }
    .page-content {
        padding: 1rem;
    }
}

@media (max-width: 767.98px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    .auth-card .card {
        padding: 1.5rem;
    }
    .detail-item {
        flex-direction: column;
        gap: 0.25rem;
    }
    .detail-item .detail-label {
        min-width: auto;
    }
}

/* Utilities */
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rounded-card {
    border-radius: var(--radius);
}

.cursor-pointer {
    cursor: pointer;
}

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.hover-scale {
    transition: var(--transition);
}

.hover-scale:hover {
    transform: scale(1.02);
}

.z-index-1 { z-index: 1; }

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Nav tabs styling */
.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.nav-tabs .nav-link:hover {
    color: var(--text-color);
    border-bottom-color: var(--gray-300);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* ============================================================
   Dashboard - Premium Enterprise Redesign 2026
   ============================================================ */

/* Dashboard Header */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h4 {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0;
}

.dashboard-header .breadcrumb {
    margin: 0;
    background: transparent;
    padding: 0;
    font-size: 0.813rem;
}

.dashboard-header .breadcrumb .breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.dashboard-header .breadcrumb .breadcrumb-item a:hover {
    color: var(--primary);
}

.dashboard-header .breadcrumb .breadcrumb-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* KPI Cards */
.kpi-card {
    background: #ffffff;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #E6EAF2);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    height: 120px;
    display: flex;
    align-items: center;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
    transition: var(--transition);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(91,75,219,0.12);
    border-color: transparent;
}

.kpi-card .kpi-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-right: 1rem;
    transition: var(--transition);
}

.kpi-card:hover .kpi-icon-wrap {
    transform: scale(1.05);
}

.kpi-card .kpi-content {
    flex: 1;
    min-width: 0;
}

.kpi-card .kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #7B8A9B;
    color: var(--text-muted, #7B8A9B);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

.kpi-card .kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #2C3E50;
    color: var(--text-color, #2C3E50);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.kpi-card .kpi-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

.kpi-card .kpi-change {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.kpi-card .kpi-change.up {
    color: var(--success);
    background: rgba(38,194,129,0.1);
}

.kpi-card .kpi-change.down {
    color: var(--danger);
    background: rgba(231,76,60,0.1);
}

.kpi-card .kpi-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* KPI Card Variants */
.kpi-card.blue::before { background: linear-gradient(90deg, #4A90E2, #357ABD); }
.kpi-card.blue .kpi-icon-wrap { background: linear-gradient(135deg, rgba(74,144,226,0.12), rgba(74,144,226,0.05)); color: #4A90E2; }

.kpi-card.purple::before { background: linear-gradient(90deg, #5B4BDB, #6C63FF); }
.kpi-card.purple .kpi-icon-wrap { background: linear-gradient(135deg, rgba(91,75,219,0.12), rgba(91,75,219,0.05)); color: #5B4BDB; }

.kpi-card.green::before { background: linear-gradient(90deg, #26C281, #1E9E6B); }
.kpi-card.green .kpi-icon-wrap { background: linear-gradient(135deg, rgba(38,194,129,0.12), rgba(38,194,129,0.05)); color: #26C281; }

.kpi-card.orange::before { background: linear-gradient(90deg, #F5A623, #D4891A); }
.kpi-card.orange .kpi-icon-wrap { background: linear-gradient(135deg, rgba(245,166,35,0.12), rgba(245,166,35,0.05)); color: #F5A623; }

.kpi-card.red::before { background: linear-gradient(90deg, #E74C3C, #C0392B); }
.kpi-card.red .kpi-icon-wrap { background: linear-gradient(135deg, rgba(231,76,60,0.12), rgba(231,76,60,0.05)); color: #E74C3C; }

.kpi-card.cyan::before { background: linear-gradient(90deg, #00BCD4, #0097A7); }
.kpi-card.cyan .kpi-icon-wrap { background: linear-gradient(135deg, rgba(0,188,212,0.12), rgba(0,188,212,0.05)); color: #00BCD4; }

/* Dashboard Cards */
.dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(91,75,219,0.06);
    transition: all 0.3s ease;
    overflow: hidden;
}

.dashboard-card:hover {
    box-shadow: 0 8px 32px rgba(91,75,219,0.1);
}

.dashboard-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-card .card-header h6 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
}

.dashboard-card .card-header .card-header-action {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.dashboard-card .card-header .card-header-action:hover {
    color: var(--primary-dark);
    transform: translateX(2px);
}

.dashboard-card .card-body {
    padding: 1.25rem;
}

/* Chart Container */
.chart-container {
    position: relative;
    width: 100%;
}

.chart-container canvas {
    max-width: 100%;
}

/* Activity Feed */
.activity-feed {
    padding: 0;
}

.activity-feed .activity-item {
    display: flex;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    align-items: flex-start;
}

.activity-feed .activity-item:last-child {
    border-bottom: none;
}

.activity-feed .activity-item:hover {
    background: rgba(91,75,219,0.03);
}

.activity-feed .activity-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.activity-feed .activity-info {
    flex: 1;
    min-width: 0;
}

.activity-feed .activity-info .activity-name {
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.1rem;
}

.activity-feed .activity-info .activity-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.activity-feed .activity-info .activity-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Event Widget */
.event-widget .event-item {
    display: flex;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    align-items: center;
}

.event-widget .event-item:last-child {
    border-bottom: none;
}

.event-widget .event-item:hover {
    background: rgba(91,75,219,0.03);
}

.event-widget .event-date {
    width: 48px;
    height: 52px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(91,75,219,0.08), rgba(91,75,219,0.03));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(91,75,219,0.1);
}

.event-widget .event-date .event-day {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.event-widget .event-date .event-month {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-widget .event-info {
    flex: 1;
    min-width: 0;
}

.event-widget .event-info .event-title {
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.1rem;
}

.event-widget .event-info .event-location {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.event-widget .event-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem 0.4rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 80px;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(91,75,219,0.06), rgba(91,75,219,0.02));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(91,75,219,0.1);
}

.quick-action-btn .q-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
}

.quick-action-btn:hover .q-icon {
    transform: scale(1.1);
}

.quick-action-btn .q-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    line-height: 1.15;
}

/* Notification Panel */
.notification-panel {
    max-height: 320px;
    overflow-y: auto;
}

.notification-panel .notif-item {
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    align-items: flex-start;
}

.notification-panel .notif-item:last-child {
    border-bottom: none;
}

.notification-panel .notif-item:hover {
    background: rgba(91,75,219,0.03);
}

.notification-panel .notif-item.unread {
    background: rgba(91,75,219,0.04);
}

.notification-panel .notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.notification-panel .notif-content {
    flex: 1;
    min-width: 0;
}

.notification-panel .notif-content .notif-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.05rem;
}

.notification-panel .notif-content .notif-time {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.notification-panel .notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 0.35rem;
}

/* Dashboard Row Spacing */
.dashboard-row {
    margin-bottom: 1.25rem;
}

/* Mini Trend Chart */
.mini-trend {
    width: 60px;
    height: 24px;
    display: inline-flex;
    align-items: center;
}

/* Dashboard text colors */
.dashboard-theme .page-content { color: #2C3E50; }

/* Dashboard page header icon */
.page-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: linear-gradient(135deg, rgba(91,75,219,0.1), rgba(91,75,219,0.05));
    color: var(--primary);
}

/* KPI card stagger animation */
.kpi-stagger {
    animation: kpiFadeIn 0.5s ease both;
}

.kpi-stagger:nth-child(1) { animation-delay: 0.05s; }
.kpi-stagger:nth-child(2) { animation-delay: 0.1s; }
.kpi-stagger:nth-child(3) { animation-delay: 0.15s; }
.kpi-stagger:nth-child(4) { animation-delay: 0.2s; }
.kpi-stagger:nth-child(5) { animation-delay: 0.25s; }
.kpi-stagger:nth-child(6) { animation-delay: 0.3s; }

@keyframes kpiFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* KPI Card Responsive */
@media (max-width: 1399.98px) {
    .kpi-card {
        height: 110px;
        padding: 1rem;
    }
    .kpi-card .kpi-value {
        font-size: 1.5rem;
    }
    .kpi-card .kpi-icon-wrap {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        margin-right: 0.75rem;
    }
}

@media (max-width: 767.98px) {
    .kpi-card {
        height: auto;
        padding: 1rem;
    }
    .quick-actions {
        grid-template-columns: 1fr 1fr;
    }
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .dashboard-header h4 {
        font-size: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .quick-actions {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }
    .quick-action-btn {
        padding: 0.6rem 0.35rem;
        min-height: 68px;
    }
    .quick-action-btn .q-icon {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    .quick-action-btn .q-label {
        font-size: 0.6rem;
    }
    .kpi-card .kpi-value {
        font-size: 1.35rem;
    }
    .notification-panel .notif-item {
        padding: 0.65rem 0.85rem;
    }
}
