:root {
    --paper: #efece4;
    --card: rgba(255, 252, 247, 0.94);
    --ink: #14211b;
    --ink-soft: #3c4f46;
    --muted: #5d6e66;
    --line: rgba(20, 33, 27, 0.1);
    --forest: #0c3b28;
    --forest-deep: #08261b;
    --leaf: #1c7a46;
    --mint: #e7f4ec;
    --terra: #b64e28;
    --terra-deep: #8d3518;
    --brass: #a68456;
    --shadow: 0 18px 44px rgba(16, 39, 28, 0.07);
    --sidebar: 284px;
    --serif: "Fraunces", "Palatino Linotype", Palatino, serif;
    --sans: "Outfit", "Segoe UI", sans-serif;
    color-scheme: light;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    background-color: var(--paper);
    background-image:
        radial-gradient(rgba(20, 33, 27, 0.035) 0.65px, transparent 0.65px),
        radial-gradient(920px 440px at 100% -8%, rgba(28, 122, 70, 0.13), transparent 52%),
        radial-gradient(720px 420px at -8% 108%, rgba(182, 78, 40, 0.1), transparent 48%);
    background-size: 4px 4px, auto, auto;
}

button,
input {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

::selection {
    background: #cfe8d8;
    color: var(--forest);
}

.skip {
    position: absolute;
    left: 12px;
    top: -48px;
    z-index: 50;
    background: white;
    color: var(--forest);
    padding: 8px 12px;
    border-radius: 999px;
}

.skip:focus {
    top: 12px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.icon {
    width: 1.2rem;
    height: 1.2rem;
    display: block;
    flex: none;
}

.shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    padding: 22px 16px 16px;
    color: #f6f3ea;
    background:
        radial-gradient(520px 240px at 0% 0%, rgba(80, 176, 116, 0.28), transparent 60%),
        linear-gradient(180deg, #114833 0%, #08261b 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 4px 10px 8px;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.brand img {
    width: 138px;
    height: auto;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.brand-text strong {
    display: block;
    font-family: var(--serif);
    font-size: 1.18rem;
    font-weight: 520;
    letter-spacing: -0.03em;
    line-height: 1.18;
}

.brand-text span {
    display: block;
    margin-top: 6px;
    color: rgba(246, 243, 234, 0.62);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.16em;
}

.nav-label {
    margin: 26px 12px 8px;
    color: rgba(246, 243, 234, 0.46);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 14px;
    color: rgba(246, 243, 234, 0.78);
    text-decoration: none;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-link.is-active {
    background: rgba(255, 252, 247, 0.12);
    color: #fff;
    box-shadow: inset 3px 0 0 #b7e4c7;
}

.side-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 16px 12px 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.side-foot strong,
.side-foot a {
    display: block;
}

.side-foot strong {
    font-size: 0.92rem;
    font-weight: 600;
}

.side-foot a {
    color: rgba(246, 243, 234, 0.62);
    font-size: 0.78rem;
    text-decoration: none;
}

.side-foot a:hover {
    color: #fff;
}

.live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #8fd7ae;
    box-shadow: 0 0 0 5px rgba(143, 215, 174, 0.14);
}

.nav-scrim {
    display: none;
}

.main {
    margin-left: var(--sidebar);
    min-height: 100vh;
    padding: 26px 32px 72px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
}

.topbar-start {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-mark {
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.topbar-mark span {
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0.04em;
}

.desk-clock {
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
    font-size: 0.92rem;
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    align-items: center;
    justify-content: center;
}

.kicker {
    margin: 0 0 8px;
    color: var(--leaf);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1,
.panel h2,
.modal-card h2 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 520;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

h1 {
    font-size: clamp(2.4rem, 4.4vw, 4rem);
}

.hero-copy {
    min-width: 0;
    container-type: inline-size;
}

.hero-title {
    max-width: none;
    white-space: nowrap;
    font-size: clamp(1.2rem, 4.7cqi, 2.45rem);
    line-height: 1.05;
}

.lede {
    max-width: 48ch;
    margin: 14px 0 0;
    color: var(--ink-soft);
    font-size: 1.05rem;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 4px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.hero-frame {
    margin: 0;
    padding: 8px 8px 5px;
    background:
        linear-gradient(#fffcf7, #fffcf7) padding-box,
        linear-gradient(150deg, #1c7a46, #c2582d 72%) border-box;
    border: 1.5px solid transparent;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(11, 59, 40, 0.1);
}

.hero-frame img {
    width: 92px;
    height: auto;
    display: block;
    border-radius: 12px;
}

.hero-frame figcaption {
    margin-top: 4px;
    text-align: center;
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.main:has(.hero) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 12px;
    padding-bottom: 24px;
}

.main:has(.hero) .topbar {
    margin-bottom: 8px;
}

.day-board {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.day-board-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 2px;
}

.day-board-head h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.day-picker {
    width: min(280px, 100%);
    margin: 0;
}

.day-picker label {
    margin-bottom: 6px;
}

.day-status {
    min-height: 1.15em;
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.9rem;
}

.day-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: auto;
    min-height: 0;
}

.day-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--row-line) 42%, transparent);
    border-radius: 22px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--row-line) 18%, #f4efe4), color-mix(in srgb, var(--row-line) 8%, #efe8da));
}

.day-card {
    position: relative;
    overflow: hidden;
    min-height: 138px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px 16px 16px;
    border: 0;
    border-radius: 16px;
    background: var(--card-bg);
    color: var(--card-ink);
    text-align: center;
    box-shadow: 0 16px 32px rgba(16, 32, 24, 0.14);
}

.day-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 252, 247, 0.22);
    pointer-events: none;
}

.day-card h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5em;
    margin: 0;
    color: var(--card-ink);
    font-family: var(--sans);
    font-size: 1.02rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.day-value {
    margin: 10px 0 0;
    color: var(--figure);
    font-family: var(--serif);
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    font-weight: 560;
    letter-spacing: -0.04em;
    line-height: 1;
}

.day-eq {
    margin-right: 4px;
    font-size: 0.62em;
    font-weight: 500;
    opacity: 0.72;
}

.day-badge {
    position: absolute;
    top: 14px;
    left: 12px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
}

.day-badge svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.tone-service {
    --row-line: #1c7a46;
}

.tone-service .day-card:nth-child(1) {
    --card-bg: linear-gradient(155deg, #1d7a4c 0%, #0c3d28 100%);
    --card-ink: #f7f3ea;
    --figure: #f6e6bf;
}

.tone-service .day-card:nth-child(2) {
    --card-bg: linear-gradient(155deg, #1d5560 0%, #0d2c34 100%);
    --card-ink: #f3f8f7;
    --figure: #d7f6e6;
}

.tone-service .day-card:nth-child(3) {
    --card-bg: linear-gradient(155deg, #2f8f62 0%, #14543a 100%);
    --card-ink: #f7f3ea;
    --figure: #f3e7c4;
}

.tone-fleet {
    --row-line: #3d4d86;
}

.tone-fleet .day-card:nth-child(1) {
    --card-bg: linear-gradient(155deg, #3d4d86 0%, #1b2344 100%);
    --card-ink: #f4f6fb;
    --figure: #f3d7a1;
}

.tone-fleet .day-card:nth-child(2) {
    --card-bg: linear-gradient(155deg, #2a6f8f 0%, #143646 100%);
    --card-ink: #f3f8f7;
    --figure: #d7f3ea;
}

.tone-fleet .day-card:nth-child(3) {
    --card-bg: linear-gradient(155deg, #3d6b8a 0%, #1c3348 100%);
    --card-ink: #f4f7fb;
    --figure: #f6e6bf;
}

.tone-accounts {
    --row-line: #8a6230;
}

.tone-accounts .day-card:nth-child(1) {
    --card-bg: linear-gradient(155deg, #6d5a32 0%, #3a2c16 100%);
    --card-ink: #fbf6ea;
    --figure: #f6e6bf;
}

.tone-accounts .day-card:nth-child(2) {
    --card-bg: linear-gradient(155deg, #3f6b45 0%, #1d3a26 100%);
    --card-ink: #f4f8f2;
    --figure: #e7f6d8;
}

.tone-accounts .day-card:nth-child(3) {
    --card-bg: linear-gradient(155deg, #8a6230 0%, #4a3014 100%);
    --card-ink: #fff8ee;
    --figure: #fff1d4;
}

.tone-complaints {
    --row-line: #9a3c44;
}

.tone-complaints .day-card:nth-child(1) {
    --card-bg: linear-gradient(155deg, #9a3c44 0%, #5c1c24 100%);
    --card-ink: #fff6f4;
    --figure: #ffe1c4;
}

.tone-complaints .day-card:nth-child(2) {
    --card-bg: linear-gradient(155deg, #b64e28 0%, #6e2814 100%);
    --card-ink: #fff7f1;
    --figure: #ffe4bc;
}

.tone-complaints .day-card:nth-child(3) {
    --card-bg: linear-gradient(155deg, #7a3e55 0%, #3e1c2c 100%);
    --card-ink: #fbf4f6;
    --figure: #f8d7c8;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.kpi,
.panel {
    background: var(--card);
    border: 1px solid rgba(20, 33, 27, 0.08);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.kpi {
    position: relative;
    overflow: hidden;
    padding: 18px 18px 18px 22px;
    background: var(--card-bg);
    color: var(--card-ink);
    border-color: transparent;
    box-shadow: 0 18px 40px rgba(16, 32, 24, 0.1);
}

.kpi-forest {
    --card-bg: linear-gradient(155deg, #1d7a4c 0%, #0c3d28 100%);
    --card-ink: #f7f3ea;
    --card-value: #f6e6bf;
    --card-note: rgba(247, 243, 234, 0.76);
    --card-chip: rgba(255, 252, 247, 0.16);
    --card-chip-ink: #f7f3ea;
    --accent: #f0d48a;
}

.kpi-spruce {
    --card-bg: linear-gradient(155deg, #1d5560 0%, #0d2c34 100%);
    --card-ink: #f3f8f7;
    --card-value: #d7f6e6;
    --card-note: rgba(243, 248, 247, 0.76);
    --card-chip: rgba(255, 255, 255, 0.14);
    --card-chip-ink: #e7f8ef;
    --accent: #9ee0c8;
}

.kpi-clay {
    --card-bg: linear-gradient(155deg, #d36a3e 0%, #8e381c 100%);
    --card-ink: #fff7f1;
    --card-value: #ffe4bc;
    --card-note: rgba(255, 247, 241, 0.8);
    --card-chip: rgba(255, 255, 255, 0.16);
    --card-chip-ink: #fff7f1;
    --accent: #ffd7a4;
}

.kpi-sand {
    --card-bg: linear-gradient(155deg, #fbf6ea 0%, #f0e0c0 100%);
    --card-ink: #3d2d14;
    --card-value: #8a5618;
    --card-note: #6c5430;
    --card-chip: rgba(138, 86, 24, 0.1);
    --card-chip-ink: #6e4512;
    --accent: #c4893a;
}

.kpi-blush {
    --card-bg: linear-gradient(155deg, #fbf3ee 0%, #f0d4c6 100%);
    --card-ink: #5c2614;
    --card-value: #9a3c20;
    --card-note: #7a4632;
    --card-chip: rgba(154, 60, 32, 0.1);
    --card-chip-ink: #8d3518;
    --accent: #c45c32;
}

.kpi-ink {
    --card-bg: linear-gradient(155deg, #3d4d86 0%, #1b2344 100%);
    --card-ink: #f4f6fb;
    --card-value: #f3d7a1;
    --card-note: rgba(244, 246, 251, 0.78);
    --card-chip: rgba(255, 255, 255, 0.14);
    --card-chip-ink: #f4f6fb;
    --accent: #e7c27a;
}

.kpi::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 20px;
    bottom: 20px;
    width: 3px;
    border-radius: 99px;
    background: var(--accent);
}

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kpi-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--card-chip);
    color: var(--card-chip-ink);
}

.kpi-icon .icon {
    width: 1.3rem;
    height: 1.3rem;
}

.kpi-tag {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--card-chip);
    color: var(--card-chip-ink);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.kpi-tag.is-wait {
    background: transparent;
    color: var(--card-ink);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--card-ink) 28%, transparent);
}

.kpi h2 {
    min-height: 2.5em;
    margin: 16px 0 8px;
    font-family: var(--sans);
    font-size: 1.02rem;
    font-weight: 560;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.kpi-value {
    margin: 0;
    color: var(--card-value);
    font-family: var(--serif);
    font-size: clamp(2.6rem, 4vw, 3.4rem);
    font-weight: 520;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.045em;
    line-height: 0.95;
}

.kpi-value-wait {
    opacity: 0.42;
}

.kpi-note {
    margin: 10px 0 0;
    color: var(--card-note);
    font-size: 0.92rem;
}

.split,
.routes-layout {
    display: grid;
    gap: 16px;
    align-items: start;
}

.split {
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
}

.routes-layout {
    grid-template-columns: minmax(0, 1fr);
}

.panel {
    padding: 20px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel h2 {
    font-size: 1.7rem;
}

.page-head {
    margin-bottom: 22px;
}

.page-head h1 {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
}

.text-link {
    color: var(--forest);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(12, 59, 40, 0.25);
    padding-bottom: 1px;
}

.text-link:hover {
    border-bottom-color: var(--forest);
}

.empty {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 180px;
    padding: 8px 4px 4px;
}

.empty img {
    width: 220px;
    height: auto;
    flex: none;
    border-radius: 20px;
}

.empty h3,
.table-empty strong {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.45rem;
    font-weight: 520;
    letter-spacing: -0.03em;
}

.empty p,
.table-empty p {
    margin: 6px 0 0;
    color: var(--ink-soft);
}

.empty-compact {
    min-height: 140px;
}

.form-panel {
    position: static;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: start;
}

.span-2 {
    grid-column: span 2;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.92rem;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid rgba(20, 33, 27, 0.14);
    border-radius: 14px;
    background: #fff;
    outline: none;
}

.field input,
.field select {
    height: 48px;
    padding: 0 14px;
}

.field textarea {
    display: block;
    height: calc(1.45em * 2 + 24px);
    min-height: calc(1.45em * 2 + 24px);
    padding: 12px 14px;
    line-height: 1.45;
    resize: vertical;
}

.field select {
    padding-right: 40px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c3b28' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--leaf);
    box-shadow: 0 0 0 4px rgba(28, 122, 70, 0.14);
}

.form-grid.pair {
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.3fr);
}

.form-grid.stack {
    grid-template-columns: minmax(0, 1fr);
}

.form-grid.daily-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-bottom: 14px;
}

.form-grid.triples {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.triples .field:first-child {
    grid-column: auto;
}

.form-grid.stack .field-wide {
    grid-column: 1 / -1;
}

.field input[readonly] {
    background: var(--mint);
    color: var(--forest);
    font-weight: 650;
    letter-spacing: 0.02em;
}

.date-shell {
    position: relative;
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 42px 0 14px;
    border: 1px solid rgba(20, 33, 27, 0.14);
    border-radius: 14px;
    background: #fff;
}

.date-shell span {
    font-weight: 650;
    letter-spacing: 0.04em;
}

.date-shell::after {
    content: "";
    position: absolute;
    right: 14px;
    width: 18px;
    height: 18px;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c3b28' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='15' rx='2'/%3E%3Cpath d='M8 3.5v3M16 3.5v3M4 10h16'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.date-shell input[type="date"],
.date-shell input[type="date"]:focus {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    box-shadow: none;
    outline: none;
    opacity: 0;
    cursor: pointer;
}

.date-shell:focus-within {
    border-color: var(--leaf);
    box-shadow: 0 0 0 4px rgba(28, 122, 70, 0.14);
}

.field.is-invalid .date-shell {
    border-color: var(--terra);
    box-shadow: 0 0 0 4px rgba(182, 78, 40, 0.12);
}

.ops-grid {
    min-width: 1680px;
}

.ops-grid th {
    white-space: normal;
    min-width: 108px;
    line-height: 1.3;
    vertical-align: bottom;
}

.ops-grid th.num,
.ops-grid td.num {
    text-align: right;
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
    border-color: var(--terra);
    box-shadow: 0 0 0 4px rgba(182, 78, 40, 0.12);
}

#route_alignment,
.is-upper {
    text-transform: uppercase;
}

#route_alignment::placeholder,
.is-upper::placeholder {
    text-transform: none;
}

.input-shell {
    position: relative;
}

.input-shell input {
    padding-right: 68px;
}

.input-badge {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff;
    color: var(--forest);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hint,
.field-error,
.table-count,
.tech {
    margin: 6px 0 0;
    font-size: 0.82rem;
}

.hint,
.table-count {
    color: var(--muted);
}

.field-error {
    color: var(--terra-deep);
    font-weight: 600;
}

.form-actions {
    display: flex;
    margin-top: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    font-weight: 600;
    text-decoration: none;
}

.btn-primary {
    background: var(--forest);
    color: #f6f3ea;
}

.btn-primary:hover {
    background: #072417;
}

.btn-ghost,
.btn-quiet {
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(20, 33, 27, 0.14);
}

.btn-ghost:hover,
.btn-quiet:hover {
    box-shadow: inset 0 0 0 1px var(--forest);
}

.btn-danger {
    background: var(--terra-deep);
    color: #fff;
}

.btn-danger:hover {
    background: #732c14;
}

.btn-small {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.86rem;
}

.btn-quiet.is-danger {
    color: var(--terra-deep);
}

.btn-quiet.is-danger:hover {
    box-shadow: inset 0 0 0 1px var(--terra);
}

.btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.nav-toggle:focus-visible,
.nav-link:focus-visible,
input:focus-visible,
.text-link:focus-visible {
    outline: 2px solid var(--forest);
    outline-offset: 3px;
}

.sidebar .nav-link:focus-visible {
    outline-color: #d9f3e4;
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(280px, 100%);
    height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(20, 33, 27, 0.14);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
}

.search input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ink);
}

.table-count {
    margin: -6px 0 10px;
}

.table-wrap {
    overflow: auto;
}

.grid {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.grid th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 10px 12px;
    background: #fffcf7;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
}

.grid td {
    padding: 13px 12px;
    border-bottom: 1px solid rgba(20, 33, 27, 0.06);
    vertical-align: middle;
}

.grid tbody tr:hover {
    background: rgba(231, 244, 236, 0.65);
}

.grid tbody tr.is-editing,
.grid tbody tr.is-editing:hover {
    background: #f4ead7;
}

.grid tbody tr.is-fresh {
    animation: fresh 1.8s ease;
}

.route-id {
    color: var(--forest);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
}

a.route-id:hover {
    text-decoration: underline;
}

.align-cell {
    min-width: 180px;
    font-weight: 550;
}

.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.actions {
    width: 168px;
    text-align: right;
    white-space: nowrap;
}

.actions .btn + .btn {
    margin-left: 6px;
}

.table-empty {
    padding: 28px 12px !important;
    text-align: left;
}

.chart-panel {
    margin-bottom: 16px;
}

.chart-total {
    margin: 4px 0 0;
    color: var(--forest);
    font-family: var(--serif);
    font-size: 1.7rem;
    font-weight: 520;
    letter-spacing: -0.03em;
    line-height: 1;
}

.pie-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 28px 36px;
    align-items: center;
}

.pie-chart svg {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 14px 28px rgba(16, 39, 28, 0.14));
}

.pie-slice {
    stroke: #fffdf8;
    stroke-width: 2;
    cursor: pointer;
}

.pie-label {
    fill: #fffdf8;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 650;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

.pie-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 22px;
}

.pie-legend li {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
}

.pie-swatch {
    width: 14px;
    height: 14px;
    margin-top: 3px;
    border-radius: 4px;
}

.pie-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pie-copy strong {
    font-weight: 650;
}

.pie-copy span {
    color: var(--ink-soft);
    font-size: 0.86rem;
}

.pie-count {
    color: var(--forest);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.pie-count small {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.chart-note {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.mix {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mix-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-weight: 600;
}

.mix-top span {
    color: var(--forest);
}

.mix-track {
    height: 8px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 99px;
    background: #e7eee9;
}

.mix-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0c3b28, #1c7a46);
}

.mix p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.steps {
    margin: 12px 0 0;
    padding-left: 18px;
    color: var(--ink-soft);
}

.steps li + li {
    margin-top: 6px;
}

.tech {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-scrim {
    position: absolute;
    inset: 0;
    background: rgba(8, 24, 16, 0.48);
}

.modal-card {
    position: relative;
    width: min(440px, 100%);
    padding: 24px;
    border-radius: 24px;
    background: #fffcf7;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.modal-card h2 {
    font-size: 1.8rem;
}

.modal-card p {
    margin: 10px 0 0;
    color: var(--ink-soft);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.toasts {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 45;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(340px, calc(100% - 32px));
}

.toast {
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--forest);
    color: #f6f3ea;
    box-shadow: 0 12px 30px rgba(8, 24, 16, 0.2);
    transform: translateY(8px);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-in {
    opacity: 1;
    transform: none;
}

.toast.is-danger {
    background: var(--terra-deep);
}

::placeholder {
    color: #7d8b84;
    opacity: 1;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    opacity: 1;
}

@keyframes fresh {
    from {
        background: #d9f0e3;
    }
    to {
        background: transparent;
    }
}

@media (max-width: 1100px) {
    .kpi-grid,
    .split {
        grid-template-columns: 1fr 1fr;
    }

    .kpi,
    .kpi:nth-child(n) {
        grid-column: auto;
    }

    .kpi:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 920px) {
    .nav-toggle {
        display: inline-flex;
    }

    .sidebar {
        transform: translateX(-105%);
        transition: transform 0.2s ease;
    }

    .shell.nav-open .sidebar {
        transform: none;
    }

    .nav-scrim.is-visible {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 25;
        background: rgba(8, 24, 16, 0.46);
    }

    .main {
        margin-left: 0;
        padding: 18px 16px 48px;
    }
}

@media (max-width: 860px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-grid .field:first-child,
    .span-2 {
        grid-column: 1 / -1;
    }

    .form-grid.pair {
        grid-template-columns: 1fr;
    }

    .form-grid.pair .field:first-child,
    .form-grid.daily-head .field:first-child,
    .form-grid.triples .field:first-child {
        grid-column: auto;
    }

    .form-grid.triples {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pie-layout {
        grid-template-columns: 1fr;
    }

    .pie-chart {
        max-width: 280px;
        margin: 0 auto;
    }
}

@media (max-width: 720px) {
    .hero,
    .kpi-grid,
    .split {
        grid-template-columns: 1fr;
    }

    .kpi:last-child {
        grid-column: auto;
    }

    .hero-title {
        white-space: normal;
        font-size: clamp(1.7rem, 7vw, 2.3rem);
    }

    .day-board {
        min-height: 0;
    }

    .day-card {
        min-height: 112px;
        padding: 14px 14px 12px;
    }

    .hero-frame {
        justify-self: start;
    }

    .empty {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-grid,
    .span-2 {
        grid-template-columns: 1fr;
        grid-column: auto;
    }

    .form-grid.daily-head,
    .form-grid.triples {
        grid-template-columns: 1fr;
    }

    .day-row {
        grid-template-columns: 1fr;
    }

    .day-board-head,
    .panel-head,
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .search {
        width: 100%;
    }

    .desk-clock {
        font-size: 0.84rem;
    }
}

.login-page {
    min-height: 100vh;
    background: #f4efe6;
    background-image: none;
}

.login-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.78fr);
}

.login-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 36px;
    min-height: 100vh;
    padding: 64px 72px 42px;
    color: #f7f3ea;
    background:
        radial-gradient(820px 480px at 18% 0%, rgba(232, 196, 122, 0.2), transparent 58%),
        radial-gradient(640px 420px at 88% 88%, rgba(47, 143, 98, 0.28), transparent 52%),
        linear-gradient(165deg, #1a4632 0%, #0d2a1d 46%, #07160f 100%);
}

.login-hero-mark {
    position: absolute;
    top: 50%;
    left: 54%;
    width: min(760px, 92%);
    height: auto;
    transform: translate(-50%, -54%);
    opacity: 0.22;
    pointer-events: none;
    user-select: none;
}

.login-hero-copy,
.login-points {
    position: relative;
    z-index: 1;
}

.login-kicker {
    margin: 0 0 22px;
    color: #e4c56a;
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.login-hero h1 {
    margin: 0;
    color: #f8f4ec;
    font-family: var(--serif);
    font-size: clamp(4.2rem, 6.4vw, 6.6rem);
    font-weight: 520;
    letter-spacing: -0.045em;
    line-height: 0.88;
    text-wrap: balance;
}

.login-lede {
    max-width: 38ch;
    margin: 28px 0 0;
    color: rgba(247, 243, 234, 0.82);
    font-size: 1.05rem;
    line-height: 1.55;
}

.login-points {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.login-points strong {
    display: block;
    margin-bottom: 8px;
    color: #e4c56a;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.login-points span {
    display: block;
    color: rgba(247, 243, 234, 0.78);
    font-size: 0.92rem;
    line-height: 1.45;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 48px 36px;
    background: #f4efe6;
}

.login-card {
    width: min(380px, 100%);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.login-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
}

.login-mini img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    background: transparent;
}

.login-mini strong,
.login-mini span {
    display: block;
}

.login-mini strong {
    color: var(--forest);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.login-mini span {
    color: var(--muted);
    font-size: 0.82rem;
}

.login-card h2 {
    margin: 0;
    color: #172033;
    font-family: var(--serif);
    font-size: 3rem;
    font-weight: 520;
    letter-spacing: -0.04em;
    line-height: 1;
}

.login-sub {
    margin: 12px 0 28px;
    color: #5c6b64;
    font-size: 1rem;
}

.login-card label {
    margin-bottom: 8px;
    color: #3c4a44;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.login-card .field + .field {
    margin-top: 16px;
}

.login-card input {
    height: 48px;
    border: 0;
    border-radius: 8px;
    background: #e7eef6;
}

.login-card input:focus {
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(23, 32, 51, 0.16);
}

.login-error {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(182, 78, 40, 0.1);
    color: var(--terra-deep);
    font-size: 0.92rem;
    font-weight: 600;
}

.login-submit {
    width: 100%;
    min-height: 50px;
    margin-top: 22px;
    border-radius: 10px;
    background: #172033;
    color: #f7f3ea;
}

.login-submit:hover {
    background: #0e1626;
}

@media (max-width: 980px) {
    .login-split {
        grid-template-columns: 1fr;
    }

    .login-hero,
    .login-panel {
        min-height: auto;
    }

    .login-hero {
        padding: 36px 24px 28px;
    }

    .login-hero h1 {
        font-size: clamp(3rem, 12vw, 4.4rem);
    }

    .login-points {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .login-hero-mark {
        width: min(420px, 100%);
        opacity: 0.16;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
