:root {
    color-scheme: light;
    --body-bg: #ffffff;
    --bg: #f6f7f8;
    --panel: #ffffff;
    --panel-soft: #f9faf9;
    --control: #ffffff;
    --card: #ffffff;
    --line: #dde3e0;
    --line-strong: #c8d1cd;
    --text: #16211d;
    --text-strong: #16211d;
    --muted: #64736d;
    --muted-2: #8a9792;
    --nav-text: #33433d;
    --nav-icon: #5a6863;
    --green: #087f5b;
    --green-soft: #e4f6ed;
    --green-line: #b5dfca;
    --amber: #b7791f;
    --amber-soft: #fff7df;
    --amber-line: #f0c96f;
    --red: #c2412d;
    --red-soft: #fff0ed;
    --red-line: #f2b8ae;
    --blue: #2f6fbd;
    --blue-soft: #edf4ff;
    --done-soft: #f4fbf7;
    --avatar-bg: #dfe9e4;
    --shadow: 0 14px 40px rgba(18, 32, 26, 0.08);
}

[data-theme="dark"] {
    color-scheme: dark;
    --body-bg: #050908;
    --bg: #070d0b;
    --panel: #0c1512;
    --panel-soft: #111d19;
    --control: #08110e;
    --card: #09120f;
    --line: #22312c;
    --line-strong: #3c594f;
    --text: #edf5f1;
    --text-strong: #ffffff;
    --muted: #a4b2ac;
    --muted-2: #73827c;
    --nav-text: #d6e0dc;
    --nav-icon: #9aa9a3;
    --green: #33c590;
    --green-soft: #0c3325;
    --green-line: #236b4e;
    --amber: #f2c15d;
    --amber-soft: #2b1f0b;
    --amber-line: #8a681f;
    --red: #ff8b76;
    --red-soft: #2c1714;
    --red-line: #7d3f35;
    --blue: #8fb7ff;
    --blue-soft: #102238;
    --done-soft: #0c2e22;
    --avatar-bg: #152a24;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    width: 100%;
    min-height: 100%;
}

body {
    background: var(--body-bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.holding-page {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #ffffff;
}

.holding-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.12)),
        url("./plannerr.png") center center / contain no-repeat;
}

.stamp {
    position: relative;
    z-index: 1;
    width: min(62vw, 860px);
    transform: rotate(-14deg);
}

.stamp img {
    display: block;
    width: 100%;
    height: auto;
}

.login-link {
    position: fixed;
    top: 22px;
    right: 24px;
    z-index: 2;
    color: #111827;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    opacity: 0.72;
    transition: opacity 160ms ease;
}

.login-link:hover,
.login-link:focus-visible {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.prototype-app {
    min-height: 100vh;
    background: var(--bg);
}

.app-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 320px;
    min-height: 100vh;
}

.sidebar,
.today-panel {
    background: var(--panel);
    border-color: var(--line);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 20px 10px 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 24px;
    font-size: 20px;
    font-weight: 800;
}

.brand-mark {
    width: 28px;
    height: 28px;
    color: var(--green);
}

.nav {
    display: grid;
    gap: 4px;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: 6px;
    padding: 0 12px;
    background: transparent;
    color: var(--nav-text);
    font-size: 14px;
    font-weight: 700;
    text-align: left;
}

.nav-button svg {
    width: 18px;
    height: 18px;
    color: var(--nav-icon);
}

.nav-button.is-active {
    background: var(--green-soft);
    color: var(--green);
}

.nav-button.is-active svg {
    color: var(--green);
}

.account-card {
    margin-top: auto;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 12px;
    background: var(--panel-soft);
}

.account-card strong,
.today-worker strong {
    display: block;
    font-size: 14px;
}

.account-card span,
.today-worker span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.main {
    min-width: 0;
    padding: 18px 18px 24px;
}

.topbar,
.board-toolbar,
.summary-strip,
.page-placeholder,
.rounds-grid,
.customer-table {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 16px;
    margin-bottom: 14px;
}

.section-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.section-title h1 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
}

.section-title span {
    color: var(--muted);
    font-size: 13px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-button,
.text-button,
.primary-button {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--control);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.icon-button {
    width: 34px;
    display: grid;
    place-items: center;
}

.text-button,
.primary-button {
    padding: 0 12px;
}

.primary-button {
    border-color: var(--green);
    background: var(--green);
    color: #ffffff;
}

.theme-button {
    min-width: 92px;
}

.board-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 12px;
}

.week-controls,
.view-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.week-label {
    min-width: 150px;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 14px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px 16px;
    border-right: 1px solid var(--line);
}

.summary-item:last-child {
    border-right: 0;
}

.summary-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--green);
    background: var(--green-soft);
    font-weight: 900;
}

.summary-item.is-red .summary-icon {
    color: var(--red);
    background: var(--red-soft);
}

.summary-item.is-amber .summary-icon {
    color: var(--amber);
    background: var(--amber-soft);
}

.summary-number {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.summary-label {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(132px, 1fr));
    gap: 10px;
}

.day-column {
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.day-column.is-selected {
    border-color: var(--green);
    box-shadow: 0 0 0 1px var(--green);
}

.day-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-soft);
}

.day-title {
    font-size: 14px;
    font-weight: 800;
}

.day-meta {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.day-value {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.round-group {
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

.round-group:last-child {
    border-bottom: 0;
}

.round-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.round-heading span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.job-card {
    position: relative;
    display: grid;
    gap: 6px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px;
    margin-bottom: 7px;
    background: var(--card);
    text-align: left;
}

.job-card:last-child {
    margin-bottom: 0;
}

.job-card.is-due {
    border-color: var(--amber-line);
    background: var(--amber-soft);
}

.job-card.is-overdue {
    border-color: var(--red-line);
    background: var(--red-soft);
}

.job-card.is-done {
    border-color: var(--green-line);
    background: var(--done-soft);
}

.job-name {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-subline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.status {
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 800;
}

.status.scheduled {
    color: var(--blue);
    background: var(--blue-soft);
}

.status.due {
    color: var(--amber);
    background: var(--amber-soft);
}

.status.overdue {
    color: var(--red);
    background: var(--red-soft);
}

.status.done,
.status.paid {
    color: var(--green);
    background: var(--green-soft);
}

.add-job {
    width: 100%;
    min-height: 38px;
    border: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    color: var(--green);
    font-size: 13px;
    font-weight: 800;
}

.today-panel {
    position: sticky;
    top: 0;
    height: 100vh;
    min-width: 0;
    border-left: 1px solid var(--line);
    padding: 18px 16px;
    overflow: auto;
}

.today-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.today-heading h2 {
    margin: 0;
    font-size: 18px;
}

.today-worker {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0 16px;
    border-bottom: 1px solid var(--line);
}

.avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--avatar-bg);
    color: var(--green);
    font-weight: 900;
}

.worker-status {
    margin-left: auto;
    border: 1px solid var(--green-line);
    border-radius: 999px;
    padding: 4px 8px;
    color: var(--green);
    background: var(--green-soft);
    font-size: 11px;
    font-weight: 800;
}

.today-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 14px 0;
}

.today-stat {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px 8px;
    text-align: center;
}

.today-stat strong {
    display: block;
    font-size: 19px;
}

.today-stat span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.today-list {
    display: grid;
    gap: 10px;
}

.today-card {
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: 7px;
    background: var(--card);
    padding: 12px;
}

.today-card.is-due {
    border-left-color: var(--amber);
    background: var(--amber-soft);
}

.today-card.is-done {
    opacity: 0.68;
}

.today-time {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.today-card h3 {
    margin: 5px 0 4px;
    font-size: 14px;
}

.today-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.job-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 9px 0;
}

.job-tags span {
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 3px 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.today-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 34px;
    gap: 7px;
}

.mini-button {
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--control);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.mini-button.is-primary {
    border-color: var(--green);
    background: var(--green);
    color: #ffffff;
}

.route-button {
    width: 100%;
    min-height: 40px;
    margin-top: 16px;
    border: 1px solid var(--green);
    border-radius: 7px;
    background: var(--control);
    color: var(--green);
    font-size: 13px;
    font-weight: 800;
}

.page-placeholder {
    padding: 18px;
}

.placeholder-grid,
.rounds-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.placeholder-card,
.round-card {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--card);
    padding: 14px;
}

.placeholder-card strong,
.round-card strong {
    display: block;
    margin-bottom: 6px;
}

.placeholder-card p,
.round-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.rounds-grid {
    padding: 12px;
    background: transparent;
    border: 0;
}

.round-metric {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
}

.customer-table {
    overflow: hidden;
}

.customer-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 0.8fr 0.8fr;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    align-items: center;
    font-size: 13px;
}

.customer-row:last-child {
    border-bottom: 0;
}

.customer-row.header {
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.mobile-bar {
    display: none;
}

@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .sidebar {
        padding-inline: 8px;
    }

    .brand span,
    .nav-button span,
    .account-card {
        display: none;
    }

    .brand {
        justify-content: center;
        padding-inline: 0;
    }

    .nav-button {
        justify-content: center;
        padding: 0;
    }

    .today-panel {
        display: none;
    }

    .week-grid {
        grid-template-columns: repeat(5, minmax(160px, 1fr));
        overflow-x: auto;
        padding-bottom: 8px;
    }
}

@media (max-width: 760px) {
    .app-shell {
        display: block;
        padding-bottom: 64px;
    }

    .sidebar {
        display: none;
    }

    .main {
        padding: 10px;
    }

    .topbar,
    .board-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .summary-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-item:nth-child(2) {
        border-right: 0;
    }

    .summary-item {
        min-height: 64px;
    }

    .week-grid {
        display: grid;
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .day-column:not(.is-selected) {
        display: none;
    }

    .placeholder-grid,
    .rounds-grid {
        grid-template-columns: 1fr;
    }

    .customer-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .customer-row.header {
        display: none;
    }

    .mobile-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        border-top: 1px solid var(--line);
        background: var(--panel);
    }

    .mobile-bar button {
        min-height: 58px;
        border: 0;
        background: transparent;
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
    }

    .mobile-bar button.is-active {
        color: var(--green);
    }
}
