:root {
    --ink: #0b1220;
    --muted: #667085;
    --paper: #f4f7f6;
    --card: #ffffff;
    --mint: #29d3a2;
    --mint-dark: #087f65;
    --amber: #ffbf69;
    --danger: #d92d20;
    --line: #dce5e2;
    --shadow: 0 24px 70px rgba(11, 18, 32, .11);
    --radius: 22px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% 0, #d7fff2 0, transparent 35%), var(--paper); }
a { color: var(--mint-dark); font-weight: 700; text-decoration: none; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.8rem); line-height: 1.02; letter-spacing: -.05em; }
input, button { font: inherit; }
input { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: .92rem 1rem; background: #fff; color: var(--ink); }
input:focus { outline: 3px solid rgba(41, 211, 162, .24); border-color: var(--mint-dark); }
label { font-size: .9rem; font-weight: 800; }

.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); font-size: 1.18rem; }
.brand-mark { width: 2.25rem; height: 2.25rem; display: inline-grid; place-items: center; border-radius: 12px; color: var(--ink); background: var(--mint); font-weight: 900; }
.eyebrow { color: var(--mint-dark); text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 900; }
.hint, small { color: var(--muted); }
.stack { display: grid; gap: .75rem; }
.button { border: 0; border-radius: 13px; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: .75rem 1.15rem; font-weight: 850; cursor: pointer; }
.button-primary { background: var(--ink); color: #fff; }
.button-primary:hover { background: #17243d; }
.button-secondary { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.alert, .toast { border-radius: 13px; padding: .85rem 1rem; margin: .8rem 0; }
.alert-error, .toast-error { background: #fff0ee; color: #9f241b; }
.alert-success, .toast-success { background: #e8fff7; color: #08654f; }
.toast-warning { background: #fff7df; color: #76520b; }
.toast { position: fixed; z-index: 50; top: 1rem; right: 1rem; box-shadow: var(--shadow); }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; }
.auth-card { width: min(100%, 430px); padding: clamp(1.5rem, 4vw, 2.6rem); border: 1px solid rgba(255,255,255,.8); border-radius: 28px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.auth-card.wide { width: min(100%, 560px); }
.auth-card .brand { margin-bottom: 2.8rem; }
.auth-footer { margin: 1.4rem 0 0; text-align: center; color: var(--muted); }
.back-link { display: inline-block; margin-bottom: 2rem; }
.page-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 3rem 0; }
.page-shell.narrow { width: min(820px, calc(100% - 2rem)); }
.page-header, .topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-grid { display: grid; gap: 1rem; }
.organization-card { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.organization-card h2 { margin-bottom: .25rem; }
.organization-card p { margin: 0; color: var(--muted); }
.empty-state { padding: 3rem; text-align: center; background: #fff; border-radius: var(--radius); }

.topbar { min-height: 74px; padding: .8rem clamp(1rem, 4vw, 3rem); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.82); backdrop-filter: blur(16px); }
.organization-switcher { display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; border-radius: 12px; background: var(--paper); }
.organization-switcher a { font-size: .8rem; }
.dashboard { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; }
.clock-hero { min-height: 430px; display: grid; place-items: center; align-content: center; padding: 2rem; text-align: center; border-radius: 32px; color: #fff; background: linear-gradient(145deg, #0b1220, #13294a); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.clock-hero::after { content: ""; position: absolute; width: 280px; height: 280px; right: -100px; top: -100px; border-radius: 50%; background: rgba(41,211,162,.22); }
.clock-hero .eyebrow { color: var(--mint); }
.status-orb { display: inline-flex; gap: .5rem; align-items: center; padding: .45rem .8rem; border-radius: 999px; background: rgba(255,255,255,.1); font-weight: 750; }
.status-orb span { width: .6rem; height: .6rem; border-radius: 50%; background: var(--mint); }
.clock-time { margin: .25rem 0 .75rem; color: #d6e2f0; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.work-timers { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin: 0 0 1.4rem; }
.work-timer { min-width: 150px; padding: .75rem 1rem; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; background: rgba(255,255,255,.07); }
.work-timer strong { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.work-timer span { display: block; margin-top: .2rem; color: #d6e2f0; font-size: .78rem; }
.work-timer-primary strong { color: var(--mint); font-size: clamp(2rem, 7vw, 3.35rem); }
.clock-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; position: relative; z-index: 1; }
.clock-button { min-width: 160px; min-height: 58px; border: 0; border-radius: 18px; padding: 1rem 1.5rem; font-weight: 900; cursor: pointer; }
.clock-button-start, .clock-button-pause_end { background: var(--mint); color: var(--ink); }
.clock-button-pause_start { background: var(--amber); color: var(--ink); }
.clock-button-stop { background: #fff; color: var(--ink); }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.metric-card { padding: 1.35rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.metric-card span, .metric-card small { display: block; }
.metric-card strong { display: block; margin: .4rem 0; font-size: 2rem; }

@media (max-width: 700px) {
    .topbar { flex-wrap: wrap; }
    .organization-switcher { order: 3; width: 100%; justify-content: space-between; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .organization-card { grid-template-columns: auto 1fr; }
    .organization-card form { grid-column: 1 / -1; }
    .organization-card .button { width: 100%; }
    .clock-actions, .clock-actions form, .clock-button { width: 100%; }
}
