/* El Operador - Dashboard Styles */
/* Read-only, sober, observation-focused */

:root {
    /* Premium Dark Theme Palette */
    --bg-primary: #050505;
    /* Deepest black */
    --bg-secondary: #0d0d0d;
    /* Slightly lighter for sidebar/headers */
    --bg-card: #141414;
    /* Card background */
    --bg-hover: #1f1f1f;
    /* Hover state */

    --bg-glass: rgba(20, 20, 20, 0.7);
    /* For glassmorphism */
    --backdrop-blur: 12px;

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: rgba(255, 255, 255, 0.15);

    --text-primary: #ededed;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-dim: #52525b;

    /* Pro-Grade Vivid Accents (P3 Gamut inspired) */
    --accent-blue: #0A84FF;
    /* iOS Blue */
    --accent-purple: #BF5AF2;
    /* iOS Purple */
    --accent-green: #30D158;
    /* iOS Green */
    --accent-amber: #FF9F0A;
    /* iOS Orange */
    --accent-red: #FF453A;
    /* iOS Red */

    --gradient-blue: linear-gradient(135deg, #007aff, #0055ff);
    --gradient-card: linear-gradient(180deg, rgba(30, 30, 30, 0.4) 0%, rgba(20, 20, 20, 0.6) 100%);

    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    /* Cleaner main font */

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(10, 132, 255, 0.15);
    --shadow-btn: 0 4px 12px rgba(0, 0, 0, 0.2);

    --overlay-bg: rgba(0, 0, 0, 0.85);
}

/* Pro Buttons */
.btn-primary {
    background: var(--gradient-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-btn);
    letter-spacing: 0.3px;
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(10, 132, 255, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-secondary);
    color: #fff;
    transform: translateY(-1px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    /* Switched to clear sans */
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    /* Prevent horizontal body shake */
    -webkit-font-smoothing: antialiased;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* --- MAIN LAYOUT STRUCTURE --- */
.app-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border-subtle);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-content {
    padding: 32px;
    height: 100vh;
    overflow-y: auto;
    background: var(--bg-primary);
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.agent-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-blue), #1e3a8a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-glow);
}

.agent-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.agent-version {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 0 0 8px currentColor;
    animation: pulse 3s ease-in-out infinite;
}

.status-badge.alive .status-dot {
    background: var(--accent-green);
    color: var(--accent-green);
}

.status-badge.error .status-dot {
    background: var(--accent-red);
    color: var(--accent-red);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Tags */
.tags {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* Tags (Refined) */
.tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    letter-spacing: -0.2px;
    transition: all 0.2s;
}

.tag:hover {
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    background-image: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(var(--backdrop-blur));
}

.stat-card:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Panels (Glassmorphism enhanced) */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(var(--backdrop-blur));
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.panel-header h2 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.panel-subtitle {
    font-size: 10px;
    color: var(--text-muted);
}

.panel-content {
    padding: 16px 20px;
    max-height: 400px;
    /* Increased for better view */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Smoother iOS scroll */
}


/* Observation Item */
.observation-item {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border-left: 3px solid var(--accent-blue);
}

.observation-item:last-child {
    margin-bottom: 0;
}

.observation-context {
    font-size: 12px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.observation-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
}

.observation-decision {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 9px;
    text-transform: uppercase;
}

.observation-decision.accepted {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-green);
}

.observation-decision.rejected {
    background: rgba(115, 115, 115, 0.2);
    color: var(--text-muted);
}

.observation-decision.deferred {
    background: rgba(163, 163, 163, 0.1);
    color: var(--accent-amber);
}

/* Interactive Observation Styles */
.observation-item.pending {
    border-left: 3px solid var(--accent-amber);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.observation-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-action {
    flex: 1;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn-action.approve {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-action.approve:hover {
    background: #ffffff;
    color: #000000;
}

.btn-action.reject {
    background: rgba(64, 64, 64, 0.1);
    color: var(--text-muted);
    border-color: rgba(64, 64, 64, 0.2);
}

.btn-action.reject:hover {
    background: #404040;
    color: #ffffff;
}

.btn-action.defer {
    background: rgba(115, 115, 115, 0.1);
    color: var(--text-secondary);
    border-color: rgba(115, 115, 115, 0.2);
}

.btn-action.defer:hover {
    background: #737373;
    color: #ffffff;
}

/* Run Item */
.run-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.run-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.run-status.completed {
    background: var(--accent-green);
}

.run-status.pending {
    background: var(--accent-amber);
}

.run-status.failed {
    background: var(--accent-red);
}

.run-info {
    flex: 1;
}

.run-context {
    font-size: 11px;
    color: var(--text-primary);
}

.run-time {
    font-size: 10px;
    color: var(--text-muted);
}

/* Memory Panel */
.memory-panel {
    margin-bottom: 24px;
}

.memory-grid {
    padding: 20px;
}

.memory-stat {
    margin-bottom: 20px;
}

.memory-label {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.memory-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.memory-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffffff, #404040);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.memory-value {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.memory-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.mini-stat {
    text-align: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.mini-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mini-label {
    font-size: 10px;
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 12px;
}

/* Footer */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

/* Modal & Forms */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 18px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 15px;
    font-weight: 600;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.btn-close:hover {
    color: var(--text-primary);
}

.form {
    padding: 24px;
}

.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    /* Better for mobile input focus zoom */
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: var(--bg-hover);
}

.form-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}


.footer-hint {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    flex: 1;
    min-width: 300px;
}

.footer-hint p {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

.footer-hint strong {
    color: var(--text-secondary);
}

.footer-meta {
    font-size: 10px;
    color: var(--text-dim);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

/* App Layout */
.app-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border-subtle);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Navigation Menu */
.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(10, 132, 255, 0.1);
    /* Blue tint */
    color: #fff;
    border-color: rgba(10, 132, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-item.active span {
    text-shadow: 0 0 12px rgba(10, 132, 255, 0.5);
}

.main-content {
    padding: 32px;
    height: 100vh;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* Page Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

/* Data Tables */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.data-table th {
    text-align: left;
    padding: 16px 20px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.015);
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.1s;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg-hover);
    color: var(--text-primary);
}



.status-tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
    backdrop-filter: blur(4px);
}

.status-tag.pending_report {
    background: rgba(115, 115, 115, 0.15);
    color: var(--accent-amber);
}

.status-tag.reported {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.action-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.action-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Report Editor */
.report-editor {
    width: 100%;
    min-height: 300px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 20px;
    font-family: var(--font-mono);
    border-radius: var(--radius-sm);
    resize: vertical;
    font-size: 13px;
    line-height: 1.6;
}

.report-editor:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Brain Dashboard Enhancements */
.observation-item.pending {
    border-left: 3px solid var(--accent-amber);
    background: rgba(115, 115, 115, 0.05);
}

.observation-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-mini {
    padding: 4px 10px;
    font-size: 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.btn-mini:hover {
    opacity: 0.8;
}

.btn-approve {
    background: #ffffff;
    color: #000000;
}

.btn-reject {
    background: #404040;
    color: white;
}

#acceptance-bar {
    height: 100%;
    background: linear-gradient(to right, #ffffff, #404040);
    transition: width 0.5s ease;
}

.observation-decision {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-active);
    border-radius: 3px;
}


/* --- RESPONSIVE APP EXPERIENCE --- */

@media (max-width: 992px) {
    .app-layout {
        grid-template-columns: 1fr;
        padding-bottom: 70px;
        /* Space for Bottom Nav */
    }

    /* Top Bar Slim */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        z-index: 1000;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        padding: 0 20px;
        background: var(--bg-glass);
        backdrop-filter: blur(20px);
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        width: 100% !important;
    }

    .sidebar-brand {
        margin-bottom: 0;
        transform: scale(0.9);
        /* More compact */
    }

    .brand-text {
        font-size: 14px;
        letter-spacing: 0;
        font-weight: 600;
    }

    /* Floating Bottom Nav (App Style) */
    .nav-menu {
        position: fixed;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        background: rgba(20, 20, 20, 0.85);
        backdrop-filter: blur(15px);
        padding: 8px;
        border-radius: 20px;
        border: 1px solid var(--border-active);
        gap: 8px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
        z-index: 1001;
        width: calc(100% - 40px);
        max-width: 400px;
        justify-content: space-around;
        animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .nav-item {
        flex: 1;
        flex-direction: column;
        justify-content: center;
        padding: 8px 0;
        font-size: 10px;
        text-align: center;
        gap: 4px;
        border-radius: 12px;
    }

    .nav-item span {
        font-size: 20px;
    }

    .nav-item.active {
        background: rgba(10, 132, 255, 0.15);
        border-color: transparent;
    }

    .main-content {
        padding: 80px 16px 20px 16px;
        /* Space for top and bottom bars */
        height: auto;
        width: 100% !important;
    }

    /* Hide redundant items but KEEP navigation and brand */
    .sidebar>*:not(.sidebar-brand):not(.nav-menu) {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .memory-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .table-container {
        margin: 0 -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        overflow-x: auto;
    }

    .data-table {
        min-width: 600px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal {
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .sidebar {
        padding: 8px 12px;
    }

    .nav-item span {
        font-size: 16px;
    }

    .status-badge {
        display: none;
    }/* --- PREMIUM CHAT VIEW STYLES (Claude/ChatGPT Style) --- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px); /* Fill most of the screen */
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.chat-messages {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-card) 100%);
    scroll-behavior: smooth;
}

.chat-msg {
    display: flex;
    gap: 16px;
    max-width: 85%;
    animation: slideInMsg 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes slideInMsg {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot {
    align-self: flex-start;
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.bot .chat-avatar {
    background: var(--accent-purple);
    box-shadow: 0 0 10px rgba(191, 90, 242, 0.3);
}

.user .chat-avatar {
    background: var(--accent-blue);
}

.chat-bubble {
    padding: 14px 20px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.bot .chat-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    color: var(--text-primary);
    border-top-left-radius: 4px;
}

.user .chat-bubble {
    background: var(--accent-blue);
    color: white;
    border-top-right-radius: 4px;
}

.chat-msg.loading .chat-bubble {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--accent-amber);
    color: var(--accent-amber);
}

.chat-input-area {
    padding: 24px 40px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-subtle);
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid var(--border-active);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(10, 132, 255, 0.1);
    transform: translateY(-1px);
}

#mail-query-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    padding: 12px !important;
    font-size: 15px !important;
}

#mail-query-input:focus {
    box-shadow: none !important;
}

.chat-msg small {
    display: block;
    margin-top: 10px;
    opacity: 0.6;
    font-size: 11px;
}

.chat-msg code {
    background: rgba(0,0,0,0.4);
    color: var(--accent- amber);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
}
}