/* Modern Responsive CSS Design System with Dark/Light Theme Support - SDO Caloocan ICT System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* Default Light Theme Variables */
:root {
    --primary: #1e3a8a;          /* Deep DepEd Navy */
    --primary-light: #3b82f6;    /* Vibrant Blue */
    --primary-dark: #0f172a;     /* Midnight Navy */
    --secondary: #0f766e;        /* Teal */
    --accent: #f59e0b;           /* Caloocan Gold */
    --accent-hover: #d97706;
    --success: #10b981;          /* Emerald Green */
    --warning: #f59e0b;          /* Amber */
    --danger: #ef4444;           /* Coral Red */
    --info: #06b6d4;            /* Cyan */
    
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-navbar: #ffffff;
    --bg-filter: #f8fafc;
    --bg-modal: #ffffff;
    --bg-input: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-light: #f8fafc;
    
    --border-color: #e2e8f0;
    --table-header-bg: #f8fafc;
    --table-hover-bg: #f1f5f9;
    --badge-secondary-bg: #f1f5f9;
    --badge-secondary-text: #475569;
    
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.12);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* Custom Scrollbar Variables */
    --scrollbar-size: 9px;
    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-thumb-hover: #94a3b8;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
    --primary-dark: #f8fafc;
    --bg-main: #0f172a;          /* Deep Slate 900 */
    --bg-card: #1e293b;          /* Slate 800 */
    --bg-sidebar: #090d16;       /* Midnight Dark */
    --bg-navbar: #1e293b;
    --bg-filter: #182234;
    --bg-modal: #1e293b;
    --bg-input: #0f172a;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --border-color: #334155;
    --table-header-bg: #0f172a;
    --table-hover-bg: #334155;
    --badge-secondary-bg: #334155;
    --badge-secondary-text: #cbd5e1;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);

    /* Dark Custom Scrollbar Variables */
    --scrollbar-track: #0f172a;
    --scrollbar-thumb: #334155;
    --scrollbar-thumb-hover: #475569;
}

/* Base Universal Reset & Custom Scrollbar Setup */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    overflow-x: auto;
    overflow-y: auto;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* Firefox scrollbar standard */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* WebKit Scrollbars (Chrome, Edge, Safari, Opera) */
::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 6px;
    border: 2px solid var(--scrollbar-track);
    transition: background 0.2s ease;
}

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

::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

a:hover {
    color: var(--primary-light);
    opacity: 0.9;
}

/* Layout Wrapper */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
    box-shadow: 4px 0 20px rgba(0,0,0,0.2);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent) 0%, #d97706 100%);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
    overflow: hidden;
}

.sidebar-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    display: block;
}

.sidebar-brand-text h2 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #ffffff;
    line-height: 1.2;
}

.sidebar-brand-text p {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    padding: 20px 14px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    padding: 12px 14px 6px 14px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: #94a3b8;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-light) 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-link i {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.user-info {
    flex: 1;
    margin-left: 12px;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.logout-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Main Content Area */
.main-wrapper {
    margin-left: 280px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: calc(100% - 280px);
    overflow-x: auto;
    overflow-y: visible;
}

/* Sidebar Backdrop for Mobile/Tablet Off-Canvas */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    z-index: 95;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* Top Navbar */
.top-navbar {
    min-height: 70px;
    height: auto;
    background: var(--bg-navbar);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 22px;
    color: var(--text-primary);
    cursor: pointer;
}

.page-title h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.page-title p {
    font-size: 12px;
    color: var(--text-secondary);
}

.top-nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tenant-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--primary-light);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
}

.tenant-badge i {
    color: var(--primary-light);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background: var(--border-color);
    transform: scale(1.03);
}

.theme-toggle-btn i {
    font-size: 14px;
    color: var(--accent);
}

/* Content Container */
.content-body {
    padding: 32px;
    flex-grow: 1;
}

/* Cards & Grid Layout */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.metric-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.metric-icon.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.metric-icon.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.metric-icon.amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.metric-icon.purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.metric-icon.cyan { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }

.metric-info h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.metric-info p {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 4px;
}

.metric-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Modern Card Panels */
.card-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
    overflow: hidden;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    flex-wrap: wrap;
    gap: 12px;
}

.card-header-title h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header-title p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-light) 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.35);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
}

.btn-accent:hover {
    background: #d97706;
    color: #ffffff;
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--table-hover-bg);
    color: var(--text-primary);
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
}

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

/* Tables & Responsive Horizontal Scroll Container */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius-sm);
    position: relative;
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.table-responsive::-webkit-scrollbar {
    height: 9px;
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--bg-filter);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 6px;
    border: 2px solid var(--bg-filter);
}

[data-theme="dark"] .table-responsive::-webkit-scrollbar-thumb {
    background: #475569;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

.custom-table {
    min-width: 820px;
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.custom-table th {
    background: var(--table-header-bg);
    padding: 14px 20px;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.custom-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: var(--transition);
}

.custom-table tbody tr:hover {
    background: var(--table-hover-bg);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.badge-success { background: rgba(16, 185, 129, 0.18); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.18); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.18); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info { background: rgba(6, 182, 212, 0.18); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-secondary { background: var(--badge-secondary-bg); color: var(--badge-secondary-text); border: 1px solid var(--border-color); }

/* Readiness Index Pills */
.readiness-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.readiness-high { background: rgba(16, 185, 129, 0.18); color: #10b981; border: 1px solid #10b981; }
.readiness-mid { background: rgba(245, 158, 11, 0.18); color: #f59e0b; border: 1px solid #f59e0b; }
.readiness-low { background: rgba(239, 68, 68, 0.18); color: #ef4444; border: 1px solid #ef4444; }

/* Filters & Search Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-filter);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.search-input-wrap {
    position: relative;
    flex-grow: 1;
    min-width: 240px;
}

.search-input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: var(--transition);
}

.search-input-wrap .form-control {
    padding-left: 38px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-group .form-text {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: var(--transition);
    color: var(--text-primary);
    position: relative;
    margin: auto;
}

.modal-dialog > form {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 90vh;
    min-height: 0;
    overflow: hidden;
}

.modal-overlay.active .modal-dialog {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 24px;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-filter);
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.alert-danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.alert-info { background: rgba(6, 182, 212, 0.15); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.3); }

/* Update Account Profile Tabbed Modal Styles */
.modal-header-profile {
    background: #0f172a;
    color: #ffffff;
    padding: 16px 20px;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    font-size: 16px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.pill-badge-gold {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-modal-summary-banner {
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar-wrapper-relative {
    position: relative;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
}

.status-dot-active {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 13px;
    height: 13px;
    background: #10b981;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.modal-nav-tabs {
    display: flex;
    background: var(--bg-filter);
    padding: 5px;
    border-radius: 10px;
    gap: 6px;
    margin: 16px 20px 0 20px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
    scrollbar-width: thin;
}

.modal-nav-tabs::-webkit-scrollbar {
    height: 4px;
}

.modal-nav-tabs::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.modal-tab-btn {
    flex: 1 0 auto;
    white-space: nowrap;
    padding: 9px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    border-radius: 7px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.modal-tab-btn.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.preset-avatar-item {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    object-fit: cover;
    background: var(--bg-filter);
}

.preset-avatar-item:hover {
    transform: scale(1.12);
}

.preset-avatar-item.active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

.privilege-callout-card {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
}

[data-theme="dark"] .modal-header-profile {
    background: #0b0f19;
}

[data-theme="dark"] .privilege-callout-card {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.35);
}

/* Station Equipment Inventory Custom GUI Styles */
.property-sticker-badge {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 12px;
    display: inline-block;
}

[data-theme="dark"] .property-sticker-badge {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.4);
}

.category-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.category-mini-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    transition: var(--transition);
}

.category-mini-card:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
}

.category-mini-card h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-mini-card .count-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.status-badge-working {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge-repair {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge-condemnation {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Station Connectivity & Allocations Custom GUI Styles */
.station-allocated-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 14px;
    margin-top: 12px;
}

[data-theme="dark"] .station-allocated-box {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
}

.station-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.station-checkbox-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-card);
}

.station-checkbox-item:hover {
    border-color: #2563eb;
}

.station-checkbox-item.active {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
}

.primary-gateway-card {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 16px;
    margin-top: 14px;
}

[data-theme="dark"] .primary-gateway-card {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.25);
}

/* Coordinators Directory & Quick Password Reset Custom GUI Styles */
.btn-purple {
    background: #8b5cf6;
    color: #ffffff;
    border: none;
    font-weight: 700;
    border-radius: 8px;
    padding: 10px 18px;
    transition: var(--transition);
}

.btn-purple:hover {
    background: #7c3aed;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.btn-pass-key {
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.35);
    background: rgba(217, 119, 6, 0.08);
    font-weight: 700;
    font-size: 12px;
    border-radius: 6px;
    padding: 5px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-pass-key:hover {
    background: #d97706;
    color: #ffffff;
    border-color: #d97706;
}

.btn-save-pass {
    background: #d97706;
    color: #ffffff;
    font-weight: 700;
    border-radius: 20px;
    padding: 10px 24px;
    border: none;
    transition: var(--transition);
}

.btn-save-pass:hover {
    background: #b45309;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE SYSTEM & SCROLLBAR OVERFLOW HANDLING
   ========================================================================== */

/* 1. Large Tablets & Small Laptops (<= 1200px) */
@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }
}

/* 2. Tablets & Mobile Drawer Transition (<= 992px) */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 35px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(3px);
        z-index: 1040;
        opacity: 0;
        transition: opacity 0.25s ease;
    }
    
    .sidebar-backdrop.active {
        display: block;
        opacity: 1;
    }
    
    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw;
        min-width: 0;
        overflow-x: auto;
    }
    
    .mobile-toggle {
        display: inline-flex !important;
    }
    
    .top-navbar {
        padding: 12px 20px;
    }
    
    .content-body {
        padding: 22px 18px;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 14px;
        margin-bottom: 22px;
    }
}

/* 3. Small Tablets & Phablets (<= 768px) */
@media (max-width: 768px) {
    .top-navbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        height: auto;
        min-height: unset;
        padding: 12px 16px;
    }
    
    .top-navbar .top-nav-left {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .top-navbar .top-nav-actions {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .top-navbar .page-title h1 {
        font-size: 15px !important;
    }

    .top-navbar .page-title p {
        font-size: 11px !important;
    }
    
    .content-body {
        padding: 18px 14px;
    }
    
    /* Filter Bar Responsive Stacking */
    .filter-bar {
        padding: 14px 16px;
        gap: 10px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar .search-input-wrap {
        width: 100%;
        min-width: 100%;
    }
    
    .filter-bar select,
    .filter-bar .form-control,
    .filter-bar .btn {
        width: 100%;
    }
    
    .filter-bar > div:not(.search-input-wrap) {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .filter-bar > div:not(.search-input-wrap) select,
    .filter-bar > div:not(.search-input-wrap) .btn {
        flex: 1 1 100%;
    }
    
    /* Card Headers & Action Buttons */
    .card-header {
        padding: 16px 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .card-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
    }
    
    .card-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
    }
    
    /* Modals Vertical & Horizontal Adaptation */
    .modal-overlay {
        padding: 12px;
        align-items: center;
    }
    
    .modal-dialog {
        max-width: 100% !important;
        max-height: 94vh;
        border-radius: 12px;
    }
    
    .modal-dialog > form {
        max-height: 94vh;
    }
    
    .modal-header,
    .modal-header-profile {
        padding: 14px 18px;
    }
    
    .modal-body {
        padding: 18px 16px;
    }
    
    .modal-footer {
        padding: 14px 16px;
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-nav-tabs {
        margin: 12px 16px 0 16px;
    }
    
    /* Collapse Inline Multi-Column Grids on Mobile */
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: repeat(2"],
    [style*="grid-template-columns:repeat(2"],
    .modal-body [style*="grid-template-columns"],
    .card-panel [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    /* Pagination Controls */
    .pagination-bar,
    .pagination-controls,
    .pagination {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        width: 100%;
    }
    
    .pagination .page-link,
    .pagination .btn {
        min-height: 38px;
        padding: 6px 12px;
    }
}

/* 4. Small Mobile Phones (<= 576px) */
@media (max-width: 576px) {
    .content-body {
        padding: 14px 10px;
    }
    
    .top-navbar {
        padding: 10px 12px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 18px;
    }
    
    .metric-card {
        padding: 16px;
        gap: 14px;
    }
    
    .metric-icon {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }
    
    .metric-info h3 {
        font-size: 20px;
    }
    
    .modal-header h3,
    .modal-header-profile h3,
    .modal-header-title-wrap h3 {
        font-size: 15px !important;
    }
    
    .modal-header-icon-badge {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .user-modal-summary-banner {
        padding: 12px 14px;
        gap: 10px;
    }
    
    .avatar-wrapper-relative,
    .avatar-wrapper-relative .user-avatar {
        width: 40px !important;
        height: 40px !important;
        font-size: 14px !important;
    }
    
    .modal-tab-btn {
        font-size: 12px;
        padding: 7px 10px;
    }
    
    .category-breakdown-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .station-checkbox-grid {
        grid-template-columns: 1fr;
    }
}
