:root {
    --ink: #1c1917;
    --muted: #57534e;
    --line: #e7e5e4;
    --paper: #fafaf9;
    --surface: #ffffff;
    --accent: #1f4d3a;
    --accent-ink: #f7f6f3;
    --danger: #9f1239;
    --focus: #1f4d3a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

a { color: var(--accent); }

h1 {
    margin: 0 0 0.4rem;
    font-size: 1.5rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}

.nav a {
    color: var(--ink);
    text-decoration: none;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
}

.nav a.is-current { background: #eceae6; }

.who {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.page {
    width: min(1080px, calc(100% - 2rem));
    margin: 1.5rem auto 3rem;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.25rem;
}

.panel-narrow { max-width: 28rem; }

.stack { display: flex; flex-direction: column; gap: 0.9rem; }

.muted { color: var(--muted); }

.tag {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--muted);
}

.field { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; }

.field input,
.field select,
.field textarea {
    font: inherit;
    font-weight: 450;
    padding: 0.65rem 0.75rem;
    border: 1px solid #d6d3d1;
    border-radius: 8px;
    background: #fff;
    width: 100%;
}

.field textarea { min-height: 6rem; resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.error { color: var(--danger); font-weight: 550; }

.alert {
    margin: 0 0 1rem;
    padding: 0.7rem 0.85rem;
    background: #ecfdf3;
    border: 1px solid #b7e4c7;
    border-radius: 8px;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-danger { background: transparent; border-color: #fecdd3; color: var(--danger); }

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
}

table { width: 100%; border-collapse: collapse; }

th, td {
    padding: 0.75rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

th { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

tr:last-child td { border-bottom: 0; }

.cell-end { text-align: right; }

.inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) auto;
    gap: 0.75rem;
    align-items: end;
    margin: 0 0 1rem;
}

.inline-form.cols-2 { grid-template-columns: minmax(0, 1fr) auto; }

.inline-form .error { grid-column: 1 / -1; }

@media (max-width: 767px) {
    .inline-form,
    .inline-form.cols-2 { grid-template-columns: 1fr; }
}

.filters { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.filters a { color: var(--ink); text-decoration: none; padding: 0.3rem 0.7rem; border-radius: 999px; border: 1px solid var(--line); }
.filters a.is-current { background: #eceae6; }

.split {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
    align-items: start;
}

.clock-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #14261e;
    color: #f7f6f3;
    border-radius: 12px;
}

.clock-bar p { margin: 0.2rem 0 0; }

.elapsed {
    font-variant-numeric: tabular-nums;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0.35rem 0 0;
}

.list { list-style: none; margin: 0; padding: 0; }

.list li + li { border-top: 1px solid var(--line); }

.check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.list a, .row-link {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    color: inherit;
    text-decoration: none;
}

@media (max-width: 767px) {
    .topbar { flex-wrap: wrap; }
    .who { width: 100%; justify-content: space-between; }
    .split { grid-template-columns: 1fr; }
    .page-head { align-items: stretch; flex-direction: column; }
    .btn-phone { width: 100%; }
    .clock-bar { position: sticky; top: 0; z-index: 2; align-items: stretch; flex-direction: column; }
}
