/* ═══════════════════════════════════════════════════════════
   TikTokMusic — Modern UI System
   Design: Linear / Vercel / Apple HIG inspired
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;700&display=swap');


/* ── CSS Variables ── */
:root {
    --bg-primary: linear-gradient(135deg, #f5f7fa 0%, #eef2f5 100%);
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-sidebar: rgba(15, 15, 26, 0.95);
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --accent-blue: #4f46e5;
    --accent-purple: #7c3aed;
    --accent-glow: rgba(79, 70, 229, 0.3);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.5);
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --shadow-lg: 0 20px 40px -5px rgba(0, 0, 0, 0.08), 0 10px 15px -5px rgba(0, 0, 0, 0.04);
    --shadow-accent: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ── Reset & Base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Plus Jakarta Sans", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-primary);
    background-attachment: fixed;
    color: var(--text-primary);
    font-size: 14.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent-blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-purple); text-decoration: none; }
::selection { background: var(--accent-glow); color: #fff; }

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

/* ── Sidebar ── */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #fff;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at top left, rgba(102, 126, 234, 0.08) 0%, transparent 60%);
    pointer-events: none;
}
.sidebar-header {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}
.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar-header .subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.nav-list { list-style: none; padding: 16px 16px; }
.nav-list li { margin-bottom: 4px; }
.nav-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: rgba(255, 255, 255, 0.65);
    transition: var(--transition);
    font-size: 14px;
    border-radius: 12px;
    font-weight: 500;
    position: relative;
}
.nav-list li a:hover {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}
.nav-list li a.active {
    color: #fff;
    background: var(--accent-gradient);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
    text-decoration: none;
    font-weight: 600;
}
.nav-list li a .nav-icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.8;
}
.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* ── Content ── */
.content {
    margin-left: 240px;
    padding: 32px 40px;
    flex: 1;
    min-width: 0;
    max-width: 1400px;
}

/* ── Typography ── */
h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}
h2 {
    font-size: 17px;
    font-weight: 650;
    margin: 28px 0 14px;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}
h3 { font-size: 15px; font-weight: 600; margin: 16px 0 8px; }

/* ── Cards Grid ── */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at top right, rgba(79, 70, 229, 0.08) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.8);
}
.card:hover::before { opacity: 1; }
.card-number {
    font-size: 32px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}
.card-label { font-size: 13px; color: var(--text-secondary); margin-top: 6px; font-weight: 500; }
.card-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Tables ── */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}
thead { background: rgba(248, 250, 252, 0.6); }
th, td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(241, 245, 249, 0.6);
    font-size: 14px;
}
th {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
tr { transition: var(--transition); }
tr:hover { background: rgba(248, 250, 252, 0.8); }
tr:last-child td { border-bottom: none; }
.actions { white-space: nowrap; }
.actions a, .actions button { margin-right: 8px; }

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-running { background: #dbeafe; color: #1e40af; position: relative; }
.badge-running::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #3b82f6;
    margin-right: 6px;
    animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}
.badge-completed, .badge-success { background: #dcfce7; color: #166534; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.badge-cancelled { background: #f1f5f9; color: #475569; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-warn { background: #fef3c7; color: #92400e; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 999px; /* Capsule shape */
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}
.btn:hover {
    border-color: rgba(255, 255, 255, 0.9);
    color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
}
.btn:active { transform: translateY(0) scale(0.97); }
.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
    color: #fff;
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.4);
    transform: translateY(-3px);
}
.btn-primary:active { transform: translateY(0) scale(0.95); box-shadow: var(--shadow-accent); }
.btn-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
    background: #059669;
    color: #fff;
    box-shadow: 0 6px 15px rgba(5, 150, 105, 0.2);
}
.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
    background: #dc2626;
    color: #fff;
    box-shadow: 0 6px 15px rgba(220, 38, 38, 0.2);
}
.btn-sm { padding: 6px 16px; font-size: 12px; border-radius: 999px; }

.btn-lg { padding: 12px 36px; font-size: 15px; border-radius: 999px; font-weight: 600; }
.btn-link { background: none; border: none; cursor: pointer; font-size: 13px; padding: 0; color: var(--accent-blue); }
.btn-link:hover { color: var(--accent-purple); }
.btn-link.btn-danger { color: #ef4444; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 13.5px;
    color: var(--text-primary);
}
input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    max-width: 380px; /* Prevent awkward stretching */
    padding: 12px 16px;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    font-size: 14px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px var(--accent-glow);
}
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-inline input { max-width: 280px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 12px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.radio-group label { display: block; margin-bottom: 6px; font-size: 13px; cursor: pointer; font-weight: normal; }
.help-text { font-size: 12px; color: var(--text-muted); }
.inline { display: inline; }
.code-editor {
    font-family: "JetBrains Mono", "Cascadia Code", "Fira Code", "Consolas", monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    min-height: 400px;
    background: #1e1e2e;
    color: #cdd6f4;
    border-color: #313244;
    border-radius: var(--radius-md);
}
.code-editor:focus { border-color: var(--accent-blue); }

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-header h1 { margin-bottom: 0; }

.card-form, .task-form {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}
.env-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 0;
    transition: var(--transition);
}
.env-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.8);
}

/* ── Details & Accordion ── */
details {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 18px;
    margin-top: 18px;
    transition: var(--transition);
}
summary {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    outline: none;
    user-select: none;
    transition: var(--transition);
}
summary:hover {
    color: var(--accent-blue);
}
summary::-webkit-details-marker {
    display: none;
}
summary::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-top: 2px solid var(--text-secondary);
    border-right: 2px solid var(--text-secondary);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-right: 6px;
    margin-left: 2px;
}
details[open] summary::before {
    transform: rotate(135deg);
    border-color: var(--accent-blue);
}

/* ── Flash Messages ── */
.flash-messages { margin-bottom: 20px; }
.flash {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Progress Bar ── */
.progress-bar {
    height: 8px;
    background: #f1f5f9;
    border-radius: 100px;
    overflow: hidden;
    flex: 1;
    position: relative;
}
.progress-bar-lg { height: 22px; border-radius: 100px; margin-bottom: 8px; }
.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: inherit;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    position: relative;
    overflow: hidden;
}
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}
.progress-text { font-size: 12px; color: var(--text-secondary); margin-left: 8px; }
.progress-stats { display: flex; gap: 24px; font-size: 13px; color: var(--text-secondary); }
/* ── Task Info ── */
.task-info, .progress-section {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.task-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}
.info-row { display: flex; gap: 12px; padding: 6px 0; }
.info-label { color: var(--text-secondary); min-width: 80px; font-weight: 500; }
.cancel-form { margin-bottom: 20px; }

/* ── Task Form (Already covered above) ── */

/* ── Log Viewer ── */
.log-viewer {
    background: #0d1117;
    color: #c9d1d9;
    padding: 24px;
    border-radius: var(--radius-md);
    font-family: "JetBrains Mono", "Cascadia Code", "Fira Code", "Consolas", monospace;
    font-size: 12px;
    line-height: 1.9;
    overflow: auto;
    max-height: 600px;
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid #21262d;
    position: relative;
}
.log-viewer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40px;
    background: linear-gradient(180deg, #0d1117, transparent);
    pointer-events: none;
    z-index: 1;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.log-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}
.log-line {
    padding: 4px 0;
    font-size: 12px;
    font-family: "JetBrains Mono", "Cascadia Code", "Fira Code", "Consolas", monospace;
    border-bottom: 1px solid #f1f5f9;
}
.log-time { color: var(--text-muted); margin-right: 8px; }
.log-level { font-weight: 600; margin-right: 4px; }
.log-info .log-level { color: #3b82f6; }
.log-warning .log-level { color: #f59e0b; }
.log-error .log-level { color: #ef4444; }

/* ── Empty State ── */
.empty {
    color: var(--text-muted);
    font-size: 14px;
    padding: 40px 0;
    text-align: center;
}

/* ── Phase Steps (Batch Detail) ── */
.phase-steps { display: flex; gap: 0; margin-bottom: 1.5rem; }
.phase-steps .step {
    flex: 1;
    padding: 12px 18px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: #f8fafc;
    border: 1px solid var(--border-color);
    position: relative;
    transition: var(--transition);
}
.phase-steps .step:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.phase-steps .step:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.phase-steps .step.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #93c5fd;
}
.phase-steps .step.done {
    background: #ecfdf5;
    color: #059669;
    border-color: #6ee7b7;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.content { animation: fadeIn 0.3s ease; }

/* ── Template Cards (Lyrics) ── */
.template-groups {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}
.template-cat-title {
    font-size: 12px; font-weight: 600; color: #475569;
    padding: 4px 8px; margin-bottom: 4px;
    border-left: 3px solid #1890ff; background: #ecf5ff;
    display: flex; align-items: center; gap: 8px;
}
.template-cat-random {
    font-weight: normal; font-size: 11px; color: #1890ff;
    cursor: pointer; display: inline-flex; align-items: center; gap: 3px;
    margin-left: auto;
}
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
}
.template-card {
    display: block; cursor: pointer; padding: 0;
    border: 1px solid #e2e8f0; border-radius: 6px;
    background: #fff; transition: all 0.15s;
    position: relative;
}
.template-card:hover { border-color: #1890ff; box-shadow: 0 2px 6px rgba(24,144,255,0.08); }
.template-card input[type="checkbox"], .template-card input[type="radio"] { position: absolute; top: 6px; right: 6px; }
.template-card:has(input:checked) { border-color: #1890ff; background: #e6f4ff; box-shadow: 0 0 0 2px rgba(24,144,255,0.15); }
.template-card-body { padding: 6px 10px; }
.template-card-name { font-weight: 600; font-size: 13px; color: #1e293b; margin-bottom: 2px; }
.template-card-desc {
    font-size: 11px; color: #64748b; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.template-card-meta { display: none; }

/* ── Publish Works Table ── */
.works-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.works-table th, .works-table td { padding: 6px 8px; border-bottom: 1px solid #f0f0f0; text-align: left; vertical-align: middle; }
.works-table th { background: #fafafa; font-weight: 500; font-size: 13px; color: #666; }
.works-table tr.selected { background: #e6f4ff; }
.works-table .cover { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; background: #eee; }
.works-table select { padding: 3px 6px; font-size: 13px; }
.works-table select:disabled { background: #f5f5f5; color: #bbb; }
.works-table select.muted { background: #fafafa; color: #aaa; }
.toolbar { background: #fafafa; padding: 8px 12px; border: 1px solid #eee; border-radius: 4px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.toolbar .group { display: inline-flex; gap: 6px; align-items: center; }
.toolbar label { font-size: 13px; color: #666; margin: 0; }
.toolbar select { padding: 3px 6px; font-size: 13px; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { width: 0; overflow: hidden; }
    .content { margin-left: 0; padding: 16px; }
    .form-row { flex-direction: column; gap: 0; }
    .cards { grid-template-columns: 1fr 1fr; }
}

/* ── Tab Navigation ── */
.tab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1.5px solid rgba(0, 0, 0, 0.04);
}
.tab-nav a, .tab-nav button {
    padding: 10px 20px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: -1.5px;
}
.tab-nav a:hover, .tab-nav button:hover {
    color: var(--text-primary);
    text-decoration: none;
}
.tab-nav a.active, .tab-nav button.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    font-weight: 600;
}

/* ── Environment Setup Cards (Already covered above) ── */
.env-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.env-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #666;
    display: inline-block;
    flex-shrink: 0;
}
.env-card-detail {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    min-height: 20px;
}
.env-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Inline Layout Helpers ── */
.toolbar select,
.page-header select,
.form-inline select,
#account-filter {
    width: auto;
    max-width: 240px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.toolbar label,
.page-header label,
.form-inline label,
.checkbox-label {
    white-space: nowrap;
    flex-shrink: 0;
}
