/* ============================================
   ML AUTO-RESPONDER — DESIGN SYSTEM
   Tema: Dark mode + Mercado Livre (Amarelo + Azul)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Variables ---- */
:root {
    --ml-yellow: #FFE600;
    --ml-yellow-dark: #e6cf00;
    --ml-blue: #3483FA;
    --ml-blue-dark: #2968c8;
    --ml-green: #00a650;
    --ml-red: #ff4444;
    --ml-orange: #ff7733;
    
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-card-hover: rgba(26, 35, 55, 0.9);
    --bg-input: rgba(255, 255, 255, 0.05);
    
    --text-primary: #f0f0f0;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 230, 0, 0.25);
    
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(255, 230, 0, 0.1);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 0%, rgba(255, 230, 0, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(52, 131, 250, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ---- Login Screen ---- */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease;
}

.login-logo {
    font-size: 56px;
    margin-bottom: 8px;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ml-yellow), var(--ml-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-card .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

.login-card .form-group {
    margin-bottom: 16px;
    text-align: left;
}

.login-card label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.login-card input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.login-card input:focus {
    outline: none;
    border-color: var(--ml-yellow);
    box-shadow: 0 0 0 3px rgba(255, 230, 0, 0.1);
}

/* ---- Layout Principal ---- */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--ml-yellow), var(--ml-blue));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sidebar-brand h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-brand small {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 8px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    user-select: none;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(255, 230, 0, 0.1);
    color: var(--ml-yellow);
}

.nav-item .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--ml-red);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

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

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--ml-blue), var(--ml-yellow));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--bg-primary);
}

.user-details {
    flex: 1;
}

.user-details .name {
    font-size: 13px;
    font-weight: 600;
}

.user-details .role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ---- Main Content ---- */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 24px 32px;
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
}

/* ---- Top Bar ---- */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-title h1 {
    font-size: 26px;
    font-weight: 700;
}

.page-title p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

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

/* ---- Agent Toggle ---- */
.agent-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 20px;
}

.agent-toggle-wrapper .label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--ml-green);
    box-shadow: 0 0 12px rgba(0, 166, 80, 0.4);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.agent-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.agent-status.online {
    background: rgba(0, 166, 80, 0.15);
    color: var(--ml-green);
}

.agent-status.offline {
    background: rgba(255, 68, 68, 0.15);
    color: var(--ml-red);
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
}

.stat-card.yellow::before { background: linear-gradient(90deg, var(--ml-yellow), #ffd000); }
.stat-card.blue::before { background: linear-gradient(90deg, var(--ml-blue), #5b9bff); }
.stat-card.green::before { background: linear-gradient(90deg, var(--ml-green), #33cc77); }
.stat-card.orange::before { background: linear-gradient(90deg, var(--ml-orange), #ff9955); }

.stat-card .stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-card .stat-icon {
    font-size: 28px;
    opacity: 0.9;
}

.stat-card .stat-trend {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.stat-card .stat-trend.up {
    background: rgba(0, 166, 80, 0.15);
    color: var(--ml-green);
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ---- Cards & Panels ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

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

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.card-header .card-actions {
    display: flex;
    gap: 8px;
}

.card-body {
    padding: 20px 24px;
}

/* ---- Sections Grid ---- */
.sections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.sections-grid.full {
    grid-template-columns: 1fr;
}

/* ---- Timeline / Activity Feed ---- */
.activity-feed {
    max-height: 500px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--glass-bg);
    margin: 0 -24px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
}

.activity-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.activity-dot.question {
    background: rgba(255, 230, 0, 0.15);
}

.activity-dot.message {
    background: rgba(52, 131, 250, 0.15);
}

.activity-dot.success {
    background: rgba(0, 166, 80, 0.15);
}

.activity-dot.error {
    background: rgba(255, 68, 68, 0.15);
}

.activity-dot.system {
    background: rgba(255, 255, 255, 0.08);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 3px;
}

.activity-desc {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---- Response Log Table ---- */
.log-table {
    width: 100%;
    border-collapse: collapse;
}

.log-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.log-table td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.log-table tr:hover td {
    background: var(--glass-bg);
}

.log-table .type-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}

.type-badge.question {
    background: rgba(255, 230, 0, 0.15);
    color: var(--ml-yellow);
}

.type-badge.message {
    background: rgba(52, 131, 250, 0.15);
    color: var(--ml-blue);
}

.status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
}

.status-badge.success {
    background: rgba(0, 166, 80, 0.15);
    color: var(--ml-green);
}

.status-badge.failed {
    background: rgba(255, 68, 68, 0.15);
    color: var(--ml-red);
}

.status-badge.pending {
    background: rgba(255, 119, 51, 0.15);
    color: var(--ml-orange);
}

.status-badge.skipped {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.truncate {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Schedule Configuration ---- */
.schedule-config {
    padding: 20px 0;
}

.day-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.day-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.day-btn:hover {
    border-color: var(--ml-yellow);
    color: var(--ml-yellow);
}

.day-btn.active {
    background: var(--ml-yellow);
    border-color: var(--ml-yellow);
    color: var(--bg-primary);
}

.time-range {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.time-range label {
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 40px;
}

.time-range input[type="time"] {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.time-range input[type="time"]:focus {
    outline: none;
    border-color: var(--ml-yellow);
}

/* ---- Settings Panel ---- */
.settings-group {
    margin-bottom: 28px;
}

.settings-group h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--ml-yellow);
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-label {
    flex: 1;
}

.setting-label .label-title {
    font-size: 14px;
    font-weight: 500;
}

.setting-label .label-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.setting-control {
    flex-shrink: 0;
}

/* ---- AI Tone Selector ---- */
.tone-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tone-option {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.tone-option:hover {
    border-color: var(--ml-blue);
    color: var(--ml-blue);
}

.tone-option.active {
    background: var(--ml-blue);
    border-color: var(--ml-blue);
    color: white;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--ml-yellow), var(--ml-yellow-dark));
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255, 230, 0, 0.3);
}

.btn-blue {
    background: linear-gradient(135deg, var(--ml-blue), var(--ml-blue-dark));
    color: white;
}

.btn-blue:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(52, 131, 250, 0.3);
}

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

.btn-outline:hover {
    border-color: var(--ml-yellow);
    color: var(--ml-yellow);
}

.btn-danger {
    background: rgba(255, 68, 68, 0.15);
    color: var(--ml-red);
}

.btn-danger:hover {
    background: rgba(255, 68, 68, 0.25);
}

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

/* ---- Connection Status ---- */
.connection-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.connection-card.connected {
    border-color: rgba(0, 166, 80, 0.3);
    background: rgba(0, 166, 80, 0.05);
}

.connection-card.disconnected {
    border-color: rgba(255, 68, 68, 0.3);
    background: rgba(255, 68, 68, 0.05);
}

.connection-icon {
    font-size: 36px;
}

.connection-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.connection-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ---- Custom Prompt Textarea ---- */
.prompt-textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
    line-height: 1.5;
}

.prompt-textarea:focus {
    outline: none;
    border-color: var(--ml-yellow);
    box-shadow: 0 0 0 3px rgba(255, 230, 0, 0.1);
}

/* ---- Toast Notifications ---- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.success { border-left: 4px solid var(--ml-green); }
.toast.error { border-left: 4px solid var(--ml-red); }
.toast.info { border-left: 4px solid var(--ml-blue); }

.toast .toast-icon { font-size: 20px; }
.toast .toast-msg { font-size: 13px; flex: 1; }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 13px;
    max-width: 300px;
    margin: 0 auto;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 0;
}

.pagination .page-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.pagination .page-btn:hover {
    border-color: var(--ml-yellow);
    color: var(--ml-yellow);
}

.pagination .page-btn.active {
    background: var(--ml-yellow);
    border-color: var(--ml-yellow);
    color: var(--bg-primary);
}

.pagination .page-info {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 12px;
}

/* ---- Search / Filter Bar ---- */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: var(--transition);
}

.filter-bar input:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--ml-yellow);
}

.filter-bar input { flex: 1; min-width: 200px; }
.filter-bar select { min-width: 140px; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ---- Loading Skeleton ---- */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 400% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .sections-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .top-bar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .filter-bar {
        flex-direction: column;
    }
}

/* ---- Setup Screen ---- */
.setup-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.setup-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease;
}

.setup-card h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.setup-card .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
    text-align: center;
}

.setup-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
}

.setup-step {
    width: 32px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    transition: var(--transition);
}

.setup-step.active {
    background: var(--ml-yellow);
    width: 48px;
}

.setup-step.done {
    background: var(--ml-green);
}

/* ---- Page Sections (hidden by default) ---- */
.page-section {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.page-section.active {
    display: block;
}

/* ---- Response Detail Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: fadeInUp 0.3s ease;
}

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

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 68, 68, 0.2);
    color: var(--ml-red);
}

.modal-body {
    padding: 24px;
}

.modal-field {
    margin-bottom: 18px;
}

.modal-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.modal-field .value {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-input);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
