:root {
    --bg: #070a13;
    --bg-soft: #0c1120;
    --panel: rgba(17, 24, 43, .82);
    --panel-strong: #131a2d;
    --panel-light: #19223a;
    --line: rgba(255, 255, 255, .09);
    --line-strong: rgba(255, 255, 255, .15);
    --text: #f7f8fc;
    --muted: #929db4;
    --accent: #806bff;
    --accent-light: #a99bff;
    --cyan: #41d9d2;
    --green: #53e6a5;
    --amber: #f8bd57;
    --red: #ff667f;
    --shadow: 0 30px 80px rgba(0, 0, 0, .38);
    --radius: 24px;
    --radius-small: 14px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 5%, rgba(128, 107, 255, .13), transparent 28rem),
        radial-gradient(circle at 88% 25%, rgba(65, 217, 210, .08), transparent 30rem),
        var(--bg);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; }

::selection { background: rgba(128, 107, 255, .45); color: #fff; }

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    min-height: 78px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 30px;
    padding: 12px clamp(20px, 4vw, 64px);
    border-bottom: 1px solid var(--line);
    background: rgba(7, 10, 19, .78);
    backdrop-filter: blur(22px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 20px; letter-spacing: -.02em; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.brand-mark {
    position: relative;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: inline-block;
    border: 2px solid var(--accent-light);
    border-radius: 50%;
    box-shadow: 0 0 24px rgba(128, 107, 255, .3), inset 0 0 18px rgba(128, 107, 255, .12);
}
.brand-mark::before, .brand-mark::after, .brand-mark span::before {
    position: absolute;
    left: 50%;
    top: 50%;
    content: "";
    width: 2px;
    border-radius: 2px;
    background: var(--accent-light);
    transform-origin: 50% 100%;
}
.brand-mark::before { height: 10px; transform: translate(-50%, -100%) rotate(0deg); }
.brand-mark::after { height: 8px; transform: translate(-50%, -100%) rotate(120deg); }
.brand-mark span::before { width: 5px; height: 5px; transform: translate(-50%, -50%); border-radius: 50%; }

.main-nav { display: flex; justify-content: center; gap: 6px; }
.main-nav a {
    position: relative;
    padding: 10px 14px;
    color: var(--muted);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 650;
    transition: color .2s ease, background .2s ease;
}
.main-nav a:hover { color: var(--text); background: rgba(255, 255, 255, .045); }
.main-nav a.active { color: var(--text); background: rgba(128, 107, 255, .13); }
.main-nav a.active::after {
    position: absolute;
    left: 50%;
    bottom: -15px;
    width: 24px;
    height: 2px;
    content: "";
    background: var(--accent-light);
    border-radius: 4px;
    transform: translateX(-50%);
    box-shadow: 0 0 12px var(--accent);
}

.account { display: flex; align-items: center; gap: 10px; }
.account form { display: flex; }
.account-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 650; }
.avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(128, 107, 255, .5);
    border-radius: 50%;
    color: var(--accent-light);
    background: rgba(128, 107, 255, .14);
    font-size: 13px;
    font-weight: 800;
}

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 34px; }
.footer { padding: 24px; color: #626d84; text-align: center; font-size: 12px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.page-heading h1 { margin: 4px 0 6px; font-size: clamp(36px, 5vw, 60px); line-height: 1.04; letter-spacing: -.055em; }
.page-heading p:not(.eyebrow) { max-width: 650px; margin: 0; color: var(--muted); }
.hero-heading { margin-bottom: 38px; }
.centered-heading { justify-content: center; text-align: center; }
.centered-heading > div { display: flex; flex-direction: column; align-items: center; }
.accent-dot { color: var(--accent-light); }
.eyebrow { margin: 0 0 7px; color: var(--accent-light); font-size: 11px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
.muted { color: var(--muted); }

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 13px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 750;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { color: #fff; background: linear-gradient(135deg, #765cff, #9c74ff); box-shadow: 0 12px 30px rgba(118, 92, 255, .25); }
.button-primary:hover { box-shadow: 0 16px 38px rgba(118, 92, 255, .38); }
.button-secondary { border-color: rgba(248, 189, 87, .24); color: #ffd88c; background: rgba(248, 189, 87, .1); }
.button-ghost { border-color: var(--line); color: #c8d0e0; background: rgba(255, 255, 255, .035); }
.button-wide { width: 100%; }
.button-large { min-height: 52px; padding-inline: 26px; }
.icon-button {
    display: grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--muted);
    background: rgba(255, 255, 255, .035);
    cursor: pointer;
    font-size: 20px;
    transition: .2s ease;
}
.icon-button:hover { border-color: var(--line-strong); color: var(--text); background: rgba(255, 255, 255, .07); }
.icon-button.danger:hover { border-color: rgba(255, 102, 127, .35); color: var(--red); background: rgba(255, 102, 127, .09); }

.flash {
    width: min(760px, 100%);
    margin: 0 auto 22px;
    padding: 13px 17px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--panel-strong);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .18);
    font-size: 14px;
    transition: opacity .3s ease, transform .3s ease;
}
.flash-success { border-color: rgba(83, 230, 165, .25); color: #bdf8da; }
.flash-error { border-color: rgba(255, 102, 127, .3); color: #ffb4c0; }
.flash-warning { border-color: rgba(248, 189, 87, .3); color: #ffe0a1; }
.flash.is-hiding { opacity: 0; transform: translateY(-8px); }

.stats-grid { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); gap: 15px; margin-bottom: 22px; }
.stat-card {
    display: flex;
    min-height: 118px;
    align-items: center;
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(25, 34, 58, .82), rgba(14, 20, 36, .82));
    box-shadow: 0 14px 35px rgba(0, 0, 0, .14);
}
.stat-highlight { border-color: rgba(128, 107, 255, .25); background: linear-gradient(135deg, rgba(128, 107, 255, .19), rgba(17, 24, 43, .86)); }
.stat-icon { display: grid; width: 46px; height: 46px; flex: 0 0 auto; place-items: center; border-radius: 14px; color: var(--accent-light); background: rgba(128, 107, 255, .12); font-size: 22px; }
.stat-card div { display: flex; flex-direction: column; }
.stat-card small { color: var(--muted); font-size: 12px; font-weight: 650; }
.stat-card strong { margin-top: 5px; font-size: clamp(24px, 3vw, 34px); line-height: 1; letter-spacing: -.04em; }

.content-panel {
    padding: clamp(22px, 3vw, 32px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-title h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.text-link { color: var(--accent-light); font-size: 13px; font-weight: 750; }

.task-list { display: flex; flex-direction: column; }
.task-row {
    display: grid;
    grid-template-columns: auto 1fr auto minmax(90px, auto) auto;
    align-items: center;
    gap: 15px;
    padding: 17px 6px;
    border-top: 1px solid var(--line);
    transition: background .2s ease, transform .2s ease;
}
.task-row:first-child { border-top: 0; }
.task-row:hover { margin-inline: -10px; padding-inline: 16px; border-radius: 14px; background: rgba(255, 255, 255, .035); transform: translateX(2px); }
.task-main { display: flex; min-width: 0; flex-direction: column; }
.task-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.task-main small, .task-date { color: var(--muted); font-size: 12px; }
.task-duration { font-variant-numeric: tabular-nums; font-weight: 750; text-align: right; }
.row-arrow { color: #536079; font-size: 25px; }

.status-dot { width: 9px; height: 9px; display: inline-block; flex: 0 0 auto; border-radius: 50%; }
.status-dot.running { background: var(--green); box-shadow: 0 0 12px rgba(83, 230, 165, .7); animation: breathe 2s infinite; }
.status-dot.paused { background: var(--amber); }
.status-dot.done { background: #69758d; }
.badge { display: inline-flex; width: fit-content; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.badge-running { color: #9af3ca; background: rgba(83, 230, 165, .1); }
.badge-paused { color: #ffd88c; background: rgba(248, 189, 87, .1); }
.badge-done { color: #a7b0c2; background: rgba(146, 157, 180, .1); }

.empty-state { display: flex; min-height: 270px; align-items: center; justify-content: center; flex-direction: column; padding: 35px; text-align: center; }
.empty-state h3 { margin: 10px 0 5px; font-size: 22px; }
.empty-state p { max-width: 420px; margin: 0 0 20px; color: var(--muted); }
.empty-icon { display: grid; width: 60px; height: 60px; place-items: center; border: 1px solid rgba(128, 107, 255, .3); border-radius: 20px; color: var(--accent-light); background: rgba(128, 107, 255, .1); font-size: 28px; }

.two-column-layout { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.4fr); gap: 20px; align-items: start; }
.sticky-card { position: sticky; top: 100px; }
.stack-form { display: flex; flex-direction: column; gap: 18px; }
label { display: flex; flex-direction: column; gap: 8px; color: #cbd2e1; font-size: 13px; font-weight: 700; }
input, select {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    outline: 0;
    border-radius: 13px;
    color: var(--text);
    background: rgba(7, 10, 19, .6);
    transition: border .2s ease, box-shadow .2s ease, background .2s ease;
}
input::placeholder { color: #5e6980; }
input:focus, select:focus { border-color: var(--accent); background: rgba(9, 13, 25, .92); box-shadow: 0 0 0 4px rgba(128, 107, 255, .12); }
select { cursor: pointer; }
.client-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.client-card { display: flex; align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255, 255, 255, .025); }
.client-monogram { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: var(--cyan); background: rgba(65, 217, 210, .1); font-weight: 850; }
.client-details { min-width: 0; flex: 1; }
.client-details h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.client-details p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.inline-form { display: flex; }

.form-card { width: min(800px, 100%); margin: 0 auto; }
.task-form { display: flex; flex-direction: column; gap: 24px; }
.field-large input { min-height: 58px; font-size: 17px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-action-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-action-row p { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--muted); font-size: 12px; }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(83, 230, 165, .1); }

.filter-tabs { display: flex; width: fit-content; max-width: 100%; gap: 5px; margin: 0 0 22px; padding: 5px; overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; background: rgba(17, 24, 43, .66); }
.filter-tabs a { display: flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 10px; color: var(--muted); font-size: 12px; font-weight: 750; white-space: nowrap; }
.filter-tabs a span { display: grid; min-width: 20px; height: 20px; place-items: center; padding: 0 5px; border-radius: 7px; background: rgba(255, 255, 255, .05); font-size: 10px; }
.filter-tabs a.active { color: var(--text); background: rgba(128, 107, 255, .16); }

.task-cards { display: grid; gap: 14px; }
.task-card { position: relative; overflow: hidden; padding: 22px 24px; border: 1px solid var(--line); border-radius: 21px; background: linear-gradient(145deg, rgba(22, 30, 51, .88), rgba(12, 17, 31, .9)); box-shadow: 0 18px 42px rgba(0, 0, 0, .18); }
.task-card::before { position: absolute; inset: 0 auto 0 0; width: 3px; content: ""; background: #5d687d; }
.task-card.task-running::before { background: var(--green); box-shadow: 0 0 18px var(--green); }
.task-card.task-paused::before { background: var(--amber); }
.task-card-top, .task-card-body, .task-actions { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.task-card-top { margin-bottom: 15px; }
.task-card-body { padding-bottom: 20px; }
.task-card-body h2 { margin: 2px 0 0; font-size: clamp(19px, 2.5vw, 27px); letter-spacing: -.035em; }
.task-client { margin: 0; color: var(--accent-light); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.big-duration { flex: 0 0 auto; font-size: clamp(23px, 3vw, 35px); font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: -.04em; }
.task-actions { padding-top: 16px; border-top: 1px solid var(--line); }
.primary-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.primary-actions form { display: flex; }

.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; overflow-x: hidden; }
.auth-shell { width: min(1100px, 100%); }
.login-card { display: grid; min-height: min(700px, calc(100vh - 48px)); grid-template-columns: 1.12fr .88fr; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 32px; background: rgba(13, 18, 33, .9); box-shadow: 0 40px 120px rgba(0, 0, 0, .55); }
.login-visual { position: relative; display: flex; justify-content: flex-end; flex-direction: column; overflow: hidden; padding: clamp(38px, 6vw, 72px); background: linear-gradient(150deg, #11162b 0%, #171638 54%, #111a2e 100%); isolation: isolate; }
.login-visual::after { position: absolute; z-index: -1; inset: 0; content: ""; opacity: .14; background-image: linear-gradient(rgba(255,255,255,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.1) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, #000, transparent 75%); }
.login-visual h1 { max-width: 620px; margin: 7px 0 18px; font-size: clamp(46px, 6vw, 76px); line-height: .98; letter-spacing: -.065em; }
.login-visual > p:not(.eyebrow) { max-width: 540px; margin: 0; color: #abb4c8; font-size: 16px; }
.visual-metric { display: flex; align-items: center; gap: 11px; margin-top: 36px; color: #d9deeb; font-size: 12px; }
.hero-clock { position: absolute; z-index: -1; top: 10%; right: -6%; width: min(30vw, 360px); aspect-ratio: 1; border: 2px solid rgba(169, 155, 255, .34); border-radius: 50%; box-shadow: 0 0 100px rgba(128, 107, 255, .23), inset 0 0 80px rgba(65, 217, 210, .06); }
.hero-clock::before, .hero-clock::after { position: absolute; left: 50%; top: 50%; content: ""; width: 4px; border-radius: 3px; background: linear-gradient(var(--accent-light), var(--cyan)); transform-origin: 50% 100%; }
.hero-clock::before { height: 31%; transform: translate(-50%, -100%) rotate(28deg); }
.hero-clock::after { height: 23%; transform: translate(-50%, -100%) rotate(126deg); }
.hero-clock span { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 0 24px var(--accent); }
.orb { position: absolute; z-index: -2; border-radius: 50%; filter: blur(2px); }
.orb-one { top: -18%; left: -20%; width: 450px; height: 450px; background: radial-gradient(circle, rgba(128, 107, 255, .3), transparent 68%); }
.orb-two { right: -20%; bottom: -30%; width: 500px; height: 500px; background: radial-gradient(circle, rgba(65, 217, 210, .15), transparent 68%); }
.login-form-panel { display: flex; justify-content: center; flex-direction: column; padding: clamp(34px, 5vw, 70px); background: rgba(9, 13, 24, .73); }
.login-form-panel h2 { margin: 4px 0 3px; font-size: 34px; letter-spacing: -.045em; }
.login-form-panel > .muted { margin: 0 0 28px; font-size: 13px; }
.login-footnote { margin: 20px 0 0; color: #657087; font-size: 10px; text-align: center; }
.mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 36px; }

@keyframes breathe { 0%, 100% { transform: scale(.9); opacity: .8; } 50% { transform: scale(1.12); opacity: 1; } }

@media (max-width: 960px) {
    .topbar { grid-template-columns: auto 1fr; gap: 16px; }
    .main-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; padding-bottom: 3px; }
    .main-nav a.active::after { bottom: -4px; }
    .account { justify-self: end; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .two-column-layout { grid-template-columns: 1fr; }
    .sticky-card { position: static; }
    .login-card { min-height: 650px; grid-template-columns: 1fr 1fr; }
    .login-visual { padding: 42px; }
    .login-visual h1 { font-size: 52px; }
}

@media (max-width: 720px) {
    .auth-page { padding: 0; }
    .login-card { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
    .login-visual { display: none; }
    .login-form-panel { padding: 36px 24px; }
    .mobile-brand { display: flex; }
    .topbar { position: relative; padding: 14px 18px; }
    .brand small, .account-name { display: none; }
    .main-nav { margin-inline: -18px; padding-inline: 18px; }
    .main-nav a { padding: 9px 11px; font-size: 12px; }
    .page-shell { width: min(100% - 26px, 1180px); padding-top: 35px; }
    .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 25px; }
    .page-heading h1 { font-size: 39px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { min-height: 100px; gap: 11px; padding: 16px; }
    .stat-icon { width: 38px; height: 38px; border-radius: 11px; font-size: 18px; }
    .stat-card strong { font-size: 23px; }
    .content-panel { padding: 20px; border-radius: 20px; }
    .task-row { grid-template-columns: auto 1fr auto; }
    .task-row .badge, .task-row .row-arrow { display: none; }
    .task-duration { grid-column: 2 / 4; text-align: left; color: var(--muted); font-size: 12px; }
    .client-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-action-row { align-items: stretch; flex-direction: column; }
    .form-action-row .button { width: 100%; }
    .task-card { padding: 19px; }
    .task-card-body { align-items: flex-start; flex-direction: column; gap: 12px; }
    .task-card-top { align-items: flex-start; }
    .task-date { text-align: right; }
    .task-actions { align-items: flex-end; }
    .primary-actions { flex: 1; }
    .primary-actions .button { padding-inline: 12px; font-size: 12px; }
}

@media (max-width: 430px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: 86px; }
    .section-title { align-items: flex-start; flex-direction: column; }
    .task-actions { align-items: stretch; flex-direction: column; }
    .task-actions > form:last-child { align-self: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
