/* ============================================
   libosaas Design System
   Inspired by Stripe, Linear, Vercel
   ============================================ */

/* CSS Variables - Design Tokens */
:root {
    /* Color Palette - Dark Theme */
    --color-bg-primary: #0a0e14;
    --color-bg-secondary: #0f1419;
    --color-bg-tertiary: #151b23;
    --color-bg-elevated: #1a212b;
    --color-bg-hover: #1f2937;
    --color-bg-active: #252f3f;

    /* Surface colors with transparency */
    --color-surface: rgba(26, 33, 43, 0.8);
    --color-surface-hover: rgba(31, 41, 55, 0.9);
    --color-glass: rgba(15, 20, 25, 0.7);

    /* Borders */
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(255, 255, 255, 0.15);
    --color-border-focus: rgba(0, 212, 255, 0.5);

    /* Text */
    --color-text-primary: #f9fafb;
    --color-text-secondary: #9ca3af;
    --color-text-tertiary: #6b7280;
    --color-text-muted: #4b5563;

    /* Accent Colors */
    --color-accent: #00d4ff;
    --color-accent-hover: #00b8e6;
    --color-accent-subtle: rgba(0, 212, 255, 0.1);
    --color-accent-glow: rgba(0, 212, 255, 0.3);

    --color-purple: #8b5cf6;
    --color-purple-subtle: rgba(139, 92, 246, 0.1);

    /* Semantic Colors */
    --color-success: #10b981;
    --color-success-subtle: rgba(16, 185, 129, 0.1);
    --color-warning: #f59e0b;
    --color-warning-subtle: rgba(245, 158, 11, 0.1);
    --color-danger: #f43f5e;
    --color-danger-subtle: rgba(244, 63, 94, 0.1);
    --color-info: #3b82f6;
    --color-info-subtle: rgba(59, 130, 246, 0.1);

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.15);
    --shadow-glow-lg: 0 0 40px rgba(0, 212, 255, 0.2);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Z-index layers */
    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal-backdrop: 300;
    --z-modal: 400;
    --z-toast: 500;
    --z-tooltip: 600;
}

/* ============================================
   Base Styles
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    min-height: 100vh;
}

/* Subtle gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(0, 212, 255, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-hover);
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--space-4);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

p {
    margin: 0 0 var(--space-4);
    color: var(--color-text-secondary);
}

.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-accent { color: var(--color-accent); }

/* ============================================
   Navigation
   ============================================ */

.navbar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--color-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-3) var(--space-6);
}

.navbar-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    text-decoration: none;
}

.navbar-brand-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.navbar-nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-tertiary);
    text-decoration: none;
    border-radius: 9999px;
    transition: all var(--transition-fast);
}

.nav-pill:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-hover);
}

.nav-pill svg {
    opacity: 0.6;
    flex-shrink: 0;
}

.nav-pill:hover svg {
    opacity: 1;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-hover);
}

.nav-link.active {
    color: var(--color-accent);
    background: var(--color-accent-subtle);
}


/* ============================================
   Layout
   ============================================ */

.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-6);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
    gap: var(--space-3);
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin: 0;
}

.page-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    margin-top: var(--space-1);
}

.page-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 2px;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-toggle-btn:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-hover);
}

.view-toggle-btn.active {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
}

.view-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-3);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-cols-4, .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
}

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

.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-tertiary);
}

.card-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    margin: 0;
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.card-body {
    padding: var(--space-5);
}

.card-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-tertiary);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent), #00a8cc);
    color: var(--color-bg-primary);
    box-shadow: var(--shadow-sm), 0 0 20px rgba(0, 212, 255, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 0 30px rgba(0, 212, 255, 0.3);
}

.btn-secondary {
    background: var(--color-bg-hover);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-bg-active);
    border-color: var(--color-border-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #e11d48;
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.3);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-base);
}

.btn-icon {
    padding: var(--space-2);
    width: 36px;
    height: 36px;
}

.btn-icon.btn-sm {
    padding: var(--space-1);
    width: 28px;
    height: 28px;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.btn-icon.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-icon.btn-ghost.active {
    color: var(--color-text-secondary);
    background: transparent;
}

.btn-icon.btn-ghost.deactivated {
    color: var(--color-danger);
    background: var(--color-danger-subtle);
}

.btn-ghost-danger:hover:not(:disabled) {
    color: var(--color-danger);
    background: var(--color-danger-subtle);
}

/* ============================================
   Form Elements
   ============================================ */

.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.form-input,
.form-select {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-family: inherit;
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:hover,
.form-select:hover {
    border-color: var(--color-border-hover);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--color-text-primary);
    -webkit-box-shadow: 0 0 0 1000px var(--color-bg-tertiary) inset;
    border-color: var(--color-border) !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: var(--color-text-primary);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    padding-right: var(--space-10);
}

/* Range Slider */
.form-range {
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    outline: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
    transition: transform var(--transition-fast);
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.form-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
    border: none;
}

.form-range::-moz-range-track {
    height: 6px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    border: none;
}

.form-range::-moz-range-progress {
    height: 6px;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    opacity: 0.5;
}

/* Filled-track variant: accent fill from left to thumb via CSS custom property --fill */
.form-range-fill {
    --fill: 50%;
    background: linear-gradient(
        to right,
        color-mix(in srgb, var(--color-accent) 50%, transparent) var(--fill),
        var(--color-bg-tertiary) var(--fill)
    );
}

/* Checkbox/Switch */
.form-switch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.form-switch input {
    position: relative;
    width: 44px;
    height: 24px;
    appearance: none;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.form-switch input::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--color-text-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.form-switch input:checked {
    background: var(--color-accent);
}

.form-switch input:checked::before {
    transform: translateX(20px);
    background: white;
}

/* Dual-range slider (two thumbs on one track) */
.dual-range {
    position: relative;
    height: 18px;
    --lo: 0%;
    --hi: 100%;
}

.dual-range::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    pointer-events: none;
}

.dual-range::after {
    content: '';
    position: absolute;
    top: 6px;
    left: var(--lo);
    right: calc(100% - var(--hi));
    height: 6px;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    pointer-events: none;
    opacity: 0.5;
}

.dual-range input[type="range"] {
    -webkit-appearance: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 18px;
    background: transparent;
    pointer-events: none;
    margin: 0;
    outline: none;
}

.dual-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
    transition: transform var(--transition-fast);
    position: relative;
    z-index: 1;
}

.dual-range input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.dual-range input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
    border: none;
}

/* ============================================
   Badges & Pills
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-default {
    background: var(--color-bg-hover);
    color: var(--color-text-secondary);
}

.badge-primary {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
}

.badge-success {
    background: var(--color-success-subtle);
    color: var(--color-success);
}

.badge-warning {
    background: var(--color-warning-subtle);
    color: var(--color-warning);
}

.badge-danger {
    background: var(--color-danger-subtle);
    color: var(--color-danger);
}

.badge-info {
    background: var(--color-info-subtle);
    color: var(--color-info);
}

.badge-purple {
    background: var(--color-purple-subtle);
    color: var(--color-purple);
}

/* Count badge */
.badge-count {
    min-width: 24px;
    height: 24px;
    padding: 0 var(--space-2);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    background: var(--color-accent);
    color: var(--color-bg-primary);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Tables
   ============================================ */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-tertiary);
    background: var(--color-bg-tertiary);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--color-bg-hover);
}

.table-clickable tbody tr {
    cursor: pointer;
}

.table-clickable tbody tr:hover {
    background: var(--color-accent-subtle);
}

/* Table thumbnail */
.table-thumbnail {
    width: 100px;
    height: 50px;
    background: var(--color-bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   Capture Card (Grid View)
   ============================================ */

.capture-card {
    position: relative;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
}

.capture-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.capture-card-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 1;
    background: var(--color-bg-primary);
    overflow: hidden;
}

.capture-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.capture-card:hover .capture-card-thumbnail img {
    transform: scale(1.05);
}

.capture-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.capture-card:hover .capture-card-overlay {
    opacity: 1;
}

.capture-card-badges {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    display: flex;
    gap: var(--space-2);
}

.capture-card-body {
    padding: var(--space-2) var(--space-3);
}

.capture-card-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}

.capture-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
}

.capture-card-stat {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.capture-card-stat svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.capture-card-actions {
    display: flex;
    gap: 2px;
    margin-top: var(--space-1);
    padding-top: var(--space-1);
    border-top: 1px solid var(--color-border);
}

/* ============================================
   Spectrogram Container
   ============================================ */

.spectrogram-wrapper {
    position: relative;
    background: var(--color-bg-primary);
    overflow: hidden;
}

.spectrogram-view-area {
    display: flex;
    overflow: hidden;
    background: var(--color-bg-elevated);
}

.spectrogram-container {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 500px;
    background: #000;
    cursor: crosshair;
}

.spectrogram-freq-scroll {
    display: block;
    position: relative;
    width: 28px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--color-bg-tertiary);
    border-left: 1px solid var(--color-border);
}

.spectrogram-freq-scroll input[type="range"] {
    position: absolute;
    margin: 0;
    /* Rotate horizontal slider to vertical: 0 at top, max at bottom */
    transform: rotate(270deg);
    transform-origin: center center;
}

.spectrogram-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.spectrogram-controls {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-tertiary);
    border-top: 1px solid var(--color-border);
}

.spectrogram-zoom {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.spectrogram-scroll {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.spectrogram-scroll input {
    flex: 1;
}

/* Floating toolbar */
.spectrogram-toolbar {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    display: flex;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--color-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    z-index: 10;
}

/* Annotation hover tooltip */
.anno-tooltip {
    display: none;
    position: fixed;
    z-index: var(--z-tooltip);
    pointer-events: none;
    padding: var(--space-3);
    background: rgba(26, 33, 43, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--color-border-hover);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    max-width: 260px;
    box-shadow: var(--shadow-lg);
}

.anno-tooltip-title {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border);
}

.anno-tooltip-table {
    width: 100%;
    border-collapse: collapse;
}

.anno-tooltip-table td {
    padding: 2px 0;
    vertical-align: top;
}

.anno-tooltip-table td:first-child {
    color: var(--color-text-muted);
    padding-right: var(--space-3);
    white-space: nowrap;
}

.anno-tooltip-table td:last-child {
    font-family: var(--font-mono);
    color: var(--color-text-primary);
    text-align: right;
}

/* Spectrogram header with cursor info left, controls right */
.spectrogram-header {
    flex-wrap: wrap;
    gap: var(--space-3);
}

.spectrogram-header-controls {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-left: auto;
}

.cursor-info {
    display: flex;
    gap: var(--space-4);
}

.cursor-info-item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-size-xs);
}

.cursor-info-label {
    color: var(--color-text-muted);
}

.cursor-info-value {
    font-family: var(--font-mono);
    color: var(--color-accent);
}

.cursor-info-offset {
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
}

.header-divider {
    width: 1px;
    height: 20px;
    background: var(--color-border);
}

/* Smaller form select */
.form-select-sm {
    padding: var(--space-1) var(--space-2);
    padding-right: var(--space-6);
    font-size: var(--font-size-xs);
}

/* Dynamic range controls */
.dynamic-range-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-right: var(--space-4);
    border-right: 1px solid var(--color-border);
    flex: 0 0 33%;
    min-width: 0;
}

.dynamic-range-controls .dual-range {
    flex: 1;
    min-width: 80px;
}

.dr-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.dr-value {
    font-size: var(--font-size-xs);
    font-family: var(--font-mono);
    color: var(--color-text-secondary);
    min-width: 28px;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .cursor-info {
        display: none;
    }

    .header-divider {
        display: none;
    }

    .dynamic-range-controls {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding-right: 0;
        padding-bottom: var(--space-3);
        margin-bottom: var(--space-3);
    }

    .dr-label {
        display: none;
    }
}

/* ============================================
   Detail Page Layout
   ============================================ */

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-6);
}

@media (max-width: 1024px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }
}

.detail-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Info list */
.info-list {
    display: flex;
    flex-direction: column;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border);
    line-height: 1;
}

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

.info-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
}

.info-value {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    font-family: var(--font-mono);
}

/* ============================================
   Detection Table
   ============================================ */

.detection-card {
    overflow: hidden;
}

.detection-table-container {
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-color: var(--color-border) var(--color-bg-tertiary);
}

.detection-table-container::-webkit-scrollbar {
    width: 10px;
}

.detection-table-container::-webkit-scrollbar-track {
    background: var(--color-bg-tertiary);
}

.detection-table-container::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 5px;
}

.detection-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-hover);
}

.detection-table-container tbody tr {
    scroll-snap-align: start;
}

.detection-table-container .table td {
    padding: var(--space-2) var(--space-3);
    line-height: 1.25;
}

.detection-table-container thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.detection-table-container thead th {
    background: var(--color-bg-tertiary);
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

.detection-row {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.detection-row:hover {
    background: var(--color-accent-subtle) !important;
}

.detection-row.selected {
    background: var(--color-accent-subtle);
    border-left: 3px solid var(--color-accent);
}

.table .col-index {
    width: 3em;
    text-align: right;
    padding-right: var(--space-2) !important;
}

/* ============================================
   Modals
   ============================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    overflow: hidden;
}

.modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

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

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin: 0;
}

.modal-close {
    padding: var(--space-2);
    background: none;
    border: none;
    color: var(--color-text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.modal-body {
    padding: var(--space-5);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-tertiary);
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    z-index: var(--z-toast);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    min-width: 320px;
    max-width: 400px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    pointer-events: auto;
    transform: translateX(120%);
    transition: transform var(--transition-bounce);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-success .toast-icon {
    background: var(--color-success-subtle);
    color: var(--color-success);
}

.toast-error .toast-icon {
    background: var(--color-danger-subtle);
    color: var(--color-danger);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-1);
}

.toast-message {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* ============================================
   Loading States
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-tertiary) 0%,
        var(--color-bg-hover) 50%,
        var(--color-bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

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

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 20, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

/* ============================================
   Empty States
   ============================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-16) var(--space-8);
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-6);
    color: var(--color-text-muted);
    opacity: 0.5;
}

.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-2);
}

.empty-state-description {
    color: var(--color-text-tertiary);
    max-width: 400px;
    margin-bottom: var(--space-6);
}

/* ============================================
   Filters Bar
   ============================================ */

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-4);
    justify-content: space-between;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 150px;
    flex: 1;
}

.filter-group:last-child {
    flex: 0 0 auto;
}

/* ============================================
   Breadcrumbs
   ============================================ */

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-4);
}

.breadcrumb-item {
    color: var(--color-text-tertiary);
}

.breadcrumb-item a {
    color: var(--color-text-secondary);
}

.breadcrumb-item a:hover {
    color: var(--color-accent);
}

.breadcrumb-separator {
    color: var(--color-text-muted);
}

/* ============================================
   Progress Bar
   ============================================ */

.progress {
    height: 6px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-purple));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* ============================================
   File Upload
   ============================================ */

.file-upload {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-xl);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.file-upload:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-subtle);
}

.file-upload.dragging {
    border-color: var(--color-accent);
    background: var(--color-accent-subtle);
    box-shadow: var(--shadow-glow);
}

.file-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-4);
    color: var(--color-text-muted);
}

.file-upload-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-align: center;
}

.file-upload-text strong {
    color: var(--color-accent);
}

/* File checklist items (upload modal) */
.file-checklist-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.file-checklist-item .file-check-icon {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    width: 1.2em;
    text-align: center;
}

.file-checklist-item .file-check-name {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
}

/* ============================================
   Tooltips
   ============================================ */

.tooltip {
    position: absolute;
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-tooltip);
    pointer-events: none;
    white-space: nowrap;
}

/* ============================================
   Mobile Styles
   ============================================ */

.mobile-nav {
    display: none;
}

@media (max-width: 768px) {
    :root {
        --space-6: 1rem;
    }

    .navbar {
        padding: var(--space-3) var(--space-4);
    }

    .navbar-nav, .navbar-nav-links {
        display: none;
    }

    .navbar-username, .navbar-admin-badge {
        display: none;
    }

    .navbar-user-btn {
        padding: 0.25rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* Hide thumbnail column on mobile table view */
    .table th:first-child,
    .table td:first-child {
        display: none;
    }

    /* Make table more compact on mobile */
    .table th,
    .table td {
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-size-xs);
    }

    .spectrogram-container {
        height: 300px;
    }

    .spectrogram-controls {
        flex-wrap: wrap;
    }

    .detail-sidebar {
        order: -1;
    }

    .filters-bar {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .modal {
        width: 95%;
        max-height: 85vh;
    }

    .toast-container {
        left: var(--space-4);
        right: var(--space-4);
        bottom: var(--space-4);
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    /* Mobile bottom nav */
    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        display: flex;
        justify-content: space-around;
        padding: var(--space-2) var(--space-4);
        padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom));
        background: var(--color-glass);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--color-border);
        z-index: var(--z-sticky);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--space-1);
        padding: var(--space-2);
        color: var(--color-text-tertiary);
        text-decoration: none;
        font-size: var(--font-size-xs);
        transition: color var(--transition-fast);
    }

    .mobile-nav-item.active {
        color: var(--color-accent);
    }

    .mobile-nav-item svg {
        width: 24px;
        height: 24px;
    }

    body {
        padding-bottom: 70px;
    }
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fadeIn {
    animation: fadeIn var(--transition-base) ease-out;
}

.animate-slideUp {
    animation: slideUp var(--transition-slow) ease-out;
}

.animate-scaleIn {
    animation: scaleIn var(--transition-base) ease-out;
}

/* Staggered animations */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }

/* ============================================
   Utility Classes
   ============================================ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Very small screens - hide more table columns */
@media (max-width: 480px) {
    .table th:nth-child(4),
    .table td:nth-child(4),
    .table th:nth-child(5),
    .table td:nth-child(5),
    .table th:nth-child(6),
    .table td:nth-child(6) {
        display: none;
    }
}

/* Auth pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 60px);
    padding: 12vh 1rem 2rem;
}

@media (max-width: 768px) {
    .auth-container {
        padding-top: 0;
        min-height: 0;
        align-items: unset;
        display: block;
    }
    .auth-card {
        margin: 0 auto;
    }
}

.auth-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}

.auth-header h2 {
    margin: 0 0 0.25rem;
    color: var(--color-text-primary);
}

.auth-subtitle {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form .form-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text-primary);
    font-size: 0.875rem;
}

.auth-form .form-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.auth-error {
    color: var(--color-danger, #ef4444);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
}

.btn-full {
    width: 100%;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.auth-footer a {
    color: var(--color-accent);
    text-decoration: none;
    margin-left: 0.25rem;
}

/* Navbar user section */
.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.navbar-user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.625rem 0.25rem 0.25rem;
    text-decoration: none;
    border-radius: 9999px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-tertiary);
    transition: all var(--transition-fast);
}

.navbar-user-btn:hover {
    border-color: var(--color-border-hover);
    background: var(--color-bg-hover);
}

.navbar-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--color-accent), #00a8cc);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.navbar-username {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.navbar-user-btn:hover .navbar-username {
    color: var(--color-text-primary);
}

.navbar-admin-badge {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-warning);
    background: var(--color-warning-subtle);
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
}

.navbar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.navbar-logout-btn:hover {
    color: var(--color-danger);
    background: var(--color-danger-subtle);
}

/* Settings page */
.settings-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

/* Admin Dashboard */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.stat-card {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table {
    overflow-x: auto;
    font-size: 0.875rem;
}

.admin-table-header,
.admin-table-row {
    display: grid;
    grid-template-columns: 1fr 0.8fr 1.5fr 0.8fr 0.6fr 1fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.admin-table-header {
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.admin-mono {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.admin-state {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.admin-state-ready {
    background: var(--color-success-subtle);
    color: var(--color-success);
}

.admin-state-busy {
    background: var(--color-warning-subtle);
    color: var(--color-warning);
}

.admin-state-dead,
.admin-state-inactive {
    background: var(--color-danger-subtle);
    color: var(--color-danger);
}

.admin-state-registering,
.admin-state-draining {
    background: var(--color-info-subtle);
    color: var(--color-info);
}

.admin-actions {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
}

.btn-ghost-danger:hover {
    color: var(--color-danger);
    background: var(--color-danger-subtle);
}

.badge-info {
    background: var(--color-info-subtle);
    color: var(--color-info);
}

.badge-purple {
    background: var(--color-purple-subtle);
    color: var(--color-purple);
}

.badge-warning {
    background: var(--color-warning-subtle);
    color: var(--color-warning);
}
