/* ==========================================================================
   CTNR-2 Design System & Custom CSS
   Theme: Modern Executive Light
   ========================================================================== */

:root {
    /* Color Palette - Premium Tinted Blue */
    --bg-body: #f0f6fc;          /* Soft ice blue background */
    --bg-main: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-glass-active: rgba(230, 240, 250, 0.9);
    --bg-input: #ffffff;
    
    --border-color: rgba(37, 99, 235, 0.09); /* Soft blue tinted border */
    --border-hover: rgba(37, 99, 235, 0.18);
    --border-accent: rgba(37, 99, 235, 0.35);
    
    /* Text Colors - Pure Tinted Slate-Blue */
    --text-primary: #0f1e36;     /* Deep slate-blue */
    --text-secondary: #2b4c7e;   /* Slate-blue */
    --text-muted: #60a5fa;       /* Sky-blue */
    
    /* Premium Accents */
    --primary: #2563eb;          /* Royal Blue */
    --primary-rgb: 37, 99, 235;
    --primary-hover: #1d4ed8;
    --secondary: #7c3aed;        /* Violet */
    --secondary-rgb: 124, 58, 237;
    
    /* Status Colors */
    --success: #059669;          /* Emerald Green */
    --success-rgb: 5, 150, 105;
    --warning: #d97706;          /* Amber */
    --warning-rgb: 217, 119, 6;
    --danger: #dc2626;           /* Red */
    --danger-rgb: 220, 38, 38;
    --info: #2563eb;
    --info-rgb: 37, 99, 235;
    
    /* Shadows & Blur */
    --glass-blur: blur(12px);
    --box-shadow: 0 10px 30px -10px rgba(37, 99, 235, 0.06), 0 1px 3px rgba(37, 99, 235, 0.02);
    --glow-shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
    
    /* Border Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

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

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    letter-spacing: -0.01em;
}

code, pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

/* Scrollbars styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* ==========================================================================
   Layout Structures (Sidebar & Content)
   ========================================================================== */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-body);
}

/* Sidebar Styling */
.sidebar {
    background: #ffffff;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    padding: 0 8px;
}

.brand-logo {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.brand-logo i {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.brand-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

.brand-text span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    font-weight: 600;
}

/* Connection Status Badge */
.connection-status {
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    position: relative;
}

.status-indicator.connected {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-indicator.connected::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--success);
    animation: pulse 1.8s infinite;
}

.status-indicator.disconnected {
    background-color: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

.status-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.status-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.status-host {
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Nav */
.sidebar-nav {
    flex-grow: 1;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin: 24px 8px 12px;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.nav-item i {
    width: 18px;
    height: 18px;
    transition: var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.01);
}

.nav-item.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.06);
    border-color: rgba(37, 99, 235, 0.08);
}

.nav-item.active i {
    stroke: var(--primary);
    filter: drop-shadow(0 1px 2px rgba(37, 99, 235, 0.2));
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.db-schema-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.db-schema-info i {
    width: 14px;
    height: 14px;
}

/* Content Container Layout */
.content-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.top-bar {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: var(--glass-blur);
    z-index: 10;
}

.page-title-area h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.page-title-area p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

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

.sys-clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sys-clock i {
    width: 14px;
    height: 14px;
}

.view-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 32px;
}

/* ==========================================================================
   Overlay Interfaces (Connection Gate & Loaders)
   ========================================================================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-normal);
}

.loader-content {
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(37, 99, 235, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

/* Connection Gate Card */
.gate-card {
    width: 460px;
    padding: 40px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.15);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.icon-glow {
    background: rgba(37, 99, 235, 0.06);
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(37, 99, 235, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.icon-glow i {
    width: 28px;
    height: 28px;
}

.gate-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.gate-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.gate-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.inline-icon {
    width: 12px;
    height: 12px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}

/* ==========================================================================
   UI Components (Cards, Buttons, Inputs, Tables)
   ========================================================================== */

/* Glass Panels */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel:hover {
    border-color: var(--border-hover);
}

.glass-panel.interactive:hover {
    border-color: var(--border-accent);
    box-shadow: var(--glow-shadow), var(--box-shadow);
    transform: translateY(-2px);
}

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

.panel-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.panel-header h3 i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.panel-body {
    padding: 24px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: rgba(15, 23, 42, 0.08);
    border-color: var(--border-hover);
}

.btn-danger {
    background: rgba(220, 38, 38, 0.06);
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.15);
}

.btn-danger:hover {
    background: rgba(220, 38, 38, 0.12);
    border-color: var(--danger);
}

.btn-full {
    width: 100%;
}

.icon-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.icon-button:hover {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.06);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
}

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px 12px 42px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

/* Add select fields specific styling */
.input-wrapper select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
}

.input-wrapper input:focus,
.input-wrapper select:focus,
.input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.input-wrapper .icon-button {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
}

.input-wrapper .icon-button:hover {
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Error Banner */
.error-banner {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: #fca5a5;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    line-height: 1.4;
}

.error-banner i {
    width: 16px;
    height: 16px;
    stroke: var(--danger);
    flex-shrink: 0;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.badge-accent {
    background: rgba(0, 240, 255, 0.08);
    color: var(--primary);
    border-color: rgba(0, 240, 255, 0.15);
}

.badge-success {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.15);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.15);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.15);
}

/* ==========================================================================
   Dashboard Metrics & Widgets
   ========================================================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.metric-icon i {
    width: 22px;
    height: 22px;
}

.metric-card:hover .metric-icon {
    color: var(--primary);
    border-color: var(--border-accent);
    background: rgba(0, 240, 255, 0.05);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 4px;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Grid Layout Rows */
.dashboard-row {
    display: grid;
    gap: 20px;
}

.grid-2-1 {
    grid-template-columns: 2fr 1fr;
}

@media (max-width: 1024px) {
    .grid-2-1 {
        grid-template-columns: 1fr;
    }
    .app-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none; /* Add responsive mobile nav toggle in real practice */
    }
}

.map-card {
    height: 480px;
    display: flex;
    flex-direction: column;
}

.map-body {
    padding: 0;
    flex-grow: 1;
    position: relative;
}

#network-map {
    height: 100%;
    width: 100%;
    z-index: 1;
}

/* Light Theme Leaflet Customization */
.leaflet-container {
    background: #f1f5f9 !important;
}

.leaflet-tile-pane {
    filter: none !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #ffffff !important;
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

.leaflet-popup-content {
    font-family: 'Outfit', sans-serif !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    margin: 12px 16px 12px 12px !important;
}

.leaflet-popup-close-button {
    color: var(--text-secondary) !important;
}

/* Progress bar logs */
.progress-bar-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 500;
}

.progress-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1s ease-out;
}

.progress-fill.primary { background: var(--primary); box-shadow: 0 0 8px var(--primary); }
.progress-fill.secondary { background: var(--secondary); box-shadow: 0 0 8px var(--secondary); }
.progress-fill.success { background: var(--success); box-shadow: 0 0 8px var(--success); }

/* Compact alerts list */
.recent-alerts-section {
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.recent-alerts-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.compact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.compact-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-fast);
}

.compact-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
}

.compact-item-info {
    display: flex;
    flex-direction: column;
}

.compact-item-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.compact-item-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Site Explorer Module (Tabbed Profiles)
   ========================================================================== */
.explorer-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    height: calc(100vh - 120px); /* Lock height exactly to view content */
    overflow: hidden;
}

.explorer-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    overflow: hidden;
}

.search-box {
    margin-bottom: 4px;
}

.site-list-container {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.site-list-item {
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.site-list-item:hover {
    background: rgba(15, 23, 42, 0.05);
    border-color: var(--border-hover);
}

.site-list-item.active {
    background: rgba(37, 99, 235, 0.05);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.site-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.site-item-id {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}

.site-item-coords {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Site Details Panel */
.site-details-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.site-profile-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.site-title h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.site-title .site-id-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--primary);
    background: rgba(0, 240, 255, 0.08);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-left: 8px;
    font-weight: 600;
}

.site-meta-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-profile-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.profile-tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.profile-tab-btn:hover {
    color: var(--text-primary);
}

.profile-tab-btn.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
    box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.05);
}

.site-tab-content-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Tab Cards */
.sub-data-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.sub-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sub-card-title i {
    width: 16px;
    height: 16px;
    color: var(--secondary);
}

.data-property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px 24px;
}

.data-prop {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prop-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.prop-val {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.prop-val.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

/* Empty placeholder */
.empty-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-align: center;
    padding: 40px;
}

.empty-placeholder i {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
    stroke-width: 1.5;
}

.empty-placeholder h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.empty-placeholder p {
    font-size: 0.8rem;
    max-width: 320px;
    line-height: 1.4;
}

/* ==========================================================================
   Tabular Direct Editor (DataTables Module)
   ========================================================================== */
.table-selector-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.table-select-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-select-wrapper span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 320px;
    background: var(--bg-input);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--radius-md);
    padding: 0 12px;
    height: 38px;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.03);
    gap: 8px;
}

.search-input-wrapper .search-icon {
    color: var(--text-secondary);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.search-input-wrapper input {
    flex-grow: 1;
    width: 100%;
    min-width: 0;
    background: transparent !important;
    border: none !important;
    padding: 6px 0;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    outline: none !important;
    box-shadow: none !important;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), var(--glow-shadow);
}

.search-input-wrapper:focus-within .search-icon {
    color: var(--primary);
}

.search-clear-btn {
    background: none;
    border: none;
    padding: 2px;
    margin: 0;
    cursor: pointer;
    color: var(--text-secondary);
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.search-clear-btn:hover {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.06);
    opacity: 1;
}

.search-clear-btn i {
    width: 14px;
    height: 14px;
}

.search-shortcut-badge {
    font-family: 'Outfit', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.1);
    padding: 3px 6px;
    border-radius: 4px;
    pointer-events: none;
    line-height: 1;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.search-input-wrapper:focus-within .search-shortcut-badge {
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.2);
    background: rgba(37, 99, 235, 0.1);
}

/* Custom Grid Table design */
.grid-table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.01);
    max-height: calc(100vh - 280px);
}

.db-grid-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.db-grid-table th {
    background: rgba(241, 245, 249, 0.95);
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.db-grid-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.db-grid-table tr:hover td {
    background: rgba(15, 23, 42, 0.02);
}

.db-grid-table tr.row-selected td {
    background: rgba(37, 99, 235, 0.05);
}

.cell-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

/* ==========================================================================
   Modals & Drawers
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 7, 12, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-card {
    width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--box-shadow);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
}

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

/* Toast System */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 99999;
}

.toast {
    background: rgba(12, 17, 30, 0.9);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--box-shadow);
    color: var(--text-primary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.success i { color: var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.error i { color: var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.warning i { color: var(--warning); }

/* Settings Layout */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.settings-card-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(0.95); opacity: 0; }
}

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

@keyframes toastSlideIn {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Desktop Only Blocker Screen Overlay */
#desktop-only-overlay {
    display: none !important;
}

@media (max-width: 1023px) {
    #desktop-only-overlay {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-body) !important;
        z-index: 100000 !important;
        align-items: center;
        justify-content: center;
    }
    
    /* Hide everything else */
    #app-shell, #connection-gate, #loading-overlay {
        display: none !important;
    }
}


