/* ═══════════════════════════════════════════════════════════════════════════
   MeCare API Log Viewer - Mission Control Theme
   A sophisticated operations center aesthetic with precision and clarity
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Core Palette - Midnight Operations */
    --bg-void: #030712;
    --bg-deep: #0a0f1a;
    --bg-panel: #111827;
    --bg-card: #1a2332;
    --bg-elevated: #243044;
    --bg-hover: #2d3a4f;

    /* Accent - Electric Cyan */
    --accent-primary: #06b6d4;
    --accent-glow: #22d3ee;
    --accent-dim: #0891b2;
    --accent-muted: rgba(6, 182, 212, 0.15);

    /* Status Colors */
    --status-success: #10b981;
    --status-success-glow: #34d399;
    --status-warning: #f59e0b;
    --status-warning-glow: #fbbf24;
    --status-error: #ef4444;
    --status-error-glow: #f87171;
    --status-info: #8b5cf6;

    /* Text Hierarchy */
    --text-bright: #f8fafc;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;

    /* Borders & Lines */
    --border-subtle: rgba(148, 163, 184, 0.1);
    --border-default: rgba(148, 163, 184, 0.15);
    --border-accent: rgba(6, 182, 212, 0.3);

    /* Shadows */
    --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.15);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.5);

    /* Layout */
    --sidebar-width: 220px;
    --header-height: 64px;
    --filter-height: auto;

    /* Typography */
    --font-display: 'Outfit', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;

    /* Timing */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ═══ Reset & Base ═══════════════════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-display);
    background: var(--bg-void);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dim);
}

/* ═══ App Layout - Full Height Fixed ═════════════════════════════════════════ */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(6, 182, 212, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(139, 92, 246, 0.02) 0%, transparent 50%),
        var(--bg-void);
}

/* ═══ Sidebar ═════════════════════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-deep);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
}

.sidebar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, var(--accent-primary) 0%, transparent 30%, transparent 70%, var(--accent-primary) 100%);
    opacity: 0.3;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.05) 0%, transparent 100%);
}

.sidebar-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header h2::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent-glow);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.sidebar-header .subtitle {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 0.25rem;
    margin-left: 1rem;
}

/* Navigation */
.nav-menu {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.nav-menu ul {
    list-style: none;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s var(--ease-out-expo);
    position: relative;
    margin: 0.125rem 0.5rem;
    border-radius: 6px;
}

.nav-menu li a:hover {
    background: var(--bg-card);
    color: var(--text-bright);
}

.nav-menu li a.active {
    background: var(--accent-muted);
    color: var(--accent-glow);
    border: 1px solid var(--border-accent);
}

.nav-menu li a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-primary);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Nav Icons */
.nav-icon {
    width: 32px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 1rem;
    opacity: 0.8;
}

.nav-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-subtle);
}

.swagger-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.swagger-link:hover {
    background: var(--bg-card);
    color: var(--accent-primary);
}

/* ═══ Main Content Area ══════════════════════════════════════════════════════ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    overflow: hidden;
    gap: 1rem;
}

/* ═══ Page Header - Sticky ═══════════════════════════════════════════════════ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.page-header h1 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-bright);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header h1::before {
    content: '';
    width: 4px;
    height: 1.25rem;
    background: linear-gradient(180deg, var(--accent-primary), var(--status-info));
    border-radius: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auto-refresh {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.auto-refresh input[type="checkbox"] {
    accent-color: var(--accent-primary);
    width: 14px;
    height: 14px;
}

/* ═══ Filters Panel - Sticky ═════════════════════════════════════════════════ */
.filters-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.filters-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.5;
}

.filters-panel.compact {
    padding: 0.75rem 1rem;
}

.filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-row + .filter-row {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-subtle);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-group.flex-grow {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.filter-group input,
.filter-group select {
    padding: 0.5rem 0.75rem;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    min-width: 140px;
    transition: all 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.filter-group input::placeholder {
    color: var(--text-dim);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* ═══ Buttons ════════════════════════════════════════════════════════════════ */
.btn {
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-dim));
    color: var(--bg-void);
    border-color: var(--accent-primary);
}

.btn-primary:hover {
    background: var(--accent-glow);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-dim);
    color: var(--text-bright);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-default);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
    color: var(--text-bright);
}

.btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn.active {
    background: var(--accent-primary);
    color: var(--bg-void);
    border-color: var(--accent-primary);
}

/* ═══ Spinner ════════════════════════════════════════════════════════════════ */
.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-right-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.large {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 3px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══ Results Panel - Scrollable ════════════════════════════════════════════ */
.results-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    overflow: hidden;
}

.results-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8125rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.results-summary .page-info {
    font-family: var(--font-mono);
    color: var(--accent-primary);
}

/* ═══ Table Wrapper - Sticky Header + Scrollable Body ═══════════════════════ */
.table-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.logs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

/* Sticky Header */
.logs-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.logs-table th {
    background: var(--bg-card);
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-accent);
    white-space: nowrap;
}

.logs-table th:first-child {
    padding-left: 1.25rem;
}

/* Scrollable Body */
.table-scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.logs-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8125rem;
    vertical-align: middle;
}

.logs-table td:first-child {
    padding-left: 1.25rem;
}

.logs-table tbody tr {
    cursor: pointer;
    transition: all 0.15s;
}

.logs-table tbody tr:hover {
    background: var(--bg-hover);
}

.logs-table tbody tr.row-error {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid var(--status-error);
}

.logs-table tbody tr.row-error:hover {
    background: rgba(239, 68, 68, 0.12);
}

.logs-table tbody tr.row-warning {
    background: rgba(245, 158, 11, 0.06);
    border-left: 3px solid var(--status-warning);
}

.logs-table tbody tr.row-warning:hover {
    background: rgba(245, 158, 11, 0.1);
}

/* Column Widths */
.col-time { width: 90px; }
.col-method { width: 75px; }
.col-api { width: auto; }
.col-status { width: 70px; }
.col-duration { width: 90px; }
.col-ip { width: 110px; }
.col-error { width: 180px; }

.col-time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.col-time small {
    display: block;
    color: var(--text-dim);
    font-size: 0.6875rem;
}

.col-api {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.col-ip {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
}

.col-error {
    font-size: 0.75rem;
    color: var(--status-error);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ═══ Badges ═════════════════════════════════════════════════════════════════ */
.method-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    min-width: 52px;
}

.method-badge.get {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.method-badge.post {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-glow);
    border: 1px solid rgba(6, 182, 212, 0.3);
}
.method-badge.put {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.method-badge.delete {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.method-badge.patch {
    background: rgba(139, 92, 246, 0.15);
    color: var(--status-info);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 42px;
}

.status-badge.status-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-success);
}
.status-badge.status-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-warning);
}
.status-badge.status-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-error);
}
.status-badge.status-info {
    background: rgba(139, 92, 246, 0.15);
    color: var(--status-info);
}

/* ═══ Duration ═══════════════════════════════════════════════════════════════ */
.duration {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
}

.duration.fast { color: var(--status-success); }
.duration.medium { color: var(--status-warning); }
.duration.slow { color: var(--status-error); }

/* ═══ Pagination ═════════════════════════════════════════════════════════════ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.375rem;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.page-size-select {
    margin-left: 1rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

/* ═══ Loading & Empty States ═════════════════════════════════════════════════ */
.loading-state,
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
    gap: 1rem;
}

.loading-state .spinner {
    color: var(--accent-primary);
}

.empty-state.success-state {
    color: var(--status-success);
}

.success-icon {
    font-size: 3rem;
    line-height: 1;
}

/* ═══ Detail Page ════════════════════════════════════════════════════════════ */
.detail-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.detail-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 1.25rem;
    position: relative;
}

.detail-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-card h3::before {
    content: '';
    width: 3px;
    height: 1rem;
    background: var(--accent-primary);
    border-radius: 2px;
}

.detail-card.error-card {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), var(--bg-panel));
}

.detail-card.error-card h3::before {
    background: var(--status-error);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.summary-item.full-width {
    grid-column: 1 / -1;
}

.summary-item label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.summary-item span {
    color: var(--text-primary);
    font-size: 0.875rem;
}

.url-text {
    word-break: break-all;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--accent-glow);
}

.user-agent {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.detail-section {
    margin-bottom: 1.25rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h4 {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-block {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 350px;
    overflow-y: auto;
    color: var(--text-secondary);
}

.code-block.error-body {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.error-message {
    color: var(--status-error);
}

.stack-trace {
    color: var(--text-dim);
    font-size: 0.6875rem;
}

/* ═══ Statistics Page ════════════════════════════════════════════════════════ */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    flex-shrink: 0;
}

.stat-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-primary);
}

.stat-card.success::before { background: var(--status-success); }
.stat-card.warning::before { background: var(--status-warning); }
.stat-card.error::before { background: var(--status-error); }

.stat-icon {
    font-size: 1.75rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-bright);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.stats-section {
    background: var(--bg-panel);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.stats-section h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-section h3::before {
    content: '';
    width: 3px;
    height: 1rem;
    background: var(--accent-primary);
    border-radius: 2px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.metric-card {
    text-align: center;
    padding: 1rem;
    background: var(--bg-deep);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.metric-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.metric-value.fast { color: var(--status-success); }
.metric-value.medium { color: var(--status-warning); }
.metric-value.slow { color: var(--status-error); }
.metric-value.success { color: var(--status-success); }
.metric-value.warning { color: var(--status-warning); }
.metric-value.error { color: var(--status-error); }

.stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.stats-table th,
.stats-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.stats-table th {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-table td {
    font-size: 0.8125rem;
}

.progress-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-fill {
    height: 6px;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent-primary));
    border-radius: 3px;
    min-width: 4px;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

.progress-bar span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 45px;
}

.success-rate-chart {
    padding: 1rem 0;
}

.rate-bar {
    display: flex;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.rate-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bg-void);
    transition: all 0.3s;
}

.rate-segment.success { background: var(--status-success); }
.rate-segment.warning { background: var(--status-warning); }
.rate-segment.error { background: var(--status-error); }

.rate-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.legend-item {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.legend-item.success { color: var(--status-success); }
.legend-item.warning { color: var(--status-warning); }
.legend-item.error { color: var(--status-error); }

/* ═══ Error Page ═════════════════════════════════════════════════════════════ */
.error-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    flex: 1;
    padding-right: 0.5rem;
}

.error-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.error-card:hover {
    background: var(--bg-card);
    transform: translateX(4px);
}

.error-card.server-error {
    border-left: 4px solid var(--status-error);
}

.error-card.client-error {
    border-left: 4px solid var(--status-warning);
}

.error-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.625rem;
    flex-wrap: wrap;
}

.error-header .api-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-bright);
    min-width: 200px;
}

.error-header .timestamp {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
}

.error-url {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.625rem;
    word-break: break-all;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--status-error-glow);
    margin-bottom: 0.625rem;
    border-left: 3px solid var(--status-error);
}

.error-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.error-meta strong {
    color: var(--text-secondary);
}

/* ═══ Slow Requests ══════════════════════════════════════════════════════════ */
.duration-bar {
    height: 4px;
    background: var(--bg-deep);
    border-radius: 2px;
    margin-top: 0.375rem;
    overflow: hidden;
}

.duration-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s var(--ease-out-expo);
}

.duration-fill.medium {
    background: linear-gradient(90deg, var(--status-warning), #fcd34d);
}
.duration-fill.slow {
    background: linear-gradient(90deg, #f97316, #fb923c);
}
.duration-fill.critical {
    background: linear-gradient(90deg, var(--status-error), var(--status-error-glow));
}

.slow-stats {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.25rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    margin-top: 1rem;
    flex-shrink: 0;
}

.slow-stats .stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.slow-stats .stat-item label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.slow-stats .stat-item .value {
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-bright);
}

/* ═══ 404 Page ═══════════════════════════════════════════════════════════════ */
.not-found {
    text-align: center;
    padding: 4rem;
}

.not-found h1 {
    font-size: 5rem;
    font-weight: 700;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.not-found p {
    color: var(--text-muted);
    margin: 1rem 0 2rem;
}

.not-found a {
    color: var(--accent-primary);
    text-decoration: none;
}

.not-found a:hover {
    text-decoration: underline;
}

/* ═══ Responsive ═════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -100%;
        z-index: 100;
        transition: left 0.3s var(--ease-out-expo);
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group input,
    .filter-group select {
        min-width: 100%;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .slow-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .error-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ═══ Login Page - Premium Design ════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Animated Background */
.login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 70%),
        linear-gradient(180deg, #030712 0%, #0a0f1a 100%);
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(6, 182, 212, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.glow-1 {
    width: 400px;
    height: 400px;
    background: rgba(6, 182, 212, 0.2);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.glow-2 {
    width: 300px;
    height: 300px;
    background: rgba(139, 92, 246, 0.15);
    bottom: -50px;
    right: -50px;
    animation-delay: -7s;
}

.glow-3 {
    width: 200px;
    height: 200px;
    background: rgba(16, 185, 129, 0.15);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.05); }
}

.floating-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 50%;
    animation: pulse-float 15s ease-in-out infinite;
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 60px;
    height: 60px;
    top: 60%;
    right: 15%;
    animation-delay: -4s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 20%;
    animation-delay: -8s;
}

.shape-4 {
    width: 40px;
    height: 40px;
    top: 30%;
    right: 25%;
    animation-delay: -12s;
}

@keyframes pulse-float {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) scale(1.1);
        opacity: 0.6;
    }
}

/* Login Content */
.login-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    width: 100%;
    max-width: 440px;
}

/* Brand */
.login-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    animation: fadeInDown 0.6s ease-out;
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-dim));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: -0.02em;
}

/* Login Card */
.login-card {
    width: 100%;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 24px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.card-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

/* Header */
.login-card .login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.header-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-glow);
}

.icon-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: ring-pulse 2s ease-out infinite;
}

@keyframes ring-pulse {
    0% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(1); opacity: 0.3; }
}

.login-card .login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.login-card .login-header p {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

/* Form */
.login-card .login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    transition: color 0.3s;
    z-index: 1;
}

.input-group.focused .input-icon {
    color: var(--accent-primary);
}

.input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: rgba(3, 7, 18, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1rem;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(3, 7, 18, 0.8);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.1);
}

.input-group input::placeholder {
    color: var(--text-dim);
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-glow));
    transition: all 0.3s;
    transform: translateX(-50%);
    border-radius: 1px;
}

.input-group.focused .input-line {
    width: calc(100% - 2rem);
}

/* Error Message */
.login-card .error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    color: var(--status-error-glow);
    font-size: 0.875rem;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Login Button */
.login-btn {
    position: relative;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-dim));
    border: none;
    border-radius: 12px;
    color: white;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s;
    margin-top: 0.5rem;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(6, 182, 212, 0.4);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.login-btn:hover:not(:disabled) .btn-glow {
    transform: translateX(100%);
}

/* Footer */
.login-content > .login-footer {
    margin-top: 2rem;
    text-align: center;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.footer-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-default), transparent);
    margin: 0 auto 1rem;
}

.login-content > .login-footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-dim);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-redirect {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: var(--text-muted);
    background: var(--bg-void);
}

/* ═══ Top Header with User Info ══════════════════════════════════════════════ */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.server-time {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.375rem 0.75rem;
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}
