/* ═══════════════════════════════════════════════════════════
   style_v2.css — Apple-Inspired Design System
   ═══════════════════════════════════════════════════════════ */

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

:root {
    /* Color Palette — Refined Dark */
    --bg-base: #000000;
    --bg-elevated: #161618;
    --bg-card: rgba(26, 26, 28, 0.74);
    --bg-card-hover: rgba(38, 38, 42, 0.84);
    --bg-input: rgba(36, 36, 40, 0.56);
    --border: rgba(255, 255, 255, 0.075);
    --border-focus: rgba(10, 132, 255, 0.5);

    /* Accent */
    --blue: #0a84ff;
    --blue-hover: #0071e3;
    --green: #30d158;
    --red: #ff453a;
    --orange: #ff9f0a;
    --purple: #bf5af2;
    --teal: #64d2ff;

    /* Text */
    --text-primary: #f5f5f7;
    --text-secondary: rgba(235, 235, 245, 0.6);
    --text-tertiary: rgba(235, 235, 245, 0.3);

    /* Spacing */
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Effects */
    --glass-blur: blur(32px);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.22);
    --shadow-elevated: 0 24px 60px rgba(0, 0, 0, 0.34);
    --transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    --theme-surface: rgba(255,255,255,0.04);
    --theme-surface-strong: rgba(255,255,255,0.1);
    --theme-accent-soft: rgba(10, 132, 255, 0.14);
    --theme-bg-gradient:
        radial-gradient(ellipse 900px 500px at 12% 0%, rgba(10,132,255,0.09), transparent 55%),
        radial-gradient(ellipse 800px 460px at 88% 10%, rgba(100,210,255,0.06), transparent 52%),
        linear-gradient(180deg, #050507 0%, #0c0c10 100%);
}

body[data-theme="light"] {
    --bg-base: #f3f4f6;
    --bg-elevated: #f7f8fa;
    --bg-card: rgba(245, 246, 248, 0.8);
    --bg-card-hover: rgba(241, 243, 246, 0.94);
    --bg-input: rgba(236, 239, 243, 0.92);
    --border: rgba(17, 24, 39, 0.075);
    --border-focus: rgba(0, 113, 227, 0.28);
    --blue: #0071e3;
    --blue-hover: #0062c3;
    --green: #2fa14f;
    --orange: #d97d0d;
    --purple: #7f56d9;
    --text-primary: #1d1d1f;
    --text-secondary: rgba(29, 29, 31, 0.76);
    --text-tertiary: rgba(29, 29, 31, 0.58);
    --shadow-card: 0 12px 30px rgba(17, 24, 39, 0.055);
    --shadow-elevated: 0 24px 64px rgba(17, 24, 39, 0.1);
    --theme-surface: rgba(255, 255, 255, 0.44);
    --theme-surface-strong: rgba(255, 255, 255, 0.78);
    --theme-accent-soft: rgba(0, 113, 227, 0.08);
    --theme-bg-gradient:
        radial-gradient(ellipse 960px 540px at 12% 0%, rgba(0,113,227,0.035), transparent 52%),
        radial-gradient(ellipse 820px 420px at 88% 8%, rgba(175, 184, 193, 0.12), transparent 48%),
        linear-gradient(180deg, #f6f7f9 0%, #eceef2 100%);
}

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

html { font-size: 15px; }

body {
    font-family: var(--font);
    background: var(--theme-bg-gradient);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body[data-theme="light"] {
    color-scheme: light;
}

body[data-theme="light"] .legal-banner,
body[data-theme="light"] .form-label,
body[data-theme="light"] .stat-card .stat-sub,
body[data-theme="light"] .track-select-hint,
body[data-theme="light"] .slot-password-hint,
body[data-theme="light"] .scheduler-status-sub,
body[data-theme="light"] .queue-info,
body[data-theme="light"] .drift-label,
body[data-theme="light"] .text-muted,
body[data-theme="light"] .disclaimer-body {
    color: rgba(29, 29, 31, 0.78);
}

body[data-theme="light"] .sch-stat-item .label,
body[data-theme="light"] .scheduler-status-label,
body[data-theme="light"] .time-inputs .sep {
    color: rgba(29, 29, 31, 0.62);
}

body[data-theme="light"] .form-input::placeholder {
    color: rgba(29, 29, 31, 0.46);
}

.legal-banner {
    background: rgba(255, 159, 10, 0.08);
    border-bottom: 1px solid rgba(255, 159, 10, 0.15);
    padding: 0.32rem 2rem;
    font-size: 0.66rem;
    color: rgba(255, 200, 100, 0.72);
    text-align: center;
}

.disclaimer-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(255, 159, 10, 0.12);
    border-bottom: 1px solid rgba(255, 159, 10, 0.25);
    padding: 0.5rem 1.5rem;
    font-size: 0.72rem;
    color: rgba(255, 200, 100, 0.85);
    text-align: center;
    line-height: 1.5;
    backdrop-filter: blur(10px);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    position: relative;
    overflow: hidden;
}

.login-page-with-banner {
    padding-top: 40px;
}

.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 80%, rgba(10, 132, 255, 0.12), transparent),
        radial-gradient(ellipse 500px 500px at 80% 20%, rgba(191, 90, 242, 0.10), transparent),
        radial-gradient(ellipse 400px 300px at 50% 50%, rgba(48, 209, 88, 0.06), transparent);
    animation: bgShift 20s ease-in-out infinite alternate;
}

body[data-theme="light"] .login-bg {
    background:
        radial-gradient(ellipse 640px 420px at 18% 78%, rgba(0, 113, 227, 0.06), transparent),
        radial-gradient(ellipse 540px 420px at 82% 18%, rgba(148, 163, 184, 0.12), transparent),
        radial-gradient(ellipse 420px 260px at 52% 50%, rgba(255,255,255,0.3), transparent);
}

@keyframes bgShift {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(30deg); }
}

.login-card {
    position: relative;
    z-index: 1;
    width: 380px;
    max-width: 90vw;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-elevated);
    animation: cardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card .logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .logo-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 12px rgba(10, 132, 255, 0.3));
}

.login-card .logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.login-card .logo p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

.login-form { display: flex; flex-direction: column; gap: 1rem; }

.login-form .field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.login-form label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.login-form input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}
.login-form input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15);
}

.login-form .btn-login {
    margin-top: 0.5rem;
    padding: 0.85rem;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.login-form .btn-login:hover { background: var(--blue-hover); transform: scale(1.01); }
.login-form .btn-login:active { transform: scale(0.98); }
.login-form .btn-login:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.login-error {
    background: rgba(255, 69, 58, 0.12);
    border: 1px solid rgba(255, 69, 58, 0.25);
    color: var(--red);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    display: none;
}
.login-error.show { display: block; animation: shake 0.4s ease; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* ═══════════════════════════════════════════════════════════
   MAIN DASHBOARD
   ═══════════════════════════════════════════════════════════ */

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Top Navigation ─── */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.85rem 1.1rem;
    padding: 0 2.5rem;
    min-height: 64px;
    background: color-mix(in srgb, var(--bg-elevated) 78%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}

body[data-theme="light"] .top-bar {
    background: color-mix(in srgb, var(--bg-elevated) 72%, transparent);
    border-bottom-color: rgba(17, 24, 39, 0.06);
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.5);
}

.nav-side {
    display: flex;
    align-items: center;
    min-width: 0;
}

.nav-side-right {
    justify-content: flex-end;
}

.nav-center {
    display: flex;
    justify-content: center;
}

.top-bar .brand {
    display: flex;
    align-items: center;
    gap: 0.62rem;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: -0.02em;
}

.top-bar .brand-icon {
    position: relative;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    color: transparent;
}

.top-bar .brand-icon::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 1.5px solid color-mix(in srgb, var(--text-primary) 70%, transparent);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent),
        0 1px 2px rgba(0,0,0,0.08);
    opacity: 0.72;
}

.top-bar .nav-links {
    display: flex;
    gap: 0.18rem;
    height: auto;
    flex-wrap: nowrap;
    justify-content: center;
    padding: 0.22rem;
    border-radius: 999px;
    background: var(--theme-surface);
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 4%, transparent);
}

body[data-theme="light"] .top-bar .nav-links,
body[data-theme="light"] .theme-toggle-track {
    background: rgba(255,255,255,0.46);
    border-color: rgba(17, 24, 39, 0.06);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.78),
        0 8px 18px rgba(17, 24, 39, 0.03);
}

.top-bar .nav-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.84rem;
    font-weight: 560;
    letter-spacing: -0.01em;
    padding: 0.8rem 1.02rem;
    height: auto;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    border-radius: 999px;
}
.top-bar .nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.top-bar .nav-link.active { color: var(--text-primary); background: var(--theme-surface-strong); }
.top-bar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    background: var(--blue);
    border-radius: 1px;
    opacity: 0.84;
}

body[data-theme="light"] .top-bar .nav-link:hover {
    background: rgba(255,255,255,0.52);
}

body[data-theme="light"] .top-bar .nav-link.active {
    background: rgba(255,255,255,0.74);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.92),
        0 6px 14px rgba(17, 24, 39, 0.035);
}

.top-bar .user-menu {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.theme-toggle-track {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 0.18rem;
    min-width: 122px;
    border-radius: 999px;
    background: var(--theme-surface);
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 3%, transparent);
}

.theme-toggle-option {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.48rem 0.72rem;
}

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    border-radius: 999px;
    background: var(--theme-surface-strong);
    box-shadow: 0 10px 20px rgba(0,0,0,0.14);
    transition: transform 0.25s ease;
}

body[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(100%);
}

body[data-theme="light"] .theme-toggle-option-sun,
body[data-theme="dark"] .theme-toggle-option-moon {
    color: var(--text-primary);
}

body[data-theme="light"] .theme-toggle-thumb {
    box-shadow:
        0 6px 14px rgba(17, 24, 39, 0.05),
        inset 0 1px 0 rgba(255,255,255,0.92);
}

.top-bar .user-menu .btn-logout {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.78rem;
    padding: 0.42rem 0.9rem;
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition);
}
.top-bar .user-menu .btn-logout:hover { border-color: var(--red); color: var(--red); }

body[data-theme="light"] .top-bar .user-menu .btn-logout {
    background: rgba(255,255,255,0.28);
}

body[data-theme="light"] .card,
body[data-theme="light"] .slot-card,
body[data-theme="light"] .track-select-panel,
body[data-theme="light"] .scheduler-status-bar,
body[data-theme="light"] .auto-refill-panel,
body[data-theme="light"] .login-card {
    background:
        linear-gradient(180deg, rgba(248,249,251,0.84), rgba(241,243,246,0.78)),
        var(--bg-card);
    border-color: rgba(17, 24, 39, 0.065);
    box-shadow:
        0 14px 32px rgba(17, 24, 39, 0.055),
        inset 0 1px 0 rgba(255,255,255,0.7);
}

body[data-theme="light"] .auto-refill-panel,
body[data-theme="light"] .scheduler-status-bar,
body[data-theme="light"] .track-select-panel {
    background:
        linear-gradient(180deg, rgba(250,250,251,0.72), rgba(241,243,246,0.74)),
        var(--bg-card);
}

/* ─── Content Area ─── */
.content {
    flex: 1;
    padding: 2rem 2.5rem 3rem;
    max-width: 1240px;
    margin: 0 auto;
    width: 100%;
}

.tab-page { display: none; animation: fadeIn 0.35s ease; }
.tab-page.active { display: block; }

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

/* ─── Stats Overview ─── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.stat-card {
    --stat-accent: var(--blue);
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.4rem;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.01) 38%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}
.stat-card::after {
    content: "";
    position: absolute;
    right: -24px;
    top: -30px;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background:
        radial-gradient(circle, color-mix(in srgb, var(--stat-accent) 18%, transparent) 0%, transparent 72%);
    opacity: 0.9;
    pointer-events: none;
    z-index: 0;
}
.stat-card > * {
    position: relative;
    z-index: 1;
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.16); box-shadow: var(--shadow-elevated); }
.hover-clickable { cursor: pointer; }

.stat-card .stat-label {
    font-size: 0.76rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.stat-card .stat-value {
    font-size: 1.88rem;
    font-weight: 700;
    letter-spacing: -0.045em;
    font-variant-numeric: tabular-nums;
}

.stat-card .stat-sub {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: 0.32rem;
}

.stat-color-blue { --stat-accent: var(--blue); }
.stat-color-green { --stat-accent: var(--green); }
.stat-color-purple { --stat-accent: var(--purple); }
.stat-color-orange { --stat-accent: var(--orange); }
.stat-color-blue .stat-value { color: color-mix(in srgb, var(--blue) 78%, var(--text-primary)); }
.stat-color-green .stat-value { color: color-mix(in srgb, var(--green) 76%, var(--text-primary)); }
.stat-color-purple .stat-value { color: color-mix(in srgb, var(--purple) 74%, var(--text-primary)); }
.stat-color-orange .stat-value { color: color-mix(in srgb, var(--orange) 78%, var(--text-primary)); }

body[data-theme="light"] .stat-card {
    background:
        linear-gradient(180deg, rgba(248,249,250,0.9), rgba(239,242,246,0.88) 100%);
    border-color: rgba(17, 24, 39, 0.065);
    box-shadow:
        0 12px 28px rgba(17, 24, 39, 0.055),
        inset 0 1px 0 rgba(255,255,255,0.68);
}

body[data-theme="light"] .stat-card::before {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.1) 34%, transparent 100%);
}

body[data-theme="light"] .stat-card::after {
    background:
        radial-gradient(circle, color-mix(in srgb, var(--stat-accent) 24%, transparent) 0%, transparent 74%);
    opacity: 1;
}

body[data-theme="light"] .stat-card:hover {
    border-color: rgba(0, 113, 227, 0.12);
    box-shadow:
        0 16px 36px rgba(17, 24, 39, 0.07),
        inset 0 1px 0 rgba(255,255,255,0.78);
}

body[data-theme="light"] .stat-color-blue .stat-value { color: #2f5f99; }
body[data-theme="light"] .stat-color-green .stat-value { color: #4d7758; }
body[data-theme="light"] .stat-color-purple .stat-value { color: #695a95; }
body[data-theme="light"] .stat-color-orange .stat-value { color: #9f6a32; }

/* ─── Card Component ─── */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h2 {
    font-size: 0.97rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.42rem;
    letter-spacing: -0.015em;
}

.card-header h2,
.login-card .logo-icon,
.disclaimer-icon {
    filter: saturate(0.7) contrast(0.96);
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    padding: 0.62rem 1.02rem;
    border: none;
    border-radius: 100px;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn:active { transform: scale(0.96) translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-blue { background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(10,132,255,0.22); }
.btn-blue:hover { background: var(--blue-hover); transform: translateY(-1px); box-shadow: 0 12px 24px rgba(10,132,255,0.28); }

body[data-theme="light"] .btn-blue {
    box-shadow: 0 8px 18px rgba(0, 113, 227, 0.16);
}

body[data-theme="light"] .btn-blue:hover {
    box-shadow: 0 12px 24px rgba(0, 113, 227, 0.2);
}

.btn-green { background: var(--green); color: #000; }
.btn-green:hover { filter: brightness(1.1); }

.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { filter: brightness(1.1); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    box-shadow: none;
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }

.btn-sm { padding: 0.42rem 0.8rem; font-size: 0.78rem; }

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ─── Inputs ─── */
.form-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.72rem 0.92rem;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
}
.form-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
}

body[data-theme="light"] .form-input:focus,
body[data-theme="light"] .login-form input:focus {
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}
.form-input::placeholder { color: var(--text-tertiary); }
.form-input option,
select.form-input option {
    background: #161618;
    color: var(--text-primary);
}

.form-input-compact {
    padding: 0.46rem 0.72rem;
    font-size: 0.78rem;
}

.form-input-rich {
    min-height: 48px;
    border-radius: var(--radius-md);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
        var(--bg-input);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.form-input-mono {
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    resize: vertical;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2rem;
}

.form-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group { display: flex; flex-direction: column; }

/* ─── Toggle Switch (Apple Style) ─── */
.toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.toggle input { display: none; }
.toggle-track {
    width: 42px;
    height: 26px;
    background: rgba(120, 120, 128, 0.32);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s;
    flex-shrink: 0;
}
.toggle-track::after {
    content: '';
    position: absolute;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #fff;
    top: 2px; left: 2px;
    transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.6, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle input:checked + .toggle-track { background: var(--green); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }

/* ─── Badge / Tag ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.badge-blue { background: rgba(10,132,255,0.15); color: var(--blue); }
.badge-green { background: rgba(48,209,88,0.15); color: var(--green); }
.badge-red { background: rgba(255,69,58,0.15); color: var(--red); }
.badge-orange { background: rgba(255,159,10,0.15); color: var(--orange); }
.badge-purple { background: rgba(191,90,242,0.15); color: var(--purple); }
.badge-gray { background: rgba(142,142,147,0.15); color: rgba(235,235,245,0.5); }

/* xlsx target selector */
.xlsx-target.active {
    background: var(--blue) !important;
    color: #fff !important;
    border-color: var(--blue) !important;
}

/* ═══════════════════════════════════════════════════════════
   ACCOUNTS TAB
   ═══════════════════════════════════════════════════════════ */

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-bottom: 1.35rem;
}

.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 0.5rem; }

.queue-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.drift-panel {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.18rem 0 0.18rem 0.2rem;
}

.drift-label {
    font-size: 0.76rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.segmented-control {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.segmented-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
}

.segmented-btn:hover {
    color: var(--text-primary);
}

.segmented-btn.active {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

body[data-theme="light"] .segmented-control {
    background: rgba(255,255,255,0.44);
    border-color: rgba(17, 24, 39, 0.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

body[data-theme="light"] .segmented-btn.active,
body[data-theme="light"] .log-tab.active {
    background: rgba(255,255,255,0.78);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.94),
        0 6px 14px rgba(17, 24, 39, 0.04);
}

.track-select-panel {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1rem 1.05rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
        rgba(255,255,255,0.02);
    box-shadow: var(--shadow-card);
}

.track-select-main {
    display: flex;
    align-items: flex-end;
    gap: 0.8rem;
}

.track-upload-btn {
    align-self: stretch;
    min-height: 44px;
    padding-inline: 1rem;
}

.track-select-hint {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.auto-refill-panel {
    padding: 0.6rem 0.8rem;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-sm);
}

.auto-refill-title {
    font-size: 0.85rem;
    font-weight: 500;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.1rem;
}

.slot-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.18rem;
    display: flex;
    flex-direction: column;
    gap: 0.76rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.slot-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.14); box-shadow: var(--shadow-elevated); }
.slot-card.is-disabled {
    opacity: 0.72;
    border-color: rgba(255,255,255,0.05);
}
.slot-card.is-disabled .status-line {
    background: rgba(255,255,255,0.12);
    box-shadow: none;
}

.slot-card .status-line {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: var(--text-tertiary);
    transition: background 0.5s, box-shadow 0.5s;
}
.slot-card.s-ok .status-line { background: var(--green); box-shadow: 0 0 12px rgba(48,209,88,0.4); }
.slot-card.s-run .status-line { background: var(--blue); box-shadow: 0 0 12px rgba(10,132,255,0.5); animation: pulse-glow 1.5s infinite alternate; }
.slot-card.s-err .status-line { background: var(--red); }
.slot-card.s-skip .status-line { background: var(--orange); }

@keyframes pulse-glow {
    from { box-shadow: 0 0 6px rgba(10,132,255,0.3); }
    to { box-shadow: 0 0 18px rgba(10,132,255,0.7); }
}

.slot-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
.slot-head h3 { font-size: 0.96rem; font-weight: 600; }

.slot-head-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.slot-enabled {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.slot-enabled input {
    accent-color: var(--blue);
}

.slot-password-hint {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: -0.15rem;
}

.slot-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}
.slot-form .full-width { grid-column: span 2; }
.slot-form .form-input { padding: 0.5rem 0.7rem; font-size: 0.85rem; }

.slot-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: auto; }

/* ─── Config Card (settings) ─── */
.config-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.2rem;
}

.form-group-fill {
    flex: 1;
}

.form-group-min-100 {
    min-width: 100px;
}

.btn-flex-fill {
    flex: 1;
}

.sch-grid-span-2 {
    grid-column: span 2;
}

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

.sr-only,
.file-input-hidden-wrap input[type="file"],
.track-upload-btn input[type="file"] {
    display: none;
}

/* ═══════════════════════════════════════════════════════════
   SCHEDULER TAB
   ═══════════════════════════════════════════════════════════ */

.sch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem;
}

.sch-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin: 1rem 0;
}

.sch-stat-item {
    background: rgba(0,0,0,0.25);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
}
.sch-stat-item .label { font-size: 0.7rem; color: var(--text-tertiary); margin-bottom: 0.15rem; }
.sch-stat-item .value { font-size: 0.92rem; font-weight: 600; }

.scheduler-status-bar {
    margin-top: 1rem;
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--text-primary) 3%, transparent), transparent),
        var(--theme-surface);
}

.scheduler-status-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.72rem;
    flex-wrap: wrap;
}

.scheduler-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.42rem 0.78rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.scheduler-status-chip-idle {
    background: rgba(255, 159, 10, 0.12);
    border-color: rgba(255, 159, 10, 0.18);
    color: var(--orange);
}

.scheduler-status-chip-running {
    background: rgba(48, 209, 88, 0.14);
    border-color: rgba(48, 209, 88, 0.18);
    color: var(--green);
}

.scheduler-status-chip-off {
    background: var(--theme-surface);
    border-color: var(--border);
    color: var(--text-secondary);
}

.scheduler-status-chip-time {
    background: var(--theme-accent-soft);
    border-color: rgba(10, 132, 255, 0.18);
    color: var(--blue);
}

.scheduler-status-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.35rem;
}

.scheduler-status-label {
    font-size: 0.74rem;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.scheduler-status-value {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.scheduler-status-sub {
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.time-inputs input {
    width: 60px;
    text-align: center;
}
.time-inputs .sep { font-size: 1.2rem; font-weight: 600; color: var(--text-tertiary); }

/* ═══════════════════════════════════════════════════════════
   HISTORY TAB
   ═══════════════════════════════════════════════════════════ */

.hist-login-row {
    display: grid;
    grid-template-columns: 1.5fr 2fr 2fr auto;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 430px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.data-table th {
    position: sticky;
    top: 0;
    background: rgba(28,28,30,0.95);
    backdrop-filter: blur(10px);
    padding: 0.76rem 0.82rem;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.76rem;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 0.68rem 0.82rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.progress-wrap { width: 100%; height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; margin-top: 0.8rem; }
.progress-fill { height: 100%; background: var(--blue); border-radius: 2px; transition: width 0.3s; width: 0%; }

/* ═══════════════════════════════════════════════════════════
   TERMINAL / LOGS TAB
   ═══════════════════════════════════════════════════════════ */

.log-tabs-bar {
    display: flex;
    gap: 0.15rem;
    margin-bottom: 1rem;
    padding: 3px;
    background: rgba(118, 118, 128, 0.12);
    border-radius: var(--radius-sm);
    width: fit-content;
}

.log-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 0.9rem;
    border-radius: calc(var(--radius-sm) - 2px);
    cursor: pointer;
    transition: var(--transition);
}
.log-tab:hover { color: var(--text-primary); }
.log-tab.active {
    background: rgba(255,255,255,0.12);
    color: var(--text-primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.terminal {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    height: 520px;
    overflow-y: auto;
    padding: 1rem;
    font-family: 'SF Mono', 'JetBrains Mono', 'Menlo', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(212, 212, 216, 0.9);
}
.terminal p {
    margin-bottom: 2px;
    word-break: break-all;
}

.terminal-placeholder {
    color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════ */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: var(--bg-elevated);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.3rem;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-elevated);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }
.toast-info { border-left: 3px solid var(--blue); }

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show { display: flex; }

.modal-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 440px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-elevated);
    animation: cardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow-x: hidden;
}

.modal-box::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 88px;
    background: linear-gradient(180deg, rgba(255,255,255,0.07), transparent 100%);
    pointer-events: none;
}

.stats-modal-box {
    width: min(760px, 92vw);
    max-width: min(760px, 92vw);
    padding: 1.35rem;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015)),
        var(--bg-elevated);
}

body[data-theme="light"] .modal-overlay {
    background: rgba(236, 240, 246, 0.58);
    backdrop-filter: blur(18px);
}

body[data-theme="light"] .modal-box {
    background:
        linear-gradient(180deg, rgba(247,248,250,0.94), rgba(239,243,247,0.93)),
        var(--bg-elevated);
    border-color: rgba(17, 24, 39, 0.065);
    box-shadow:
        0 20px 52px rgba(17, 24, 39, 0.09),
        inset 0 1px 0 rgba(255,255,255,0.72);
}

body[data-theme="light"] .modal-box::before {
    height: 104px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.2) 48%, transparent 100%);
}

body[data-theme="light"] .stats-modal-box,
body[data-theme="light"] .disclaimer-modal-box {
    background:
        linear-gradient(180deg, rgba(247,248,250,0.94), rgba(239,243,247,0.93)),
        var(--bg-elevated);
}

.stats-modal-header {
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

body[data-theme="light"] .stats-modal-header {
    border-bottom-color: rgba(15, 23, 42, 0.08);
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.75);
}

.stats-modal-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stats-modal-title h2 {
    margin: 0;
}

.stats-filter-select {
    width: 124px;
    min-width: 124px;
    border-radius: 14px;
    border-color: rgba(10, 132, 255, 0.45);
    background:
        linear-gradient(180deg, rgba(10,132,255,0.12), rgba(10,132,255,0.04)),
        var(--bg-input);
}

.stats-modal-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.stats-table-wrap {
    max-height: min(52vh, 460px);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.015);
    scrollbar-gutter: stable;
}

body[data-theme="light"] .stats-table-wrap {
    background:
        linear-gradient(180deg, rgba(246,247,249,0.88), rgba(238,242,246,0.84));
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.76),
        0 1px 0 rgba(15, 23, 42, 0.03);
}

.disclaimer-modal-box {
    max-width: 520px;
    text-align: center;
}

.disclaimer-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
}

.disclaimer-title {
    margin-bottom: 0.8rem;
}

.disclaimer-body {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
    text-align: left;
    margin-bottom: 1.2rem;
}

.disclaimer-actions {
    justify-content: center;
}

.disclaimer-btn {
    min-width: 100px;
}

.disclaimer-btn-disabled {
    opacity: 0.4;
}

.modal-box h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.modal-queue-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}
.modal-queue-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.3rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER STATUS
   ═══════════════════════════════════════════════════════════ */

.footer-bar {
    border-top: 1px solid var(--border);
    padding: 0.7rem 2.5rem 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════════════ */

.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.mt-1 { margin-top: 0.8rem; }
.mb-1 { margin-bottom: 0.8rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-xs { font-size: 0.75rem; }
.hidden { display: none !important; }
.hidden-by-default { display: none; }

label.upload-area {
    cursor: pointer;
}

.table-wrap-350 {
    max-height: 350px;
}

.hist-save-label {
    margin-left: 12px;
    margin-right: 4px;
}

.hist-save-suffix {
    margin-left: 4px;
}

.hist-target-input {
    width: 92px;
}

.logs-card {
    padding-bottom: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .sch-grid { grid-template-columns: 1fr; }
    .config-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    html { font-size: 14px; }
    .content { padding: 1.15rem 1rem 2rem; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .slots-grid { grid-template-columns: 1fr; }
    .legal-banner { padding: 0.45rem 1rem; font-size: 0.66rem; line-height: 1.45; }
    .top-bar {
        padding: 0.8rem 1rem;
        align-items: flex-start;
        grid-template-columns: 1fr;
    }
    .top-bar .brand,
    .top-bar .user-menu {
        min-height: 32px;
    }
    .nav-center,
    .nav-side,
    .nav-side-right {
        width: 100%;
    }
    .nav-side-right {
        justify-content: flex-start;
    }
    .top-bar .nav-links {
        display: flex;
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.15rem;
    }
    .top-bar .nav-link {
        flex: 0 0 auto;
        padding: 0.7rem 0.95rem;
    }
    .hist-login-row { grid-template-columns: 1fr; }
    .slot-form { grid-template-columns: 1fr; }
    .slot-form .full-width { grid-column: span 1; }
    .slot-head { align-items: flex-start; flex-direction: column; }
    .slot-head-meta { width: 100%; justify-content: space-between; }
    .toolbar-left, .toolbar-right, .queue-info { width: 100%; flex-wrap: wrap; }
    .footer-bar { padding: 0.75rem 1rem 1rem; }
    .track-select-main { flex-direction: column; align-items: stretch; }
    .stats-modal-meta { align-items: flex-start; }
    .stats-modal-box { padding: 1rem; }
    .sch-grid-span-2 { grid-column: span 1; }
    .drift-panel { width: 100%; justify-content: space-between; padding-left: 0; }
    .scheduler-status-main { align-items: flex-start; flex-direction: column; }
    .scheduler-status-top { align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════
   DATA TABLE (xlsx CRUD)
   ═══════════════════════════════════════════════════════════ */
.table-wrap {
    overflow-y: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.015);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.data-table th,
.data-table td {
    padding: 0.45rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
}
.data-table thead th {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)),
        rgba(255,255,255,0.04);
    position: sticky; top: 0; z-index: 2;
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.06),
        inset 0 -1px 0 rgba(255,255,255,0.04);
}
.data-table tbody tr:hover {
    background: rgba(10,132,255,0.06);
}
.data-table thead th + th {
    box-shadow:
        inset 1px 0 0 rgba(255,255,255,0.03),
        inset 0 1px 0 rgba(255,255,255,0.06),
        inset 0 -1px 0 rgba(255,255,255,0.04);
}
body[data-theme="light"] .table-wrap {
    background:
        linear-gradient(180deg, rgba(245,246,248,0.88), rgba(237,240,244,0.84));
    border-color: rgba(17, 24, 39, 0.065);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.72),
        0 8px 18px rgba(17, 24, 39, 0.04);
}
body[data-theme="light"] .data-table th,
body[data-theme="light"] .data-table td {
    border-bottom-color: rgba(15, 23, 42, 0.06);
}
body[data-theme="light"] .data-table thead th {
    background:
        linear-gradient(180deg, rgba(246,247,249,0.94), rgba(234,238,243,0.92));
    color: rgba(29, 29, 31, 0.48);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.74),
        inset 0 -1px 0 rgba(17, 24, 39, 0.055);
}
body[data-theme="light"] .data-table thead th + th {
    box-shadow:
        inset 1px 0 0 rgba(17, 24, 39, 0.045),
        inset 0 1px 0 rgba(255,255,255,0.74),
        inset 0 -1px 0 rgba(17, 24, 39, 0.055);
}
body[data-theme="light"] .data-table tbody tr:hover {
    background: rgba(10,132,255,0.05);
}
.data-table input[type="checkbox"] {
    cursor: pointer;
}
.text-center { text-align: center; }
