/* assets/css/style.css */
/* Premium Crisp Design System - SITI LCO Operations & Tracking System */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Default Light Theme (Crisp, Bright, Highly Visible) */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --border-color: #e2e8f0;
    --border-glow: #cbd5e1;
    --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    /* Theme colors */
    --primary: #2563eb; /* Royal Blue */
    --primary-glow: rgba(37, 99, 235, 0.08);
    --success: #059669; /* Emerald Green */
    --warning: #d97706; /* Amber */
    --error: #dc2626; /* Red */
    --gold: #d97706;
    --blue-accent: #0284c7;
    
    /* Traffic Lights */
    --color-yellow: #d97706;
    --color-blue: #0284c7;
    --color-green: #059669;
    --color-gold: #d97706;
    --color-red: #dc2626;

    --sidebar-bg: #ffffff;
    --header-bg: #ffffff;
    --input-bg: #ffffff;
    --table-header-bg: #f1f5f9;
}

[data-theme="dark"] {
    /* Dark Theme Option */
    --bg-body: #0b0f19;
    --bg-card: #111827;
    --bg-card-hover: #1f2937;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(255, 255, 255, 0.2);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --text-primary: #f8fafc;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --gold: #f59e0b;
    --blue-accent: #06b6d4;
    
    --color-yellow: #f59e0b;
    --color-blue: #06b6d4;
    --color-green: #10b981;
    --color-gold: #fbbf24;
    --color-red: #ef4444;

    --sidebar-bg: #0f172a;
    --header-bg: #0f172a;
    --input-bg: rgba(255, 255, 255, 0.05);
    --table-header-bg: rgba(255, 255, 255, 0.03);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Glass & Card Containers */
.glass {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-interactive {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-interactive:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -3px rgba(15, 23, 42, 0.1);
}

/* Main Layout Shell */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar Styling */
aside {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
    padding: 0 4px;
}

.logo-section img {
    height: 48px;
    object-fit: contain;
}

.logo-section span {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-links li a:hover {
    color: var(--primary);
    background: var(--primary-glow);
}

.nav-links li.active a {
    color: var(--primary);
    background: var(--primary-glow);
    font-weight: 600;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.user-profile-menu {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--blue-accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
}

.user-info {
    flex-grow: 1;
    overflow: hidden;
}

.user-info .profile-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-info .profile-role {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.logout-btn:hover {
    color: var(--error);
}

/* Header & Search */
main {
    padding: 32px;
    overflow-y: auto;
    min-width: 0;
    overflow-x: hidden;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    gap: 20px;
}

.search-container {
    position: relative;
    width: 400px;
}

.search-container input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-container input::placeholder {
    color: var(--text-muted);
}

.search-container input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

.search-container svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--card-shadow);
}

.theme-toggle-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    transform: scale(1.05);
}

/* Dashboard KPIs Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.kpi-card-clickable {
    cursor: pointer;
    user-select: none;
}

.kpi-card-clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.06);
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
}

.kpi-card-clickable:active {
    transform: translateY(-1px) scale(0.98);
}

.kpi-card-clickable .kpi-arrow-indicator {
    position: absolute;
    top: 18px;
    right: 18px;
    opacity: 0.35;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.kpi-card-clickable:hover .kpi-arrow-indicator {
    opacity: 1;
    color: var(--primary);
    transform: translateX(3px);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.kpi-card.yellow::before { background: var(--color-yellow); }
.kpi-card.blue::before { background: var(--color-blue); }
.kpi-card.green::before { background: var(--color-green); }
.kpi-card.gold::before { background: var(--color-gold); }
.kpi-card.red::before { background: var(--color-red); }

.kpi-title {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
}

.kpi-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Grid layout for Dashboard Content */
.dashboard-content-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* Tables and Lists styling */
.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.card-title-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.card-title-actions input {
    min-width: 240px;
    padding: 10px 14px;
    font-size: 13.5px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
}

.card-title-actions select {
    padding: 10px 14px;
    font-size: 13.5px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
}

.card-title-actions .btn {
    padding: 10px 20px;
    font-size: 13.5px;
    white-space: nowrap;
    border-radius: 10px;
}

.connection-type-selector {
    background: var(--primary-glow);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 22px;
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.connection-type-selector label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 0;
}

.connection-type-selector input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
}

.search-picker-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    width: 100%;
}

.search-picker-row input {
    flex: 1 1 auto;
    min-width: 0;
}

.search-picker-row button {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 18px;
    font-size: 13px;
}

.modal-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.modal-form-actions .btn {
    padding: 11px 22px;
    font-size: 14px;
}

.commission-banner-card {
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    gap: 16px;
}

.modal-grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    font-size: 13px;
}

.data-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: var(--bg-card);
}

th {
    padding: 14px 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--table-header-bg);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 16px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

tr:hover td {
    background: var(--primary-glow);
}

/* Traffic Light Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.yellow {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.25);
}
.status-badge.yellow::before { background: #d97706; }

.status-badge.blue {
    background: rgba(2, 132, 199, 0.12);
    color: #0369a1;
    border: 1px solid rgba(2, 132, 199, 0.25);
}
.status-badge.blue::before { background: #0284c7; }

.status-badge.green {
    background: rgba(5, 150, 105, 0.12);
    color: #047857;
    border: 1px solid rgba(5, 150, 105, 0.25);
}
.status-badge.green::before { background: #059669; }

.status-badge.gold {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.25);
}
.status-badge.gold::before { background: #d97706; }

.status-badge.red {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.25);
}
.status-badge.red::before { background: #dc2626; }

.status-badge.orange {
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
    border: 1px solid rgba(249, 115, 22, 0.25);
}
.status-badge.orange::before { background: #f97316; }

/* Dark mode badge contrast overrides */
[data-theme="dark"] .status-badge.yellow { color: #fbbf24; }
[data-theme="dark"] .status-badge.blue { color: #38bdf8; }
[data-theme="dark"] .status-badge.green { color: #34d399; }
[data-theme="dark"] .status-badge.gold { color: #fbbf24; }
[data-theme="dark"] .status-badge.red { color: #f87171; }
[data-theme="dark"] .status-badge.orange { color: #fdba74; }

/* Forms input fields */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: span 2;
}

label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

input, select, textarea {
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
}

.btn-danger {
    background: var(--error);
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Timeline */
.timeline-flow {
    position: relative;
    padding-left: 24px;
    margin-top: 16px;
    border-left: 2px solid var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.activity-feed-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.activity-info {
    font-size: 13px;
    color: var(--text-primary);
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Responsive Web App Layout Rules */

/* Desktop Display (Screen width > 768px) */
@media (min-width: 769px) {
    .mobile-app-header,
    .mobile-nav-bar,
    #mobile-search-container {
        display: none !important;
    }

    header.desktop-header {
        display: flex !important;
    }

    aside.desktop-sidebar {
        display: flex !important;
    }
}

/* Mobile Display (Screen width <= 768px) */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        padding-bottom: 84px; /* Space for bottom nav */
    }

    aside.desktop-sidebar,
    header.desktop-header {
        display: none !important; /* Hide desktop elements on mobile */
    }

    main {
        padding: 16px;
        padding-top: 76px; /* Space for mobile top app bar */
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Mobile Top App Header */
    .mobile-app-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: var(--header-bg);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--card-shadow);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        z-index: 90;
        transition: background-color 0.3s ease;
    }

    .mobile-header-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        color: var(--text-primary);
        font-family: 'Outfit', sans-serif;
        font-weight: 700;
        font-size: 18px;
    }

    .mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-header-btn {
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        width: 38px;
        height: 38px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        position: relative;
        transition: all 0.2s ease;
    }

    .mobile-header-btn:active {
        transform: scale(0.92);
        background: var(--primary-glow);
    }

    .search-container {
        width: 100%;
        margin-bottom: 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    /* Modern Bottom Mobile Navigation Bar */
    .mobile-nav-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 68px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--header-bg);
        border-top: 1px solid var(--border-color);
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;
        justify-items: center;
        z-index: 100;
        box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
        transition: background-color 0.3s ease;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 10px;
        font-weight: 600;
        gap: 3px;
        width: 100%;
        height: 100%;
        position: relative;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-item i {
        font-size: 20px;
        transition: transform 0.2s ease;
    }

    .mobile-nav-item:active {
        transform: scale(0.9);
    }

    .mobile-nav-item.active {
        color: var(--primary);
    }

    .mobile-nav-item.active i {
        transform: translateY(-2px);
    }

    .mobile-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        width: 24px;
        height: 3px;
        background: var(--primary);
        border-radius: 0 0 4px 4px;
        box-shadow: 0 2px 8px var(--primary-glow);
    }

    /* Floating Action Button (Center FAB) */
    .mobile-fab-item {
        position: relative;
        top: -14px;
    }

    .mobile-fab-btn {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 4px solid var(--bg-body);
        box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
        cursor: pointer;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-fab-btn:active {
        transform: scale(0.88);
        box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
    }
    /* Mobile Registration & Modal Overrides */
    .public-reg-container {
        padding: 12px 10px !important;
        min-height: auto !important;
    }

    .public-reg-card {
        padding: 16px !important;
        border-radius: 14px !important;
    }

    .card-title-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 14px !important;
    }

    .card-title-actions {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .card-title-actions input,
    .card-title-actions select,
    .card-title-actions button {
        width: 100% !important;
        max-width: 100% !important;
    }

    .commission-banner-card {
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: left !important;
        gap: 14px !important;
    }

    .commission-banner-card button {
        width: 100% !important;
        justify-content: center !important;
    }

    .modal-grid-layout,
    .modal-info-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    .modal-info-grid > div[style*="grid-column: span 2"] {
        grid-column: span 1 !important;
    }

    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-height: 92vh !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        border-bottom: none !important;
        margin: 0 !important;
    }

    .modal-header {
        padding: 16px !important;
    }

    .modal-body {
        padding: 16px 14px 28px 14px !important;
    }

    .modal-form-actions {
        flex-direction: column-reverse !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .modal-form-actions .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    .connection-type-selector {
        padding: 12px 14px !important;
        gap: 12px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .search-picker-row {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .search-picker-row input {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .search-picker-row button {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        padding: 10px 14px !important;
        font-size: 12.5px !important;
    }

    /* Force mobile 1-column stack for all multi-column layouts across pages & modals */
    .dashboard-content-layout,
    .form-grid,
    .modal-content .dashboard-content-layout,
    .modal-content .form-grid,
    .modal-content div[style*="grid-template-columns"],
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns:1fr 1fr"],
    div[style*="grid-template-columns: 2fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        gap: 14px !important;
    }

    .form-group.full-width,
    .modal-content .form-group.full-width,
    div[style*="grid-column: span 2"],
    div[style*="grid-column:span 2"] {
        grid-column: span 1 !important;
        width: 100% !important;
    }
}

/* Mobile Side Drawer Navigation Sheet */
.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    z-index: 201;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(15, 23, 42, 0.15);
}

.mobile-drawer-overlay.open .mobile-drawer {
    right: 0;
}

.mobile-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.mobile-drawer-close {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-drawer-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.mobile-drawer-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-drawer-nav li.active a, .mobile-drawer-nav li a:hover {
    color: var(--primary);
    background: var(--primary-glow);
    font-weight: 600;
}

/* Quick Action Bottom Sheet */
.action-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.action-sheet-overlay.open {
    opacity: 1;
    visibility: visible;
}

.action-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-radius: 24px 24px 0 0;
    padding: 24px 20px 36px 20px;
    z-index: 301;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.15);
}

.action-sheet-overlay.open .action-sheet {
    bottom: 0;
}

.action-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-glow);
    border-radius: 2px;
    margin: 0 auto 16px auto;
}

.action-sheet-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
    color: var(--text-primary);
}

.action-sheet-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.action-sheet-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-sheet-item i {
    font-size: 24px;
    color: var(--primary);
}

.action-sheet-item:active {
    background: var(--primary-glow);
    border-color: var(--primary);
    transform: scale(0.96);
}

/* Modals System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    color: var(--text-primary);
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg-card);
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.close-modal-btn {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.2s ease;
    outline: none;
}

.close-modal-btn:hover, .close-modal-btn:active {
    background: var(--error);
    color: #ffffff;
    border-color: var(--error);
    transform: scale(1.05);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
    -webkit-overflow-scrolling: touch;
}

/* =========================================================
   SETTINGS & SYSTEM CONSTANTS RESPONSIVE LAYOUT
========================================================= */
.settings-container-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.settings-card {
    padding: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.settings-full-span {
    grid-column: 1 / -1;
    width: 100%;
}

.setting-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.setting-card-header h3 {
    margin: 0;
    font-size: 16px;
}

.setting-item-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.setting-item-row:last-child {
    border-bottom: none;
}

.setting-item-info {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.setting-item-info strong {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    word-break: break-word;
}

.setting-item-info p {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.4;
    word-break: break-word;
}

.setting-item-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.setting-item-controls input,
.setting-item-controls select {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
    box-sizing: border-box;
}

.setting-item-controls button {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 12px;
}

.setting-card-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.setting-card-footer .btn {
    white-space: nowrap;
    max-width: 100%;
}

@media (max-width: 992px) {
    .settings-container-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }

    .settings-full-span {
        grid-column: 1 !important;
    }

    .settings-card {
        padding: 18px !important;
    }
}

@media (max-width: 768px) {
    .settings-card {
        padding: 16px !important;
    }

    .setting-card-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .setting-card-header button {
        width: 100% !important;
        justify-content: center !important;
    }

    .setting-card-footer {
        flex-direction: column !important;
        width: 100% !important;
    }

    .setting-card-footer .btn {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 12px 16px !important;
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }
}

/* ==========================================
   ENTERPRISE DESIGN SYSTEM EXTENSIONS
   ========================================== */

/* Notification Bell Dot & Dropdown */
.notifications-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notification-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--bg-card, #ffffff);
    pointer-events: none;
    display: inline-block;
    animation: notifPulse 2s infinite;
}

@keyframes notifPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}
.toast {
    min-width: 320px;
    max-width: 450px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.3s ease;
}
.toast.hide {
    animation: toastSlideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}
.toast-content {
    flex-grow: 1;
}
.toast-title {
    font-weight: 700;
    margin-bottom: 2px;
}
.toast-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}
.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}
.toast-close:hover {
    color: var(--text-primary);
}

/* Toast Themes */
.toast.success { border-left: 4px solid var(--success); }
.toast.success .toast-icon { color: var(--success); }
.toast.error { border-left: 4px solid var(--error); }
.toast.error .toast-icon { color: var(--error); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info { border-left: 4px solid var(--primary); }
.toast.info .toast-icon { color: var(--primary); }

@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

/* Custom Confirm Dialog */
.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    animation: fadeIn 0.2s ease-out;
}
.confirm-modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 480px;
    padding: 24px;
    animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.confirm-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.confirm-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.confirm-modal-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}
.confirm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.confirm-btn-yes {
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.confirm-btn-yes:hover {
    background: #1d4ed8;
}
.confirm-btn-no {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.confirm-btn-no:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Skeleton Loader Animation */
.skeleton-pulse {
    background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-card-hover) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: 4px;
    display: inline-block;
    height: 16px;
    margin-bottom: 4px;
}
@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty State Card */
.empty-state-card {
    text-align: center;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px dashed var(--border-glow);
    border-radius: 16px;
    margin: 20px 0;
    box-sizing: border-box;
}
.empty-state-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    opacity: 0.6;
}
.empty-state-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.empty-state-desc {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 360px;
    margin: 0;
    line-height: 1.5;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}



