/* Modern Premium Styling - e-Impact */

:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --panel-bg: rgba(30, 41, 59, 0.7);
    --panel-border: rgba(255, 255, 255, 0.08);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Light Mode Variables & Overrides */
[data-theme="light"],
html[data-theme="light"],
body[data-theme="light"],
.light-mode,
body.light-mode {
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --panel-bg: rgba(255, 255, 255, 0.90);
    --panel-border: rgba(0, 0, 0, 0.08);
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Glassmorphism Card Utility */
.glass-card {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Auth Layout */
.auth-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(99, 102, 241, 0.15);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--panel-border);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 8px;
    transition: background-color 0.2s, transform 0.1s;
    border: none;
}

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

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

.btn-primary:active {
    transform: scale(0.98);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    flex: 1;
    min-height: 100vh;
}

/* Sidebar Layout Transitions & States */
.dashboard-layout {
    display: flex;
    flex: 1;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.85);
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.sidebar.collapsed {
    width: 0;
    padding: 30px 0;
    overflow: hidden;
    border-right: none;
    opacity: 0;
    pointer-events: none;
}

.admin-sidebar {
    border-right: 1px solid rgba(239, 68, 68, 0.2);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    flex-shrink: 0;
}

.brand-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    background: linear-gradient(to right, #ffffff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: left;
    white-space: nowrap;
}

.brand-subtitle {
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
    white-space: nowrap;
}

.sidebar-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.sidebar-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    transform: rotate(90deg);
}

.sidebar-close-btn:active {
    transform: scale(0.92);
}

/* Sidebar Backdrop for Mobile Screens */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
}

.sidebar-menu a .icon {
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-menu a.logout-link:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 20px;
    gap: 15px;
}

.top-nav h1 {
    font-size: 26px;
    font-weight: 700;
}

.nav-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Sidebar Toggle Button Styles */
.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    font-size: 20px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-toggle-btn:active {
    transform: scale(0.95);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    font-size: 24px;
    background: rgba(99, 102, 241, 0.2);
    padding: 8px;
    border-radius: 50%;
}

.admin-avatar {
    background: rgba(239, 68, 68, 0.2);
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-weight: 600;
    font-size: 14px;
}

.profile-role {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Widgets Grid */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

/* Table Section */
.table-section {
    padding: 24px;
}

.table-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th,
.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--panel-border);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.data-table td {
    font-size: 14px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 20px;
    margin-top: auto;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--panel-border);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 260px;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.collapsed {
        left: -260px;
        width: 260px;
        opacity: 0;
        pointer-events: none;
    }

    .main-content {
        padding: 25px;
    }
}

/* Settings Form Styling */
.settings-card {
    max-width: 800px;
    padding: 35px;
    margin: 0 auto;
}

.settings-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.half-width {
    flex: 1;
}

.form-divider {
    border: 0;
    height: 1px;
    background: var(--panel-border);
    margin: 25px 0;
}

.required-star {
    color: var(--danger);
    font-weight: bold;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Secondary Button */
.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Select Controls */
.form-select-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--panel-border);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 15px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    cursor: pointer;
}

.form-select-control option {
    background: #1e1b4b;
    color: #fff;
}

/* Checkbox Grid Control */
.checkbox-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 10px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.checkbox-container:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary);
}

.checkbox-container input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-label {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Action Buttons */
.table-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
}

.edit-btn {
    background-color: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.edit-btn:hover {
    background-color: rgba(99, 102, 241, 0.3);
}

.delete-btn {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.3);
}

/* Profile Dropdown Styling */
.profile-dropdown-container {
    position: relative;
}

#profile-dropdown-trigger {
    cursor: pointer;
    user-select: none;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

#profile-dropdown-trigger:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.profile-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 200px;
    display: none;
    flex-direction: column;
    padding: 8px 0;
    z-index: 200;
    animation: fadeInDropdown 0.2s ease-out;
}

.profile-dropdown.show {
    display: flex;
}

.profile-dropdown a {
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    display: block;
    text-align: left;
}

.profile-dropdown a:hover {
    background-color: rgba(99, 102, 241, 0.15);
}

.profile-dropdown a.logout-link:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Admin Tools Section & Grid Layout */
.admin-tools-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.admin-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.tool-card {
    padding: 24px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.1);
}

.tool-icon {
    font-size: 32px;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 12px;
    line-height: 1;
}

.tool-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.tool-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Badges & Tags UI */
.badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-info {
    background-color: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-secondary {
    background-color: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Modal Overlay Animation & Glass Layout */
.modal-overlay {
    animation: fadeInOverlay 0.2s ease-out;
}

.modal-container {
    animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tab Navigation Styling & Responsiveness */
.tab-navigation {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 25px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.tab-navigation::-webkit-scrollbar {
    display: none;
}

.tab-navigation a {
    padding: 10px 20px;
    color: var(--text-secondary) !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

.tab-navigation a:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.03);
}

.tab-navigation a.active {
    color: #818cf8 !important;
    border-bottom-color: #818cf8 !important;
    background: rgba(99, 102, 241, 0.1);
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Design System
   ========================================================================== */

/* Tablet & Mobile Drawer Navigation (< 992px) */
@media (max-width: 992px) {
    .sidebar-close-btn {
        display: inline-flex !important;
    }

    .sidebar {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        width: 280px !important;
        max-width: 85vw !important;
        background: #0f172a !important;
        border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: 10px 0 35px rgba(0, 0, 0, 0.75) !important;
        z-index: 1050 !important;
        transform: translateX(0) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        overflow-y: auto !important;
        padding: 24px 18px !important;
    }

    .sidebar.collapsed {
        transform: translateX(-100%) !important;
        width: 280px !important;
        opacity: 1 !important;
        pointer-events: none !important;
        padding: 24px 18px !important;
    }

    .main-content {
        padding: 20px 18px !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .dashboard-layout {
        flex-direction: column !important;
        overflow-x: hidden !important;
    }

    .dashboard-widgets {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
        gap: 15px !important;
    }
}

/* Standard Mobile Devices (< 768px) */
@media (max-width: 768px) {

    /* Header & Navigation */
    .top-nav {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
        margin-bottom: 20px !important;
        padding-bottom: 15px !important;
    }

    .nav-title {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 12px !important;
    }

    .nav-title>div {
        flex: 1 !important;
        min-width: 0 !important;
    }

    .nav-title h1 {
        font-size: 1.2rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .user-profile-actions {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    /* Dashboard Filters Form */
    .filter-form,
    #dashboard-filter-form {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .filter-form select,
    #dashboard-filter-form select {
        width: 100% !important;
        min-width: 0 !important;
        font-size: 13px !important;
        padding: 9px 12px !important;
    }

    .filter-form select[name="satker_id"],
    #dashboard-filter-form select[name="satker_id"] {
        grid-column: span 2 !important;
    }

    .profile-dropdown-container {
        align-self: flex-end !important;
        width: 100% !important;
    }

    .user-profile {
        justify-content: space-between !important;
        width: 100% !important;
        padding: 8px 12px !important;
        background: rgba(255, 255, 255, 0.04) !important;
        border-radius: 10px !important;
    }

    .profile-dropdown {
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        top: calc(100% + 6px) !important;
    }

    /* Scope & Info Banner */
    .main-content>.glass-card[style*="border-left"] {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 14px 16px !important;
        gap: 12px !important;
    }

    .main-content>.glass-card[style*="border-left"]>div {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .main-content>.glass-card[style*="border-left"] span[style*="rgba(255, 255, 255, 0.2)"] {
        display: none !important;
    }

    .main-content>.glass-card[style*="border-left"] .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Dashboard Widgets */
    .dashboard-widgets {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        margin-bottom: 20px !important;
    }

    .stat-card {
        padding: 14px !important;
        border-radius: 12px !important;
    }

    .stat-card h3 {
        font-size: 11.5px !important;
        margin-bottom: 4px !important;
    }

    .stat-number {
        font-size: 1.5rem !important;
        margin-bottom: 4px !important;
    }

    .stat-desc {
        font-size: 11px !important;
        line-height: 1.3 !important;
    }

    /* Charts Section */
    .charts-section {
        flex-direction: column !important;
        gap: 18px !important;
    }

    .charts-section>div,
    .charts-section>.glass-card {
        width: 100% !important;
        min-width: 100% !important;
        flex: none !important;
        padding: 16px !important;
    }

    /* Table Sections & Mobile Swipe */
    .table-section {
        padding: 16px !important;
        border-radius: 12px !important;
        margin-bottom: 20px !important;
    }

    .table-section h3 {
        font-size: 16px !important;
        margin-bottom: 14px !important;
    }

    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border: 1px solid var(--panel-border) !important;
        border-radius: 10px !important;
        margin-bottom: 10px !important;
    }

    .data-table {
        min-width: 620px !important;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px !important;
        font-size: 13px !important;
    }

    .table-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .btn-action {
        padding: 6px 10px !important;
        font-size: 11.5px !important;
        border-radius: 6px !important;
    }

    /* Generic Forms & Rows */
    .form-row {
        flex-direction: column !important;
        gap: 14px !important;
    }

    .form-group.half-width {
        width: 100% !important;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 15px !important;
        padding: 11px 14px !important;
    }

    .filter-section .glass-card {
        padding: 14px !important;
    }

    .filter-section form {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .filter-section form .form-group {
        width: 100% !important;
        min-width: 0 !important;
    }

    .filter-section form select,
    .filter-section form input,
    .filter-section form button {
        width: 100% !important;
    }

    /* Fixed & Sticky Action Bars on Mobile */
    .main-content .glass-card[style*="position: fixed"],
    .main-content form .glass-card[style*="position: sticky"],
    .main-content form .glass-card[style*="position: fixed"] {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        margin-top: 20px !important;
        box-shadow: none !important;
        padding: 15px !important;
    }
}

/* Small Smartphone Devices (< 480px) */
@media (max-width: 480px) {
    .main-content {
        padding: 15px 12px !important;
    }

    .nav-title h1 {
        font-size: 1.05rem !important;
    }

    .nav-title span {
        font-size: 0.75rem !important;
    }

    .sidebar-toggle-btn {
        padding: 6px 10px !important;
        font-size: 18px !important;
    }

    .filter-form,
    #dashboard-filter-form {
        grid-template-columns: 1fr !important;
    }

    .filter-form select[name="satker_id"],
    #dashboard-filter-form select[name="satker_id"] {
        grid-column: span 1 !important;
    }

    .dashboard-widgets {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .stat-number {
        font-size: 1.4rem !important;
    }

    .auth-card {
        padding: 24px 18px !important;
        border-radius: 14px !important;
    }

    .auth-header h2 {
        font-size: 22px !important;
    }

    .auth-header p {
        font-size: 12.5px !important;
    }

    .btn {
        padding: 10px 16px !important;
        font-size: 14px !important;
    }

    .btn-sm {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }

    .settings-card {
        padding: 20px 14px !important;
    }

    .tab-navigation a {
        padding: 7px 12px !important;
        font-size: 12px !important;
    }
}

/* ==========================================================================
   Theme Switcher & Light Mode Component Rules
   ========================================================================== */

/* Sidebar Footer & Theme Toggle Button */
.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--panel-border);
}

.theme-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
    border-color: rgba(99, 102, 241, 0.3);
}

.theme-toggle-btn:active {
    transform: scale(0.98);
}

.theme-toggle-icon {
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Light Theme Component & Contrast Specifics */
[data-theme="light"] body,
body.light-mode,
.light-mode body {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

[data-theme="light"] .main-content,
.light-mode .main-content {
    color: #0f172a !important;
}

/* Headings, Paragraphs, and Base Typography */
[data-theme="light"] h1, [data-theme="light"] h2, [data-theme="light"] h3, [data-theme="light"] h4, [data-theme="light"] h5, [data-theme="light"] h6,
.light-mode h1, .light-mode h2, .light-mode h3, .light-mode h4, .light-mode h5, .light-mode h6 {
    color: #0f172a !important;
}

[data-theme="light"] p, [data-theme="light"] label, [data-theme="light"] strong, [data-theme="light"] b,
.light-mode p, .light-mode label, .light-mode strong, .light-mode b {
    color: #1e293b !important;
}

[data-theme="light"] .stat-desc, [data-theme="light"] .nav-title span, [data-theme="light"] .profile-role, [data-theme="light"] .checkbox-desc, [data-theme="light"] .auth-header p, [data-theme="light"] .settings-subtitle,
.light-mode .stat-desc, .light-mode .nav-title span, .light-mode .profile-role, .light-mode .checkbox-desc, .light-mode .auth-header p, .light-mode .settings-subtitle {
    color: #64748b !important;
}

/* Force light inline-colored texts (#cbd5e1, #94a3b8, #a0aec0, #fff) to be dark in Light Mode */
[data-theme="light"] [style*="color: #cbd5e1"], .light-mode [style*="color: #cbd5e1"],
[data-theme="light"] [style*="color: #94a3b8"], .light-mode [style*="color: #94a3b8"],
[data-theme="light"] [style*="color: #a0aec0"], .light-mode [style*="color: #a0aec0"],
[data-theme="light"] [style*="color: #fff"], .light-mode [style*="color: #fff"],
[data-theme="light"] [style*="color: white"], .light-mode [style*="color: white"],
[data-theme="light"] [style*="color: #f8fafc"], .light-mode [style*="color: #f8fafc"] {
    color: #334155 !important;
}

[data-theme="light"] [style*="color: rgba(255, 255, 255"],
.light-mode [style*="color: rgba(255, 255, 255"] {
    color: #475569 !important;
}

/* High Contrast Colored Accents */
[data-theme="light"] [style*="color: #34d399"],
[data-theme="light"] [style*="color: #10b981"] {
    color: #059669 !important;
}

[data-theme="light"] [style*="color: #ef4444"],
[data-theme="light"] [style*="color: #f87171"],
[data-theme="light"] [style*="color: #fca5a5"] {
    color: #dc2626 !important;
}

[data-theme="light"] [style*="color: #f59e0b"],
[data-theme="light"] [style*="color: #fbbf24"],
[data-theme="light"] [style*="color: #ed8936"] {
    color: #d97706 !important;
}

[data-theme="light"] [style*="color: #60a5fa"],
[data-theme="light"] [style*="color: #63b3ed"],
[data-theme="light"] [style*="color: #818cf8"],
[data-theme="light"] [style*="color: #a5b4fc"] {
    color: #2563eb !important;
}

/* Cards & Glass Containers */
[data-theme="light"] .glass-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .stat-card,
[data-theme="light"] .tool-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .stat-number {
    color: #0f172a !important;
}

/* Sidebar & Mobile Drawer */
[data-theme="light"] .sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}

@media (max-width: 992px) {
    [data-theme="light"] .sidebar {
        background: #ffffff !important;
        border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
        box-shadow: 10px 0 35px rgba(0, 0, 0, 0.15) !important;
    }
}

[data-theme="light"] .brand-title {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

[data-theme="light"] .sidebar-menu a {
    color: #475569 !important;
}

[data-theme="light"] .sidebar-menu a:hover,
[data-theme="light"] .sidebar-menu a.active {
    background: #eef2ff !important;
    color: #4f46e5 !important;
    font-weight: 600;
}

[data-theme="light"] .sidebar-menu a.logout-link:hover {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

/* Form Inputs, Selects, and Textareas */
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea,
[data-theme="light"] .form-select-control,
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] select option,
[data-theme="light"] .form-select-control option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
    color: #94a3b8 !important;
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] .form-select-control:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

[data-theme="light"] .form-select-control {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>") !important;
}

[data-theme="light"] .checkbox-container {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .checkbox-container:hover {
    background: rgba(79, 70, 229, 0.05) !important;
    border-color: #4f46e5 !important;
}

/* Buttons */
[data-theme="light"] .btn-secondary {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .btn-secondary:hover {
    background-color: #e2e8f0 !important;
}

[data-theme="light"] .sidebar-toggle-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
}

[data-theme="light"] .sidebar-toggle-btn:hover {
    background: #f1f5f9 !important;
}

[data-theme="light"] .tool-icon {
    background: rgba(79, 70, 229, 0.08) !important;
}

/* User Profile & Dropdowns */
[data-theme="light"] .top-nav {
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .user-profile {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .profile-name {
    color: #0f172a !important;
    font-weight: 600;
}

[data-theme="light"] .profile-role {
    color: #64748b !important;
}

[data-theme="light"] .profile-dropdown {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .profile-dropdown a {
    color: #334155 !important;
}

[data-theme="light"] .profile-dropdown a:hover {
    background-color: #f1f5f9 !important;
    color: #4f46e5 !important;
}

[data-theme="light"] .profile-dropdown a.logout-link:hover {
    background-color: #fee2e2 !important;
    color: #dc2626 !important;
}

/* Tables */
[data-theme="light"] .data-table {
    background: #ffffff !important;
}

[data-theme="light"] .data-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

[data-theme="light"] .data-table td {
    color: #1e293b !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

[data-theme="light"] .data-table tr:hover td {
    background: #f8fafc !important;
}

/* Theme Toggle Button in Light Mode */
[data-theme="light"] .theme-toggle-btn {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

[data-theme="light"] .theme-toggle-btn:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

/* Navigation Tabs */
[data-theme="light"] .tab-navigation {
    border-bottom-color: #e2e8f0 !important;
}

[data-theme="light"] .tab-navigation a:hover {
    color: #4f46e5 !important;
    background: #eef2ff !important;
}

[data-theme="light"] .tab-navigation a.active {
    color: #4f46e5 !important;
    border-bottom-color: #4f46e5 !important;
    background: #eef2ff !important;
}

/* Action Buttons */
[data-theme="light"] .edit-btn {
    background-color: #eef2ff !important;
    color: #4f46e5 !important;
}

[data-theme="light"] .edit-btn:hover {
    background-color: #e0e7ff !important;
}

[data-theme="light"] .delete-btn {
    background-color: #fee2e2 !important;
    color: #dc2626 !important;
}

[data-theme="light"] .delete-btn:hover {
    background-color: #fecaca !important;
}

/* Badges */
[data-theme="light"] .badge-success {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
    border-color: #a7f3d0 !important;
}

[data-theme="light"] .badge-warning {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    border-color: #fde68a !important;
}

[data-theme="light"] .badge-danger {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fecaca !important;
}

[data-theme="light"] .badge-info {
    background-color: #e0e7ff !important;
    color: #3730a3 !important;
    border-color: #c7d2fe !important;
}

[data-theme="light"] .badge-secondary {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #e2e8f0 !important;
}

/* Auth Cards */
[data-theme="light"] .auth-card {
    background: #ffffff !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08) !important;
}

/* Sidebar Close Button */
[data-theme="light"] .sidebar-close-btn {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #475569 !important;
}

[data-theme="light"] .sidebar-close-btn:hover {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #dc2626 !important;
}