:root {
  color-scheme: light;
  --ink: #1e3028;
  --muted: #758179;
  --line: #e7eae5;
  --paper: #fff;
  --canvas: #f6f7f4;
  --green: #27664e;
  --green-dark: #194b38;
  --green-soft: #e9f3ed;
  --orange: #a55d22;
  --orange-soft: #fff3e6;
  --red: #ac4848;
  --red-soft: #fbebea;
  --shadow: 0 16px 48px rgb(31 49 39 / 8%);
  font-family: "DM Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; color: white; background: var(--green); border-radius: 13px 13px 13px 4px; font: 800 21px Manrope, sans-serif; }
.brand-image { display: block; width: auto; max-width: 170px; height: auto; max-height: 54px; object-fit: contain; }
.branding-preview { max-width: 100%; max-height: 150px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
textarea { width: 100%; padding: 10px; color: var(--ink); background: white; border: 1px solid #dfe4dd; border-radius: 7px; resize: vertical; font: inherit; font-size: 12px; }
input[type="color"] { min-height: 42px; padding: 4px; }
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; display: flex; flex-direction: column; width: 240px; padding: 28px 18px 20px; background: #fff; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 34px; }
.brand-copy strong { display: block; font: 800 18px Manrope, sans-serif; letter-spacing: -.7px; }
.brand-copy span { color: var(--muted); font-size: 11px; }
.nav-label, .eyebrow { margin: 0 10px 10px; color: #929c94; font-size: 10px; font-weight: 700; letter-spacing: 1.25px; }
.nav-list { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; color: #67746b; background: transparent; border: 0; border-radius: 9px; text-align: left; font-size: 13px; font-weight: 600; }
.nav-item:hover { color: var(--green); background: #f6f8f5; }
.nav-item.active { color: var(--green-dark); background: var(--green-soft); }
.nav-icon { width: 19px; text-align: center; font-size: 16px; }
.sidebar-bottom { margin-top: auto; padding: 15px 8px 0; border-top: 1px solid var(--line); }
.sidebar-bottom p { margin: 0 0 9px; color: var(--muted); font-size: 11px; }
.sidebar-bottom button { padding: 0; color: var(--ink); background: none; border: 0; font-size: 12px; font-weight: 600; }
.main { min-height: 100vh; margin-left: 240px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 0 42px; background: rgb(255 255 255 / 75%); border-bottom: 1px solid var(--line); }
.topbar-title { color: var(--muted); font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; color: var(--green); background: var(--green-soft); border-radius: 50%; font-size: 12px; font-weight: 700; }
.content { width: min(1400px, 100%); margin: 0 auto; padding: 38px 42px 64px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-heading .eyebrow { margin: 0 0 8px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Manrope, "Segoe UI", sans-serif; }
h1 { margin-bottom: 6px; font-size: clamp(24px, 3vw, 32px); letter-spacing: -1.1px; }
h2 { margin: 0; font-size: 19px; letter-spacing: -.45px; }
h3 { margin-bottom: 5px; font-size: 14px; }
.subtitle { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-quiet { color: #526056; background: #fff; border-color: var(--line); }
.button-quiet:hover { background: #f8faf7; }
.button-danger { color: var(--red); background: var(--red-soft); }
.button-small { min-height: 31px; padding: 0 10px; font-size: 11px; }
.icon-button { display: grid; place-items: center; width: 32px; height: 32px; color: var(--muted); background: #f6f7f4; border: 0; border-radius: 50%; font-size: 22px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card, .panel, .calendar-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.stat-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.stat-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--green); background: var(--green-soft); border-radius: 11px; font-size: 19px; }
.stat-card:nth-child(2) .stat-icon { color: #a2682d; background: var(--orange-soft); }
.stat-card:nth-child(3) .stat-icon { color: #55768a; background: #eaf2f6; }
.stat-card p { margin: 0 0 3px; color: var(--muted); font-size: 11px; }
.stat-card strong { font: 800 24px Manrope, sans-serif; letter-spacing: -.8px; }
.calendar-panel { overflow: hidden; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.calendar-title { display: flex; align-items: center; gap: 13px; }
.calendar-title h2 { min-width: 150px; font-size: 16px; }
.calendar-tools { display: flex; gap: 8px; width: min(390px, 55%); }
.calendar-tools select { flex: 1; min-width: 0; }
.month-controls { display: flex; gap: 5px; }
.month-controls button { width: 30px; height: 30px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 7px; }
.month-controls button:hover { color: var(--green); border-color: #bdd1c3; }
.calendar-filter { width: min(220px, 35%); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekday { padding: 12px 5px; color: #89928c; background: #fafbf9; text-align: center; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.day-cell { min-height: 112px; padding: 9px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.day-cell:nth-child(7n) { border-right: 0; }
.day-cell.outside { background: #fafbf9; }
.day-cell.outside .day-number { color: #b5bcb6; }
.day-number { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: #59655d; font-size: 11px; font-weight: 600; }
.day-number { width: 100%; padding: 0; background: transparent; border: 0; text-align: left; }
.day-cell.selected { background: #f0f6f0; box-shadow: inset 0 0 0 1px #a9c5ae; }
.day-availability { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.project-pill { width: 100%; border: 0; cursor: pointer; text-align: left; }
.calendar-grid.day-view { grid-template-columns: minmax(0, 1fr); }
.calendar-grid.day-view .day-cell { min-height: 180px; }
.day-summary { margin-top: 14px; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: #f4f8f3; }
.today-dot { width: 5px; height: 5px; background: var(--green); border-radius: 50%; }
.project-pill { display: block; overflow: hidden; margin: 4px 0 0; padding: 5px 6px; color: #52635a; background: #f2f5f1; border-left: 2px solid #9baea0; border-radius: 0 4px 4px 0; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.project-pill.ok { color: #28694c; background: #eaf4ec; border-left-color: #69a17b; }
.project-pill.short { color: #975522; background: #fff1df; border-left-color: #e2a25f; }
.project-pill.empty { color: #9d4844; background: #faeaea; border-left-color: #d77f78; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 13px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; }
.legend-dot.ok { background: #69a17b; }.legend-dot.short { background: #e2a25f; }.legend-dot.empty { background: #d77f78; }
.panel { overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 11px 17px; color: #89928c; background: #fafbf9; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .45px; }
td { padding: 13px 17px; border-top: 1px solid #eff1ed; color: #455249; font-size: 12px; }
tbody tr:hover { background: #fcfdfa; }
.person-cell { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.person-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; color: var(--green); background: var(--green-soft); border-radius: 50%; font-size: 11px; font-weight: 700; }
.person-cell strong { display: block; color: var(--ink); font-size: 12px; }
.person-cell small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-flex; align-items: center; padding: 5px 8px; color: #5a675f; background: #f2f4f1; border-radius: 20px; font-size: 10px; font-weight: 600; }
.tag.good { color: #28694c; background: #eaf4ec; }
.tag.warn { color: #975522; background: #fff1df; }
.tag.bad { color: #9d4844; background: #faeaea; }
.empty-state { padding: 42px 20px; color: var(--muted); text-align: center; font-size: 12px; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); font: 700 14px Manrope, sans-serif; }
.filter-select, select, input { color: var(--ink); background: white; border: 1px solid #dfe4dd; border-radius: 7px; outline: none; }
input, select { width: 100%; min-height: 39px; padding: 0 10px; font-size: 12px; }
input:focus, select:focus { border-color: #78a18a; box-shadow: 0 0 0 3px rgb(39 102 78 / 9%); }
label { display: grid; gap: 6px; color: #58645c; font-size: 11px; font-weight: 600; }
.dialog { width: min(480px, calc(100% - 28px)); max-height: min(90vh, 820px); padding: 0; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.dialog::backdrop { background: rgb(23 36 29 / 38%); backdrop-filter: blur(2px); }
.dialog-wide { width: min(700px, calc(100% - 28px)); }
.dialog-form { display: grid; gap: 17px; padding: 23px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 1px; }
.dialog-head .eyebrow { margin: 0 0 5px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 3px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.team-picker { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.team-picker legend { padding: 0 5px; color: #58645c; font-size: 11px; font-weight: 600; }
.check-list { display: grid; gap: 7px; max-height: 170px; overflow: auto; }
.check-item { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 11px; font-weight: 500; }
.check-item input { width: 15px; min-height: 15px; accent-color: var(--green); }
.assignment-person { min-height: 48px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; }
.assignment-person.has-license { background: #edf7ef; border-color: #b8d9bf; }
.assignment-person.regular-move { box-shadow: inset 3px 0 #5d9c72; }
.regular-move-row { background: #f4faf5; }
.assignment-person-copy { display: grid; flex: 1; gap: 2px; }
.assignment-person-copy strong { color: var(--ink); font-size: 11px; }
.assignment-person-copy small { color: var(--muted); font-size: 10px; }
.license-badge { padding: 4px 7px; color: #28694c; background: #d8eddd; border-radius: 20px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.regular-move-badge { padding: 4px 7px; color: #326c43; background: #e4f1e6; border-radius: 20px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.driver-legend { margin: 0 0 8px; color: var(--muted); font-size: 10px; }
.muted-copy { margin: -6px 0 0; color: var(--muted); font-size: 12px; }
.invite-result { overflow-wrap: anywhere; padding: 13px; color: #41604e; background: #f1f7f1; border: 1px solid #dbe9dc; border-radius: 8px; font-size: 12px; line-height: 1.6; }
.invite-result a { color: var(--green); font-weight: 700; }
.invite-link { display: block; margin-top: 7px; }
.availability-range { align-items: end; grid-template-columns: 1fr 1fr auto; }
.availability-editor { overflow: auto; max-height: 48vh; border: 1px solid var(--line); border-radius: 8px; }
.availability-editor table { min-width: 470px; }
.availability-editor th, .availability-editor td { padding: 8px 11px; }
.availability-editor select { min-height: 32px; font-size: 11px; }
.toast { position: fixed; z-index: 10; right: 22px; bottom: 22px; max-width: min(420px, calc(100% - 32px)); padding: 13px 16px; color: white; background: #243c30; border-radius: 9px; box-shadow: var(--shadow); font-size: 12px; animation: slide-up .2s ease-out; }
.toast.error { background: #8f3939; }
@keyframes slide-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.login-screen, .public-screen { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: radial-gradient(ellipse at 15% 0%, #e6f0e7 0, transparent 38%), var(--canvas); }
.login-card, .public-card { width: min(440px, 100%); padding: 34px; background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.login-card .brand { padding: 0 0 29px; }
.login-card h1, .public-card h1 { margin-bottom: 9px; font-size: 25px; }
.login-card .subtitle, .public-card .subtitle { margin-bottom: 22px; line-height: 1.6; }
.login-card form { display: grid; gap: 15px; }
.login-card .button, .public-card .button { width: 100%; min-height: 43px; }
.login-note { margin: 15px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.public-card { width: min(650px, 100%); }
.public-card .brand { padding: 0 0 24px; }
.public-days { display: grid; gap: 7px; max-height: 56vh; margin: 20px 0; overflow: auto; }
.public-day { display: grid; grid-template-columns: 1fr minmax(145px, 185px); align-items: center; gap: 12px; padding: 9px 11px; background: #fafbf9; border: 1px solid #eff1ed; border-radius: 7px; }
.public-day-name { color: #344239; font-size: 11px; font-weight: 600; }
.public-day-name small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 400; }
.public-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.public-footer .subtitle { margin: 0; font-size: 10px; }
.password-banner { margin-bottom: 20px; padding: 13px 16px; color: #825018; background: var(--orange-soft); border: 1px solid #f1dfc8; border-radius: 9px; font-size: 12px; }
.password-banner button { margin-left: 6px; padding: 0; color: #70400e; background: none; border: 0; text-decoration: underline; font-weight: 700; }
.auth-card { width: min(440px, calc(100% - 28px)); }
.project-range { color: var(--muted); white-space: nowrap; font-size: 11px; }
.project-time { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }

@media (max-width: 900px) {
  .sidebar { width: 74px; padding: 23px 10px 17px; }
  .brand { justify-content: center; padding: 0 0 28px; }
  .brand-copy, .nav-label, .nav-text, .sidebar-bottom p, .sidebar-bottom button { display: none; }
  .nav-item { justify-content: center; padding: 12px 6px; }
  .nav-icon { font-size: 18px; }
  .sidebar-bottom { display: flex; justify-content: center; padding: 15px 0 0; }
  .main { margin-left: 74px; }
  .topbar { padding: 0 24px; }
  .content { padding: 30px 24px 50px; }
  .day-cell { min-height: 98px; padding: 7px; }
  .project-pill { font-size: 9px; }
}
@media (max-width: 620px) {
  .sidebar { inset: auto 0 0; width: 100%; height: 62px; flex-direction: row; justify-content: center; padding: 5px 8px; border-top: 1px solid var(--line); border-right: 0; }
  .brand, .sidebar-bottom { display: none; }
  .nav-label { display: none; }
  .nav-list { display: flex; justify-content: space-around; width: 100%; gap: 3px; }
  .nav-item { display: grid; justify-items: center; gap: 1px; width: 25%; padding: 6px 2px; font-size: 9px; }
  .nav-text { display: block; }
  .nav-icon { font-size: 16px; }
  .main { margin-left: 0; padding-bottom: 62px; }
  .topbar { min-height: 58px; padding: 0 16px; }
  .topbar-title { font-size: 11px; }
  .content { padding: 24px 14px 36px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 19px; }
  .page-heading > .button { align-self: stretch; }
  .stats-grid { gap: 7px; }
  .stat-card { align-items: flex-start; flex-direction: column; gap: 9px; padding: 12px; }
  .stat-icon { width: 33px; height: 33px; font-size: 15px; }
  .stat-card p { min-height: 25px; font-size: 9px; }
  .stat-card strong { font-size: 20px; }
  .calendar-head { align-items: flex-start; flex-wrap: wrap; padding: 14px; }
  .calendar-title { width: 100%; justify-content: space-between; }
  .calendar-title h2 { min-width: 0; font-size: 14px; }
  .calendar-tools { width: 100%; }
  .weekday { padding: 9px 1px; font-size: 8px; }
  .day-cell { min-height: 70px; padding: 4px; }
  .day-number { margin-bottom: 4px; font-size: 9px; }
  .project-pill { margin-top: 3px; padding: 3px; font-size: 8px; }
  .calendar-legend { gap: 9px; padding: 11px; font-size: 9px; }
  .panel-head { align-items: flex-start; flex-direction: column; padding: 15px; }
  th, td { padding: 10px 12px; }
  .form-row { grid-template-columns: 1fr; }
  .availability-range { grid-template-columns: 1fr 1fr; }
  .availability-range .button { grid-column: 1 / -1; }
  .login-card, .public-card { padding: 24px 20px; }
  .public-day { grid-template-columns: 1fr; gap: 7px; }
  .public-footer { align-items: stretch; flex-direction: column; }
  .public-footer .button { width: 100%; }
  .public-footer .subtitle { text-align: center; }
  .toast { right: 12px; bottom: 73px; }
}
