/* ═══════════════════════════════════════════════════════════
   K10 Player — Design System (shadcn/ui inspired, dark K10 theme)
   ═══════════════════════════════════════════════════════════ */

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

/* ── CSS Variables ─────────────────────────────────────── */
:root {
    --bg-primary: #09090b;
    --bg-secondary: #0c0c0f;
    --bg-card: #111114;
    --bg-elevated: #18181b;
    --bg-input: #1a1a1f;
    --bg-hover: #1e1e24;
    --bg-sidebar: linear-gradient(180deg, #0a0a0d 0%, #0f0f14 50%, #0d0d12 100%);

    --border: #27272a;
    --border-hover: #3f3f46;
    --border-focus: #f97316;
    --border-k10: rgba(249, 115, 22, 0.15);

    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-inverse: #09090b;

    --accent: #f97316;
    --accent-hover: #ea580c;
    --accent-soft: rgba(249, 115, 22, 0.1);
    --accent-glow: rgba(249, 115, 22, 0.3);

    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --info: #3b82f6;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.6);
    --shadow-glow: 0 0 20px rgba(249,115,22,0.15);

    --transition: all 0.2s ease;
    --font: 'Inter', -apple-system, sans-serif;
    --sidebar-width: 260px;
}

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

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

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

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

::selection { background: var(--accent); color: var(--text-inverse); }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Layout ────────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

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

.sidebar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f97316, #fbbf24, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav { padding: 12px 0; flex: 1; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-left-color: var(--accent);
}

.nav-item.active {
    color: var(--accent);
    background: var(--accent-soft);
    border-left-color: var(--accent);
}

.nav-item svg, .nav-item i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

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

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    min-height: 100vh;
}

/* ── Page Header ───────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

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

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
}

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

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

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body { padding: 0; }

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

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

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

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

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

.stat-value.accent { color: var(--accent); }
.stat-value.success { color: var(--success); }
.stat-value.danger { color: var(--danger); }

/* ── Buttons (shadcn style) ────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    border-color: transparent;
    box-shadow: 0 0 12px rgba(249,115,22,0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    box-shadow: 0 0 20px rgba(249,115,22,0.4);
    transform: translateY(-1px);
    color: white;
}

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

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

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: transparent;
}
.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: transparent;
}
.btn-success:hover { background: #16a34a; color: white; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 8px;
}
.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { padding: 8px; min-width: 36px; min-height: 36px; }

/* ── Inputs (shadcn style) ─────────────────────────────── */
.modern-input,
.modern-select {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 0.88rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    outline: none;
}

.modern-input:focus,
.modern-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

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

.modern-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.modern-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

textarea.modern-input { resize: vertical; min-height: 80px; }

/* Checkbox (shadcn style) */
.modern-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-hover);
    border-radius: 4px;
    background: var(--bg-input);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
}

.modern-checkbox:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.modern-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.modern-checkbox:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Form Groups */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group .helptext,
.form-group .help-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.form-check label {
    margin: 0;
    cursor: pointer;
}

/* ── Tables ────────────────────────────────────────────── */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

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

.modern-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.modern-table tbody tr:hover {
    background: var(--accent-soft);
}

.modern-table tbody td {
    padding: 12px 16px;
    color: var(--text-primary);
    vertical-align: middle;
}

/* ── Badges ────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-online { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-offline { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-error { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-syncing { background: rgba(249,115,22,0.15); color: var(--accent); }
.badge-active { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-inactive { background: rgba(113,113,122,0.15); color: var(--text-muted); }

/* ── Alerts / Messages ─────────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid;
}

.alert-success {
    background: rgba(34,197,94,0.08);
    border-color: rgba(34,197,94,0.2);
    color: var(--success);
}

.alert-error,
.alert-danger {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.2);
    color: var(--danger);
}

.alert-warning {
    background: rgba(234,179,8,0.08);
    border-color: rgba(234,179,8,0.2);
    color: var(--warning);
}

.alert-info {
    background: rgba(59,130,246,0.08);
    border-color: rgba(59,130,246,0.2);
    color: var(--info);
}

/* ── Modal ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-title { font-size: 1.15rem; font-weight: 600; }

/* ── Search Bar ────────────────────────────────────────── */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 400px;
}

.search-bar input {
    flex: 1;
}

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

.empty-state svg,
.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

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

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ── Grid Utilities ────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 0.85rem; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.d-none { display: none !important; }
.text-uppercase { text-transform: uppercase; }

/* ── Status Dot ────────────────────────────────────────── */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
    animation: pulse-green 2s infinite;
}

.status-dot.offline { background: var(--danger); }
.status-dot.syncing { background: var(--accent); animation: pulse-orange 1.5s infinite; }
.status-dot.error { background: var(--danger); animation: pulse-red 1.5s infinite; }

@keyframes pulse-green { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes pulse-orange { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes pulse-red { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Toolbar ───────────────────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Terminal Card Grid ────────────────────────────────── */
.terminal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.terminal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: var(--transition);
    cursor: pointer;
}

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

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

.terminal-name {
    font-weight: 600;
    font-size: 1rem;
}

.terminal-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.terminal-info dt { color: var(--text-muted); }
.terminal-info dd { color: var(--text-primary); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
    .sidebar { width: 220px; }
    .main-content { margin-left: 220px; padding: 20px; }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .main-content { margin-left: 0; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .terminal-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .toolbar { flex-direction: column; align-items: flex-start; }
}

/* ── File Upload Area ──────────────────────────────────── */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* ── Sortable (drag and drop) ──────────────────────────── */
.sortable-ghost {
    opacity: 0.3;
    background: var(--accent-soft);
}

.sortable-drag {
    box-shadow: var(--shadow-lg);
}

/* ── Form Control (Bootstrap compatibility) ────────────── */
.form-control {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 0.88rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 0.88rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-check-input {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-hover);
    border-radius: 4px;
    background: var(--bg-input);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
}
.form-check-input:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.form-check-input:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ── Theme Toggle ──────────────────────────────────────── */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    padding: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--accent);
    border-color: var(--border-hover);
}

/* ── Light Theme ───────────────────────────────────────── */
body.light-theme {
    --bg-primary: #fafafa;
    --bg-secondary: #f4f4f5;
    --bg-card: #ffffff;
    --bg-elevated: #f4f4f5;
    --bg-input: #ffffff;
    --bg-hover: #f0f0f2;
    --bg-sidebar: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);

    --border: #e4e4e7;
    --border-hover: #d4d4d8;
    --border-k10: rgba(249, 115, 22, 0.2);

    --text-primary: #09090b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    --text-inverse: #fafafa;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 20px rgba(249,115,22,0.1);
}

/* ── Dashboard Charts (shadcn-like) ─────────────────────── */
.chart-donut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.donut-chart {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(
        var(--success) 0 var(--online-pct),
        rgba(113,113,122,0.35) var(--online-pct) 100%
    );
    box-shadow: var(--shadow-glow);
}

.donut-center {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.donut-sub {
    font-size: .72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .45px;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 170px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(255,255,255,0.05);
}

.legend-label {
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 600;
}

.legend-value {
    margin-left: auto;
    color: var(--text-primary);
    font-size: .85rem;
    font-weight: 700;
}

.bars-chart {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    height: 200px;
    padding: 6px 0;
}

.bar-item {
    flex: 1;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.bar-label {
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 600;
    max-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-value {
    color: var(--text-primary);
    font-size: .82rem;
    font-weight: 800;
}

.bar-track {
    flex: 1;
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.bar-fill {
    width: 100%;
    border-radius: var(--radius-md);
    transition: height .25s ease;
}
