:root {
  --ink: #12202b;
  --ink-soft: #53616d;
  --brand: #0077cc;
  --brand-dark: #005a9e;
  --brand-deep: #071c2c;
  --brand-soft: #e8f4fc;
  --navy: #071c2c;
  --navy-2: #0b2d48;
  --red: #e33032;
  --red-dark: #bd2025;
  --red-soft: #fff0f0;
  --blue: #0077cc;
  --blue-soft: #e8f4fc;
  --green: #1b8d62;
  --green-soft: #e8f7f1;
  --amber: #d88a16;
  --amber-soft: #fff6e6;
  --surface: #ffffff;
  --surface-2: #f3f7fa;
  --line: #dce6ec;
  --line-strong: #c6d5de;
  --shadow: 0 12px 35px rgba(7, 28, 44, 0.09);
  --radius: 15px;
  --tech-edwin: #0077cc;
  --tech-wadson: #7556d8;
  --tech-fran: #13987a;
  --tech-jorfet: #dc7c17;
  --tech-none: #7d8993;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--surface-2); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-2);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px max(24px, calc((100vw - 1500px) / 2));
  color: #fff;
  background: linear-gradient(110deg, rgba(7,28,44,.98), rgba(11,45,72,.98) 62%, rgba(0,90,158,.97));
  border-bottom: 2px solid rgba(46,158,255,.55);
  backdrop-filter: blur(16px);
}

.brand-block { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-logo-frame { position: relative; display: block; width: 170px; height: 54px; overflow: hidden; flex: 0 0 auto; }
.brand-logo { position: absolute; top: 50%; left: 0; width: 180px; height: 180px; max-width: none; object-fit: contain; transform: translateY(-50%); }
.brand-context { padding-left: 13px; border-left: 1px solid rgba(255,255,255,.25); color: #b8d7ea; font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.header-actions { display: flex; gap: 9px; }

main { width: min(1500px, 100%); margin: 0 auto; padding: 25px 24px 60px; }
.week-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.week-navigation { display: flex; align-items: center; gap: 12px; }
.week-navigation h1 { margin: 2px 0 0; font-size: clamp(20px, 2vw, 28px); line-height: 1.15; letter-spacing: -.03em; }
.eyebrow { color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: .12em; }

.button, .icon-button, .close-button, .filter-pill, .view-tab, .text-button {
  border: 0; transition: .16s ease; -webkit-tap-highlight-color: transparent;
}
.button { min-height: 42px; padding: 0 16px; border-radius: 10px; font-weight: 750; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--brand); box-shadow: 0 5px 15px rgba(0,119,204,.24); }
.button-primary:hover { background: var(--brand-dark); }
.button-secondary { color: var(--ink); background: #fff; border: 1px solid var(--line-strong); }
.button-ghost { color: var(--ink); background: transparent; border: 1px solid var(--line-strong); }
.topbar .button-ghost { color: #fff; border-color: #3c4851; }
.button-danger { color: #b12227; background: var(--red-soft); }
.button.compact { min-height: 38px; padding: 0 13px; font-size: 13px; }
.button.full { width: 100%; }
.icon-button { width: 35px; height: 35px; border-radius: 9px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: 25px; line-height: 1; }
.icon-button:hover { border-color: var(--ink); }
.text-button { color: var(--brand-dark); background: transparent; padding: 5px; font-weight: 750; }

.demo-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 15px; margin: 0 0 15px; border-radius: 11px;
  color: #704f12; background: var(--amber-soft); border: 1px solid #f0dcae; font-size: 13px;
}
.demo-banner div { display: flex; flex-wrap: wrap; gap: 5px 10px; }
.demo-banner .text-button { color: #805e19; white-space: nowrap; }
.sync-banner { color: #8a272b; background: var(--red-soft); border-color: #efc5c7; }
.sync-banner .text-button { color: #a32127; }
.status-strip { display: flex; align-items: center; gap: 8px; min-height: 30px; margin: -6px 2px 13px; color: var(--ink-soft); font-size: 13px; }
.status-strip .text-button { margin-left: auto; font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #aab4ba; box-shadow: 0 0 0 3px #e9edef; }
.status-dot.connected { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.status-dot.error { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 21px; }
.kpi-card { min-height: 110px; padding: 16px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: 0 3px 12px rgba(16,24,32,.025); }
.kpi-label { color: var(--ink-soft); font-size: 12px; font-weight: 650; margin-bottom: 9px; }
.kpi-main { display: flex; align-items: baseline; gap: 7px; min-height: 34px; }
.kpi-main strong { font-size: 25px; letter-spacing: -.04em; }
.kpi-main span { color: var(--ink-soft); font-size: 12px; }
.progress-track { height: 5px; background: #edf0f2; border-radius: 9px; margin-top: 10px; overflow: hidden; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; transition: width .3s ease; }
.progress-fill.red { background: var(--brand); }
.kpi-foot { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 11px; margin-top: 9px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.dot.service { background: var(--blue); }
.dot.diagnostic { background: var(--amber); }
.alert-card.warning { background: var(--amber-soft); border-color: #ecd6a7; }
.alert-card.danger { background: var(--red-soft); border-color: #f0c8ca; }

.view-tabs { display: flex; gap: 4px; padding: 4px; width: fit-content; margin-bottom: 16px; border-radius: 11px; background: #e9edef; }
.view-tab { min-height: 36px; padding: 0 14px; border-radius: 8px; color: var(--ink-soft); background: transparent; font-size: 13px; font-weight: 750; }
.view-tab.active { color: var(--ink); background: #fff; box-shadow: 0 2px 7px rgba(20,30,40,.08); }
.badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin-left: 4px; color: #fff; background: var(--red); border-radius: 10px; font-size: 10px; }
.view-panel { display: none; }
.view-panel.active { display: block; }

.day-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 17px; }
.day-tab { position: relative; min-width: 0; padding: 11px 8px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.day-tab:hover { border-color: #aab5bc; }
.day-tab.active { color: #fff; background: linear-gradient(135deg, var(--brand-deep), var(--brand-dark)); border-color: var(--brand-dark); box-shadow: 0 7px 16px rgba(0,90,158,.18); }
.day-tab .day-name { display: block; color: inherit; opacity: .72; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.day-tab .day-number { display: block; font-size: 18px; font-weight: 800; margin-top: 3px; }
.day-tab .day-count { position: absolute; top: 10px; right: 9px; min-width: 26px; padding: 3px 5px; text-align: center; border-radius: 9px; background: var(--surface-2); color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.day-tab.active .day-count { background: rgba(255,255,255,.14); color: #fff; }
.day-tab.target:not(.active) { border-color: #8dcab6; }
.day-tab.limit:not(.active) { border-color: #e1bb70; background: #fffbf3; }
.day-tab.over:not(.active) { border-color: #e99a9d; background: #fff8f8; }
.day-tab.closed:not(.active) { color: #7b8790; border-style: dashed; background: #f0f2f3; }
.day-tab.closed .day-count { min-width: 46px; }

.day-summary { display: flex; justify-content: space-between; align-items: end; margin: 0 2px 12px; }
.day-summary h2, .section-heading h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.025em; }
.day-composition { margin: 5px 0 0; color: var(--ink-soft); font-size: 13px; }
.day-summary-actions { display: flex; align-items: center; gap: 8px; }
.day-capacity { display: flex; align-items: center; gap: 9px; padding: 7px 11px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.day-capacity strong { font-size: 16px; }
.day-capacity span { color: var(--ink-soft); font-size: 12px; }
.day-capacity.target { color: var(--green); background: var(--green-soft); border-color: #b8dfd0; }
.day-capacity.limit { color: #9a650e; background: var(--amber-soft); border-color: #efd6a2; }
.day-capacity.over { color: #a92026; background: var(--red-soft); border-color: #f0c0c2; }
.day-capacity.closed { color: #596771; background: #edf0f2; border-style: dashed; }

.planner-tools { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.search-field { min-width: min(360px, 100%); display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.search-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,119,204,.09); }
.search-field span { color: #71808b; font-size: 19px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--ink); }
.filter-pills { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.filter-pill { padding: 0 10px; border-radius: 7px; background: transparent; color: var(--ink-soft); font-size: 13px; font-weight: 750; }
.filter-pill.active { color: #fff; background: var(--brand-dark); }
.source-filter { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 9px 0 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.source-filter select { min-width: 90px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }

.lanes { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 10px; align-items: start; overflow-x: auto; padding: 1px 1px 14px; scroll-snap-type: x proximity; }
.lane { min-height: 295px; border: 1px solid var(--line); background: #eef1f3; border-radius: 14px; overflow: hidden; scroll-snap-align: start; transition: .15s ease; }
.lane.drag-over { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,119,204,.1); }
.lane-header { padding: 12px 12px 9px; background: rgba(255,255,255,.72); border-bottom: 1px solid var(--line); }
.lane-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lane-person { display: flex; align-items: center; gap: 8px; min-width: 0; }
.avatar { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--tech-color); font-size: 10px; font-weight: 850; }
.lane-name { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-count { color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.lane-meter { height: 4px; margin-top: 9px; border-radius: 3px; overflow: hidden; background: #dfe5e8; }
.lane-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--tech-color); }
.lane-meta { display: flex; justify-content: space-between; gap: 5px; margin-top: 6px; color: var(--ink-soft); font-size: 11px; }
.lane-body { min-height: 230px; padding: 8px; }
.empty-lane { display: grid; place-items: center; min-height: 175px; padding: 20px; color: #89959e; text-align: center; font-size: 11px; border: 1px dashed #cbd3d8; border-radius: 10px; }

.job-card { position: relative; padding: 11px; margin-bottom: 8px; border-radius: 11px; background: #fff; border: 1px solid #dfe5e8; box-shadow: 0 3px 8px rgba(18,32,43,.04); cursor: grab; }
.job-card:active { cursor: grabbing; }
.job-card:hover { border-color: #bdc7cd; box-shadow: 0 5px 13px rgba(18,32,43,.08); }
.job-card.dragging { opacity: .42; }
.job-card.done { opacity: .63; }
.job-card.done .job-vehicle, .job-card.done .job-work { text-decoration: line-through; }
.job-card.urgent { border-left: 3px solid var(--red); }
.job-card.high { border-left: 3px solid var(--amber); }
.job-top { display: flex; align-items: center; gap: 7px; }
.job-time { color: var(--ink); font-size: 12px; font-weight: 850; }
.type-tag { padding: 3px 6px; border-radius: 6px; font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.type-tag.service { color: #235da8; background: var(--blue-soft); }
.type-tag.diagnostic { color: #97610d; background: var(--amber-soft); }
.source-tag { padding: 3px 6px; border-radius: 6px; color: #66747d; background: #eef1f3; font-size: 10px; font-weight: 800; }
.source-tag.vambe { color: #4f3b9d; background: #f0edff; }
.source-tag.import { color: #176f58; background: #e8f7f1; }
.job-menu { margin-left: auto; padding: 2px 4px; border: 0; border-radius: 6px; background: transparent; color: #78858e; font-size: 18px; line-height: 1; }
.job-menu:hover { background: var(--surface-2); }
.job-vehicle { margin-top: 8px; font-size: 14px; font-weight: 850; letter-spacing: -.01em; }
.job-plate { display: inline-block; margin-left: 4px; color: var(--ink-soft); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.job-work { margin-top: 4px; color: var(--ink-soft); font-size: 12px; line-height: 1.4; }
.job-bottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 9px; padding-top: 8px; border-top: 1px solid #edf0f2; color: #6a7882; font-size: 11px; }
.priority-flag { color: var(--red-dark); font-weight: 850; text-transform: uppercase; }
.demo-chip { color: #7e662b; background: #fff5d7; border-radius: 5px; padding: 2px 4px; font-size: 8px; font-weight: 800; }
.confirmation-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 6px; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .025em; }
.confirmation-chip::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.confirmation-chip.pending { color: #8c650f; background: var(--amber-soft); }
.confirmation-chip.confirmed { color: var(--green); background: var(--green-soft); }
.confirmation-chip.reschedule_requested { color: #aa2429; background: var(--red-soft); }
.confirmation-chip.cancelled { color: #6f7b84; background: #edf0f2; }

.unified-control { margin-top: 24px; padding-top: 13px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 7px 2px 16px; }
.section-heading p { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; }
.select-field { display: grid; gap: 4px; }
.select-field span { color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.select-field select { height: 40px; min-width: 180px; padding: 0 32px 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; }
.ronald-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, .75fr); gap: 13px; }
.ronald-main, .pending-panel, .panel-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.ronald-main { padding: 15px; }
.list-heading, .pending-header, .panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list-heading { padding: 0 2px 11px; }
.list-heading h3, .pending-header h3, .panel-title-row h3 { margin: 0; font-size: 14px; }
.list-heading span, .muted { color: var(--ink-soft); font-size: 10px; }
.priority-list { display: grid; gap: 7px; }
.priority-row { display: grid; grid-template-columns: 56px minmax(150px, 1.25fr) minmax(130px, 1fr) 120px 118px; gap: 10px; align-items: center; min-height: 67px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; }
.priority-row.urgent { border-left: 3px solid var(--red); }
.priority-row.high { border-left: 3px solid var(--amber); }
.priority-time { font-weight: 850; font-size: 13px; }
.priority-vehicle strong, .priority-work strong { display: block; font-size: 13px; }
.priority-vehicle span, .priority-work span { display: block; color: var(--ink-soft); font-size: 11px; margin-top: 3px; line-height: 1.35; }
.tech-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 750; }
.tech-label .dot { background: var(--tech-color); }
.status-select, .quick-assign { width: 100%; height: 36px; padding: 0 26px 0 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface-2); font-size: 12px; }
.pending-panel { padding: 15px; background: linear-gradient(145deg, var(--brand-deep), var(--navy-2)); color: #fff; border-color: #123c59; }
.pending-panel .eyebrow { color: #91a0aa; }
.count-bubble { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; font-weight: 850; }
.pending-list { display: grid; gap: 8px; margin: 15px 0; }
.pending-item { padding: 11px; border-radius: 10px; background: #1b2833; border: 1px solid #34424d; }
.pending-item strong { display: block; font-size: 12px; }
.pending-item span { display: block; margin: 4px 0 9px; color: #a8b4bc; font-size: 9px; }
.pending-item select { color: #fff; background-color: #263641; border-color: #40515d; }
.pending-panel .button-secondary { color: #fff; background: #25333d; border-color: #44535e; }
.reschedule-requests { margin-bottom: 12px; padding: 14px; border: 1px solid #efc7c9; border-radius: var(--radius); background: var(--red-soft); }
.reschedule-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reschedule-heading h3 { margin: 3px 0 0; font-size: 14px; }
.reschedule-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 11px; }
.reschedule-item { padding: 11px; border: 1px solid #efccce; border-radius: 10px; background: #fff; }
.reschedule-item strong { display: block; font-size: 12px; }
.reschedule-item span { display: block; margin: 4px 0 9px; color: var(--ink-soft); font-size: 9px; line-height: 1.35; }
.reschedule-actions { display: flex; gap: 5px; }
.reschedule-actions .button { min-height: 32px; padding: 0 9px; font-size: 9px; }
.integration-panel { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid #bee2d4; border-radius: 12px; background: var(--green-soft); }
.integration-panel > div { display: grid; gap: 3px; }
.integration-panel strong { font-size: 13px; }
.integration-panel span { color: var(--ink-soft); font-size: 10px; }
.integration-panel .integration-state { flex: 0 0 auto; padding: 6px 9px; border-radius: 8px; color: var(--green); background: #fff; font-weight: 850; }
.integration-panel.warning { border-color: #efd6a2; background: var(--amber-soft); }
.integration-panel.warning .integration-state { color: #95620f; }
.integration-panel.danger { border-color: #f0c0c2; background: var(--red-soft); }
.integration-panel.danger .integration-state { color: #a92026; }
.whatsapp-button { color: #fff; background: #198754; }
.whatsapp-button:hover { background: #126a42; }
.inline-whatsapp { min-height: 31px; padding: 0 8px; border: 0; border-radius: 7px; color: #fff; background: #198754; font-size: 9px; font-weight: 800; }
.empty-message { display: grid; place-items: center; min-height: 145px; padding: 25px; border: 1px dashed var(--line-strong); border-radius: 11px; color: var(--ink-soft); text-align: center; font-size: 11px; }
.pending-panel .empty-message { color: #9ba8b1; border-color: #3d4c57; }

.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.calendar-navigation { display: flex; align-items: center; gap: 12px; }
.calendar-navigation h2 { margin: 3px 0 0; font-size: 24px; line-height: 1.15; letter-spacing: -.03em; }
.calendar-actions { display: flex; align-items: center; gap: 8px; }
.availability-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 2px 14px; color: var(--ink-soft); font-size: 12px; }
.availability-legend span { display: inline-flex; align-items: center; gap: 6px; }
.availability-dot { width: 9px; height: 9px; border-radius: 50%; }
.availability-dot.available { background: var(--green); }
.availability-dot.limited { background: var(--amber); }
.availability-dot.full { background: var(--red); }
.availability-dot.closed { background: #8b969e; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.calendar-card, .calendar-day-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(7,28,44,.04); }
.calendar-card { overflow: hidden; }
.calendar-weekdays, .month-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { color: var(--ink-soft); background: #f7f9fa; border-bottom: 1px solid var(--line); }
.calendar-weekdays span { padding: 10px 8px; text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.calendar-day { position: relative; min-height: 130px; display: flex; flex-direction: column; gap: 7px; padding: 10px; text-align: left; color: var(--ink); background: #fff; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: .15s ease; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:hover:not(:disabled) { z-index: 1; box-shadow: inset 0 0 0 2px rgba(0,119,204,.26); }
.calendar-day.selected { z-index: 2; box-shadow: inset 0 0 0 2px var(--brand); }
.calendar-day.other-month { color: #8e989f; background: #f7f9fa; }
.calendar-day.available { background: linear-gradient(180deg, #f5fcf8, #fff 38%); }
.calendar-day.limited { background: linear-gradient(180deg, #fff9ec, #fff 42%); }
.calendar-day.full { background: linear-gradient(180deg, #fff2f2, #fff 42%); }
.calendar-day.closed { background: #f1f3f4; color: #7c878f; }
.calendar-day.past { opacity: .7; }
.calendar-day:disabled { cursor: default; }
.calendar-day-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.calendar-day-number { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; font-size: 13px; font-weight: 850; }
.calendar-day.today .calendar-day-number { color: #fff; background: var(--brand); }
.calendar-availability { padding: 4px 6px; border-radius: 7px; font-size: 10px; font-weight: 850; white-space: nowrap; }
.calendar-day.available .calendar-availability { color: #176f50; background: #dcf3e8; }
.calendar-day.limited .calendar-availability { color: #8d5c0c; background: #ffedc8; }
.calendar-day.full .calendar-availability { color: #a5252a; background: #ffdede; }
.calendar-day.closed .calendar-availability { color: #66737c; background: #e2e6e8; }
.calendar-counts { display: flex; gap: 5px; color: var(--ink-soft); font-size: 10px; }
.calendar-counts span { padding: 3px 5px; border-radius: 6px; background: rgba(255,255,255,.82); border: 1px solid rgba(199,210,217,.75); }
.calendar-mini-list { display: grid; gap: 4px; margin-top: auto; }
.calendar-mini-job { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 10px; }
.calendar-mini-job b { color: var(--ink); }
.calendar-more { color: var(--brand-dark); font-size: 10px; font-weight: 750; }
.calendar-day-panel { position: sticky; top: 90px; padding: 17px; }
.calendar-day-panel h3 { margin: 4px 0 12px; font-size: 20px; letter-spacing: -.02em; }
.calendar-selected-capacity { display: grid; gap: 7px; margin-bottom: 12px; padding: 12px; border-radius: 11px; color: var(--ink-soft); background: var(--surface-2); font-size: 13px; line-height: 1.4; }
.calendar-selected-capacity strong { color: var(--ink); font-size: 16px; }
.calendar-selected-capacity .capacity-split { display: flex; justify-content: space-between; gap: 8px; }
.calendar-panel-actions { display: grid; gap: 7px; }
.calendar-day-list { display: grid; gap: 7px; margin-top: 14px; }
.calendar-appointment { width: 100%; padding: 10px; text-align: left; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; }
.calendar-appointment:hover { border-color: var(--brand); background: var(--brand-soft); }
.calendar-appointment strong { display: block; font-size: 13px; }
.calendar-appointment span { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 11px; line-height: 1.35; }
.calendar-empty { padding: 18px 8px; color: var(--ink-soft); text-align: center; font-size: 12px; }
.calendar-loading { grid-column: 1 / -1; min-height: 420px; display: grid; place-items: center; color: var(--ink-soft); }

.capacity-layout { display: grid; grid-template-columns: 1fr 1.5fr; gap: 13px; }
.panel-card { min-width: 0; padding: 16px; }
.legend { display: flex; gap: 10px; color: var(--ink-soft); font-size: 9px; }
.legend span { display: flex; align-items: center; gap: 4px; }
.legend-line { display: inline-block; width: 12px; border-top: 2px dashed; }
.legend-line.target { border-color: var(--green); }
.legend-line.limit { border-color: var(--red); }
.bar-chart { height: 260px; display: flex; align-items: end; justify-content: space-around; gap: 10px; padding: 23px 7px 0; border-bottom: 1px solid var(--line); background-image: linear-gradient(to top, transparent 24.5%, #edf0f2 25%, transparent 25.5%, transparent 49.5%, #edf0f2 50%, transparent 50.5%, transparent 74.5%, #edf0f2 75%, transparent 75.5%); }
.bar-group { height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 5px; }
.bar-value { color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.bar { width: min(37px, 70%); min-height: 2px; border-radius: 6px 6px 0 0; background: var(--brand-dark); transition: height .3s ease; }
.bar.target { background: var(--green); }
.bar.limit { background: var(--amber); }
.bar.over { background: var(--red); }
.bar-label { position: absolute; transform: translateY(21px); color: var(--ink-soft); font-size: 9px; font-weight: 700; }
.load-table-wrap { overflow-x: auto; margin-top: 13px; }
.load-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 10px; }
.load-table th { padding: 9px 8px; color: var(--ink-soft); border-bottom: 1px solid var(--line); font-size: 9px; text-align: center; }
.load-table th:first-child, .load-table td:first-child { text-align: left; position: sticky; left: 0; background: #fff; }
.load-table td { min-width: 58px; padding: 10px 8px; text-align: center; border-bottom: 1px solid #edf0f2; }
.load-table tr:last-child td { border-bottom: 0; }
.load-cell { display: inline-grid; place-items: center; width: 42px; height: 37px; border-radius: 8px; background: var(--surface-2); }
.load-cell b { display: block; font-size: 11px; }
.load-cell small { display: block; color: var(--ink-soft); font-size: 8px; }
.load-cell.busy { color: #89590c; background: var(--amber-soft); }
.load-cell.over { color: #a01d23; background: var(--red-soft); }
.tech-name-cell { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.tech-name-cell .dot { background: var(--tech-color); }

.dialog { width: min(680px, calc(100% - 24px)); max-height: calc(100dvh - 30px); padding: 0; border: 0; border-radius: 17px; color: var(--ink); background: #fff; box-shadow: 0 28px 80px rgba(0,0,0,.28); overflow: auto; }
.dialog::backdrop { background: rgba(7, 12, 16, .66); backdrop-filter: blur(3px); }
.small-dialog { width: min(530px, calc(100% - 24px)); }
.dialog form { padding: 20px; }
.dialog-header { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 18px; }
.dialog-header h2 { margin: 3px 0 0; font-size: 22px; letter-spacing: -.03em; }
.close-button { width: 34px; height: 34px; border-radius: 9px; color: var(--ink-soft); background: var(--surface-2); font-size: 23px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 5px; }
.field span, .type-selector legend { color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; color: var(--ink); background: #fff; font-size: 13px; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #788791; box-shadow: 0 0 0 3px rgba(16,24,32,.06); }
.full-span { grid-column: 1 / -1; }
.type-selector { display: flex; gap: 7px; padding: 0; border: 0; }
.type-selector legend { margin-bottom: 5px; }
.type-selector label { flex: 1; }
.type-selector input { position: absolute; opacity: 0; pointer-events: none; }
.type-selector label span { height: 41px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink-soft); font-size: 11px; font-weight: 750; }
.type-selector input:checked + span { color: var(--ink); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-soft); }
.form-error { min-height: 17px; color: #bd2025; font-size: 10px; padding-top: 7px; }
.dialog-footer { display: flex; align-items: center; gap: 8px; padding-top: 8px; }
.footer-spacer { flex: 1; }
.dialog-copy { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.upload-box { min-height: 155px; display: grid; place-items: center; align-content: center; gap: 5px; padding: 20px; border: 1px dashed #aeb9c0; border-radius: 12px; background: var(--surface-2); text-align: center; cursor: pointer; }
.upload-box:hover { border-color: var(--brand); background: var(--brand-soft); }
.upload-box input { display: none; }
.upload-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--brand-deep); font-size: 20px; }
.upload-box strong { font-size: 13px; }
.upload-box small { color: var(--ink-soft); font-size: 10px; }
.import-status { min-height: 26px; padding-top: 8px; color: var(--ink-soft); font-size: 11px; }
.import-status.success { color: var(--green); }
.import-status.error { color: var(--red-dark); }
.closed-toggle { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); cursor: pointer; }
.closed-toggle input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); }
.closed-toggle span { display: grid; gap: 3px; }
.closed-toggle strong { font-size: 13px; }
.closed-toggle small { color: var(--ink-soft); font-size: 10px; }
.schedule-grid { grid-template-columns: repeat(3, 1fr); }
#scheduleForm.is-closed .schedule-grid { opacity: .72; }
.bar.closed { background: #a6b0b7; }

.toast { position: fixed; z-index: 80; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); padding: 11px 15px; border-radius: 10px; color: #fff; background: var(--brand-deep); box-shadow: var(--shadow); font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .lanes { grid-template-columns: repeat(5, minmax(245px, 1fr)); }
  .ronald-layout, .capacity-layout, .calendar-layout { grid-template-columns: 1fr; }
  .calendar-day-panel { position: static; }
  .priority-row { grid-template-columns: 52px minmax(140px, 1.25fr) minmax(120px, 1fr) 110px 110px; }
  .reschedule-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .topbar { min-height: 64px; padding: 10px 14px; }
  .brand-context, .desktop-label { display: none; }
  .brand-logo-frame { width: 126px; height: 42px; }
  .brand-logo { width: 136px; height: 136px; }
  .header-actions { gap: 6px; }
  .header-actions .button { min-height: 40px; padding: 0 11px; font-size: 12px; }
  main { padding: 18px 12px 45px; }
  .week-toolbar { align-items: flex-start; }
  .week-navigation { gap: 7px; }
  .week-navigation h1 { max-width: 205px; }
  .week-toolbar > .button { display: none; }
  .kpi-grid { gap: 8px; }
  .kpi-card { min-height: 102px; padding: 13px; }
  .kpi-main strong { font-size: 21px; }
  .view-tabs { width: 100%; overflow-x: auto; }
  .view-tab { flex: 1; white-space: nowrap; padding: 0 9px; font-size: 11px; }
  .day-tabs { display: flex; overflow-x: auto; gap: 7px; padding-bottom: 4px; scrollbar-width: none; }
  .day-tabs::-webkit-scrollbar { display: none; }
  .day-tab { flex: 0 0 85px; padding: 9px 8px; }
  .day-summary { align-items: center; }
  .day-capacity { display: grid; gap: 0; }
  .planner-tools { display: grid; }
  .search-field { min-width: 0; }
  .filter-pills { width: 100%; }
  .filter-pill { flex: 1; min-height: 34px; }
  .source-filter { justify-content: space-between; }
  .lanes { margin-right: -12px; padding-right: 12px; grid-template-columns: repeat(5, minmax(270px, 82vw)); }
  .section-heading { align-items: start; }
  .control-heading { display: grid; }
  .date-select select { width: 100%; }
  .priority-list { gap: 9px; }
  .reschedule-list { grid-template-columns: 1fr; }
  .priority-row { position: relative; grid-template-columns: 50px 1fr; gap: 8px 10px; padding: 10px; }
  .priority-work { grid-column: 2; }
  .tech-label { grid-column: 1 / 2; }
  .status-select { grid-column: 2; }
  .panel-card { padding: 13px; }
  .panel-title-row { align-items: flex-start; }
  .legend { display: grid; gap: 3px; }
  .bar-chart { height: 220px; }
  .dialog { width: calc(100% - 12px); max-height: calc(100dvh - 12px); border-radius: 14px; }
  .dialog form { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .full-span { grid-column: auto; }
  .dialog-footer { position: sticky; bottom: -16px; margin: 0 -16px -16px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
  .demo-banner { align-items: flex-start; }
  .day-summary { align-items: flex-start; gap: 10px; }
  .day-summary-actions { display: grid; justify-items: end; }
  .integration-panel { align-items: flex-start; }
  .schedule-grid { grid-template-columns: 1fr; }
  .calendar-toolbar { align-items: flex-start; }
  .calendar-actions { display: grid; }
  .calendar-navigation { gap: 7px; }
  .calendar-navigation h2 { font-size: 19px; }
  .calendar-weekdays span { padding: 8px 2px; font-size: 9px; }
  .calendar-day { min-height: 66px; gap: 2px; padding: 5px; }
  .calendar-day-head { flex-direction: column; gap: 1px; }
  .calendar-day-number { width: 23px; height: 23px; font-size: 11px; }
  .calendar-availability { align-self: flex-start; padding: 2px 4px; font-size: 8px; }
  .calendar-counts, .calendar-mini-list { display: none; }
  .calendar-day-panel { padding: 14px; }
}

@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card { min-height: 96px; }
  .kpi-label { margin-bottom: 5px; }
  .kpi-main { display: grid; gap: 0; min-height: 37px; }
  .kpi-foot { margin-top: 5px; }
  .button-ghost.compact { padding: 0 9px; }
  .day-summary h2 { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
