/* Root Variables for Light Mode */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
    --sidebar-hover: #34495e;
    --sidebar-active: #3498db;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --modal-overlay: rgba(0, 0, 0, 0.5);
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --primary: #007bff;
}

/* Dark Mode Variables - Professional Navy-Slate Theme */
.dark-mode {
    --bg-primary: #0f172a;
    --bg-secondary: #131c2e;
    --bg-tertiary: #1a2540;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #2d3f58;
    --sidebar-bg: #0b1120;
    --sidebar-text: #cbd5e1;
    --sidebar-hover: rgba(148, 163, 184, 0.08);
    --sidebar-active: #3b82f6;
    --card-bg: #1e293b;
    --card-shadow: rgba(0, 0, 0, 0.5);
    --input-bg: #131c2e;
    --input-border: #2d3f58;
    --modal-overlay: rgba(0, 0, 0, 0.8);
    --success: #10b981;
    --danger: #f87171;
    --warning: #fbbf24;
    --info: #38bdf8;
    --primary: #3b82f6;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 70px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: visible;
    transition: width 0.3s ease;
    z-index: 9999;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.2);
}

.sidebar:not(.collapsed) {
    width: 250px;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
}

.logo i {
    font-size: 24px;
    color: var(--sidebar-active);
}

.sidebar.collapsed .logo .app-name {
    display: none;
}

.sidebar.collapsed .sidebar-nav span:not(.nav-tooltip) {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    position: relative;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background-color 0.3s;
    position: relative;
}

.sidebar-nav a:hover {
    background-color: var(--sidebar-hover);
}

.sidebar-nav li.active a {
    background-color: var(--sidebar-active);
}

.sidebar-nav a i {
    font-size: 18px;
    min-width: 30px;
    text-align: center;
}

/* Collapsed sidebar: icon on top + menu name label below */
.sidebar .sidebar-nav .nav-tooltip {
    display: none;
}

.sidebar.collapsed .sidebar-nav li {
    position: relative;
}

.sidebar.collapsed .sidebar-nav a {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 13px 4px;
}

.sidebar.collapsed .sidebar-nav a i {
    min-width: unset;
    font-size: 18px;
}

.sidebar.collapsed .sidebar-nav a .nav-tooltip {
    display: block;
    position: static;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    padding: 0;
    border-radius: 0;
    white-space: normal;
    word-break: break-word;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
    box-shadow: none;
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border: none;
    text-align: center;
    width: 60px;
    line-height: 1.3;
    transition: color 0.3s;
}

.sidebar.collapsed .sidebar-nav a:hover .nav-tooltip,
.sidebar.collapsed .sidebar-nav li.active a .nav-tooltip {
    color: rgba(255, 255, 255, 0.95);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 70px;
    transition: none;
}

/* Top Header */
.top-header {
    background-color: var(--card-bg);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px var(--card-shadow);
    position: sticky;
    top: 0;
    z-index: 500;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.topnav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.topnav-icon-btn:hover,
.topnav-icon-btn.active {
    color: var(--primary);
    background: var(--bg-tertiary);
}

.topnav-logout-btn:hover {
    color: var(--danger);
    background: rgba(220, 53, 69, 0.1);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ── Notification Bell ─────────────────────────────────────────────────── */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notif-wrapper {
    position: relative;
}

.notif-bell-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-bell-btn:hover {
    color: var(--primary);
    background: var(--bg-tertiary);
}

.notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    pointer-events: none;
    animation: notifPop 0.3s ease-out;
}

@keyframes notifPop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* Dropdown panel */
.notif-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-height: 420px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px var(--card-shadow);
    z-index: 1100;
    overflow: hidden;
    flex-direction: column;
}

.notif-panel.open {
    display: flex;
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.notif-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}

.notif-clear-btn:hover {
    background: var(--bg-tertiary);
}

.notif-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.notif-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: var(--bg-tertiary);
}

.notif-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.notif-brand {
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.notif-item-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Bell pulse animation when unread count > 0 */
.notif-bell-btn.has-unread .fa-bell {
    animation: bellRing 1.2s ease-in-out;
}

@keyframes bellRing {
    0%   { transform: rotate(0); }
    10%  { transform: rotate(15deg); }
    20%  { transform: rotate(-12deg); }
    30%  { transform: rotate(10deg); }
    40%  { transform: rotate(-8deg); }
    50%  { transform: rotate(5deg); }
    60%  { transform: rotate(0); }
    100% { transform: rotate(0); }
}

/* Content Area */
.content-area {
    padding: 30px;
}

/* Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-icon.primary {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--primary);
}

.stat-icon.success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.stat-icon.warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning);
}

.stat-icon.danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.stat-icon.info {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info);
}

.stat-details h3 {
    font-size: 32px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.stat-details p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Card */
.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--card-shadow);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 25px;
}

/* Table Controls */
.table-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
}

.search-box {
    flex: 1 1 220px;
    max-width: 350px;
    min-width: 180px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 13px;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    flex: 1 1 auto;
}

.filter-group .form-control {
    min-width: 0;
    width: auto;
    flex: 1 1 120px;
    max-width: 200px;
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.3s;
    min-width: 180px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

/* Password Toggle */
.password-input-group {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
}

/* Buttons — Ghost / Outline Style */
.btn {
    padding: 8px 16px;
    border: 1.5px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background-color: transparent;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Primary */
.btn-primary {
    color: var(--primary);
    border-color: var(--primary);
    background-color: rgba(59, 130, 246, 0.1);
}

.btn-primary:hover {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

/* Success */
.btn-success {
    color: var(--success);
    border-color: var(--success);
    background-color: rgba(16, 185, 129, 0.1);
}

.btn-success:hover {
    background-color: var(--success);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

/* Danger */
.btn-danger {
    color: var(--danger);
    border-color: var(--danger);
    background-color: rgba(220, 53, 69, 0.1);
}

.btn-danger:hover {
    background-color: var(--danger);
    color: #fff;
    box-shadow: 0 4px 14px rgba(220, 53, 69, 0.35);
}

/* Secondary */
.btn-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
    background-color: rgba(108, 117, 125, 0.08);
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Warning */
.btn-warning {
    color: var(--warning);
    border-color: var(--warning);
    background-color: rgba(251, 191, 36, 0.1);
}

.btn-warning:hover {
    background-color: var(--warning);
    color: #1a1a1a;
    box-shadow: 0 4px 14px rgba(251, 191, 36, 0.35);
}

/* Orange */
.btn-orange {
    color: #f97316;
    border-color: #f97316;
    background-color: rgba(249, 115, 22, 0.1);
}

.btn-orange:hover {
    background-color: #f97316;
    color: #fff;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg);
}

.data-table thead {
    background-color: var(--bg-tertiary);
}

.data-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    background-color: var(--bg-secondary);
}

.data-table th i.sort-icon {
    margin-left: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

.data-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 13px;
}

.data-table tbody tr:hover {
    background-color: var(--bg-secondary);
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 12px;
}

.pagination {
    display: flex;
    gap: 5px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pagination button:hover:not(:disabled) {
    background-color: var(--bg-secondary);
}

.pagination button.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Analytics dashboard */
.analytics-section-title {
    margin: 0 0 12px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-total-row {
    background: var(--bg-secondary) !important;
    font-weight: 700;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.badge-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.badge-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.badge-warning {
    background-color: rgba(255, 193, 7, 0.2);
    color: #d68910;
}


.badge-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info);
}

.badge-primary {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--primary);
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.auth-card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    width: 100%;
    max-width: 450px;
    padding: 40px;
}

@media (max-width: 768px) {
    .auth-container {
        padding: 15px;
    }
    
    .auth-card {
        padding: 30px 20px;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 10px;
    }
    
    .auth-card {
        padding: 25px 15px;
        border-radius: 8px;
    }
    
    .auth-header i {
        font-size: 40px !important;
    }
    
    .auth-header h2 {
        font-size: 22px !important;
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
}

.auth-header h2 {
    color: var(--text-primary);
    margin-bottom: 5px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar .app-name,
    .sidebar .sidebar-nav span:not(.nav-tooltip) {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 250px;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar.mobile-open .app-name,
    .sidebar.mobile-open .sidebar-nav span:not(.nav-tooltip) {
        display: inline;
    }
    
    .sidebar.mobile-open .sidebar-nav .nav-tooltip {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .top-header {
        padding: 15px 20px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px 15px;
        gap: 15px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .stat-details h3 {
        font-size: 24px;
    }
    
    .stat-details p {
        font-size: 13px;
    }
    
    .table-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .search-box {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .filter-group {
        flex-wrap: wrap;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .user-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px 10px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .stat-details h3 {
        font-size: 20px;
    }
    
    .stat-details p {
        font-size: 11px;
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .pagination-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pagination {
        justify-content: center;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

/* Date / time picker calendar & clock icons — ensure visibility in all themes */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    border-radius: 3px;
    opacity: 0.6;
    filter: invert(0.3);   /* slightly dark on white background for contrast */
    transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    filter: invert(0.3);
}

/* Dark mode: invert the native icon so it shows as light on dark background */
.dark-mode input[type="date"]::-webkit-calendar-picker-indicator,
.dark-mode input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.dark-mode input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.4);
    opacity: 0.75;
    cursor: pointer;
    transition: opacity 0.2s;
}

.dark-mode input[type="date"]::-webkit-calendar-picker-indicator:hover,
.dark-mode input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
.dark-mode input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    filter: invert(1) brightness(1.6);
}

/* ================================================
   Dark Mode - Professional Visual Enhancements
   ================================================ */

/* Cards */
.dark-mode .card {
    border: 1px solid #2d3f58;
}

.dark-mode .card-header {
    background-color: rgba(11, 17, 32, 0.5);
}

/* Top header */
.dark-mode .top-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid #2d3f58;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* Sidebar */
.dark-mode .sidebar {
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.6);
}

.dark-mode .sidebar-header {
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.dark-mode .sidebar-nav li.active a {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.15);
}

/* Tables */
.dark-mode .data-table thead {
    background-color: rgba(11, 17, 32, 0.6);
}

.dark-mode .data-table th {
    border-bottom-color: #2d3f58;
}

.dark-mode .data-table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.07);
}

/* Stat cards */
.dark-mode .stat-card {
    border: 1px solid #2d3f58;
}

.dark-mode .stat-icon.primary { background-color: rgba(59, 130, 246, 0.15); }
.dark-mode .stat-icon.success { background-color: rgba(16, 185, 129, 0.15); color: #10b981; }
.dark-mode .stat-icon.warning { background-color: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.dark-mode .stat-icon.danger  { background-color: rgba(248, 113, 113, 0.15); color: #f87171; }
.dark-mode .stat-icon.info    { background-color: rgba(56, 189, 248, 0.15); color: #38bdf8; }

/* Badges */
.dark-mode .badge-success { background-color: rgba(16, 185, 129, 0.15); color: #10b981; }
.dark-mode .badge-danger  { background-color: rgba(248, 113, 113, 0.15); color: #f87171; }
.dark-mode .badge-warning { background-color: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.dark-mode .badge-info    { background-color: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.dark-mode .badge-primary { background-color: rgba(59, 130, 246, 0.15); color: #3b82f6; }

/* Pagination */
.dark-mode .pagination button {
    border-color: #2d3f58;
    background-color: #1e293b;
}

.dark-mode .pagination button:hover:not(:disabled) {
    background-color: #1a2540;
    border-color: #3b82f6;
}

/* Form inputs */
.dark-mode .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Modals */
.dark-mode .modal-content {
    border: 1px solid #2d3f58;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

/* Tabs */
.dark-mode .tabs {
    border-bottom-color: #2d3f58;
}
