:root {
  --canvas: #f3f5ef;
  --surface: #fff;
  --surface-muted: #edf1e8;
  --nav: #173c32;
  --ink: #17231f;
  --ink-muted: #61706a;
  --ink-on-dark: #f8fbf7;
  --brand: #2f7d52;
  --brand-strong: #205d3c;
  --accent: #d8a22e;
  --line: #d8dfd9;
  --focus: #246bdb;
  --success: #2f7d52;
  --warning: #a76612;
  --error: #b73535;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 14px 40px rgb(23 35 31 / 8%);
  font-family: Inter, "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--canvas); font-size: 15px; line-height: 1.45; }
body:has(.login-shell:not([hidden])) { height: 100dvh; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 70%, white); outline-offset: 2px; }
.team-color-0 { --team-color: #3d7a55; --chip-text: #fff; }
.team-color-1 { --team-color: #d17a3a; --chip-text: #17231f; }
.team-color-2 { --team-color: #3f6fa8; --chip-text: #fff; }
.team-color-3 { --team-color: #8a5aa5; --chip-text: #fff; }
.team-color-4 { --team-color: #b14e5a; --chip-text: #fff; }
.team-color-5 { --team-color: #a4862d; --chip-text: #17231f; }
.team-color-6 { --team-color: #287d7a; --chip-text: #fff; }
.team-color-7 { --team-color: #6b7250; --chip-text: #fff; }
.branch-color-0 { --branch-color: #2f6e91; --branch-soft: #e5f1f7; }
.branch-color-1 { --branch-color: #8a5b2e; --branch-soft: #f4ece3; }
.branch-color-2 { --branch-color: #6b5b95; --branch-soft: #eeeaf7; }
.branch-color-3 { --branch-color: #287d66; --branch-soft: #e4f2ed; }
.branch-color-4 { --branch-color: #b14e5a; --branch-soft: #f8e9eb; }
.branch-color-5 { --branch-color: #7b7229; --branch-soft: #f3f0de; }
.branch-color-6 { --branch-color: #c2410c; --branch-soft: #fff0e8; }
.branch-color-7 { --branch-color: #1d4ed8; --branch-soft: #e8eefd; }
.branch-color-8 { --branch-color: #a21caf; --branch-soft: #f8e8fa; }
.branch-color-9 { --branch-color: #37474f; --branch-soft: #e9edef; }

.login-shell { height: 100vh; height: 100dvh; overflow: hidden; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr); }
.login-brand { position: relative; overflow: hidden; padding: clamp(48px, 8vw, 110px); background: var(--nav); color: var(--ink-on-dark); display: flex; flex-direction: column; justify-content: center; }
.login-brand::before { content: ""; position: absolute; width: 520px; height: 520px; border: 1px solid rgb(255 255 255 / 8%); border-radius: 50%; right: -180px; top: -180px; box-shadow: 0 0 0 80px rgb(255 255 255 / 2%), 0 0 0 160px rgb(255 255 255 / 2%); }
.login-logo { position: relative; width: min(360px, 72%); height: auto; margin-bottom: 58px; object-fit: contain; object-position: left center; }
.login-brand h1 { font-size: clamp(46px, 5.5vw, 78px); line-height: .98; letter-spacing: -.045em; margin: 12px 0 24px; max-width: 700px; }
.eyebrow { color: var(--brand); font-size: 12px; line-height: 1.3; letter-spacing: .12em; text-transform: uppercase; font-weight: 750; margin: 0 0 6px; }
.login-brand .eyebrow { color: #a9cd79; }
.login-intro { color: rgb(248 251 247 / 72%); font-size: 18px; line-height: 1.6; max-width: 520px; }
.login-preview { margin-top: 58px; max-width: 560px; border: 1px solid rgb(255 255 255 / 13%); background: rgb(255 255 255 / 7%); border-radius: 16px; padding: 18px; backdrop-filter: blur(12px); }
.preview-head, .preview-days { display: flex; justify-content: space-between; }
.preview-head { font-weight: 700; margin-bottom: 18px; }
.preview-head span:last-child { color: #a9cd79; font-size: 12px; }
.preview-days span { width: 14%; text-align: center; color: rgb(255 255 255 / 48%); font-size: 11px; }
.preview-bars { display: grid; gap: 7px; margin-top: 12px; }
.preview-bars .bar { display: block; height: 7px; border-radius: 9px; }
.preview-bars .green { background: #78aa62; width: 76%; }
.preview-bars .orange { background: #d19255; width: 48%; margin-left: 22%; }
.preview-bars .blue { background: #6e94ba; width: 64%; margin-left: 10%; }
.login-panel { padding: 32px; display: flex; align-items: center; justify-content: center; background: #f8f9f5; }
.login-card { width: min(420px, 100%); }
.login-card h2 { font-size: 34px; letter-spacing: -.03em; margin: 8px 0; }
.muted { color: var(--ink-muted); margin: 0 0 30px; }
.mobile-logo { display: none; width: max-content; margin-bottom: 48px; padding: 12px 16px; align-items: center; border-radius: 12px; background: var(--nav); }
.mobile-logo img { width: 180px; height: auto; }
label { display: grid; gap: 7px; margin-bottom: 18px; font-size: 13px; font-weight: 700; color: #36423e; }
input, select, textarea { width: 100%; border: 1px solid #cbd4cc; border-radius: var(--radius-sm); background: white; color: var(--ink); padding: 11px 12px; min-height: 44px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgb(36 107 219 / 12%); outline: none; }
.button { border: 1px solid transparent; border-radius: var(--radius-sm); min-height: 42px; padding: 9px 14px; font-weight: 620; transition: transform .12s, background .12s, border-color .12s; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--brand); color: white; }
.button.primary:hover { background: var(--brand-strong); }
.button.secondary { background: white; color: var(--ink); border-color: var(--line); }
.button.danger { color: var(--error); background: white; border-color: #e7c8c8; }
.button.compact { min-height: 38px; padding: 7px 12px; }
.button.wide { width: 100%; margin-top: 4px; }
.security-note { text-align: center; color: var(--ink-muted); font-size: 12px; margin-top: 18px; }
.security-note span { color: var(--success); }
#login-code { text-align: center; font-size: 26px; font-weight: 800; letter-spacing: .24em; font-variant-numeric: tabular-nums; }
.form-error { min-height: 20px; margin: 2px 0 8px; color: var(--error); font-size: 13px; font-weight: 650; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px 1fr; }
.sidebar { height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; background: var(--nav); color: var(--ink-on-dark); padding: 28px 18px 20px; }
.logo { display: grid; gap: 9px; padding: 0 10px 30px; color: rgb(255 255 255 / 72%); font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.logo img { width: 164px; height: auto; object-fit: contain; object-position: left center; }
.logo span { font-weight: 500; }
.sidebar nav { display: grid; gap: 6px; }
.nav-item { min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: rgb(255 255 255 / 68%); font-weight: 600; text-align: left; }
.nav-item span { width: 20px; font-size: 18px; text-align: center; }
.nav-item b { font: inherit; }
.nav-item:hover, .nav-item.active { background: rgb(255 255 255 / 10%); color: white; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgb(255 255 255 / 12%); padding: 18px 6px 0; display: grid; grid-template-columns: 38px 1fr 36px; align-items: center; gap: 9px; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #e5efda; color: var(--nav); font-weight: 800; font-size: 12px; }
.user-meta { min-width: 0; display: grid; }
.user-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.user-meta span { color: rgb(255 255 255 / 56%); font-size: 11px; }
.icon-button { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: white; color: var(--ink); border-radius: var(--radius-sm); font-size: 22px; }
.icon-button:hover { background: var(--surface-muted); }
.icon-button.dark { background: transparent; border-color: transparent; color: rgb(255 255 255 / 72%); }
.main-column { min-width: 0; }
.topbar { min-height: 100px; padding: 24px clamp(20px, 3vw, 44px); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: rgb(243 245 239 / 90%); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 28px; line-height: 1.15; margin: 0; letter-spacing: -.025em; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.sync-status { color: var(--success); font-size: 10px; font-weight: 750; white-space: nowrap; }
.sync-status.offline { color: var(--error); }
.today-label { color: var(--ink-muted); font-weight: 650; margin-right: 8px; }
.mobile-menu { display: none; }
.content { padding: 28px clamp(20px, 3vw, 44px) 48px; }
.page { max-width: 1600px; margin: 0 auto; }
.notice { border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.notice.warning { background: #fff7df; border: 1px solid #ead59c; }
.notice > div { display: grid; flex: 1; }
.notice span { color: #745d20; font-size: 13px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.summary-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px; min-width: 0; }
.summary-card .label { color: var(--ink-muted); font-size: 12px; font-weight: 680; text-transform: uppercase; letter-spacing: .06em; }
.summary-card strong { display: block; font-size: 26px; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.summary-card .detail { color: var(--ink-muted); font-size: 12px; display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.calendar-toolbar { padding: 18px 20px 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.date-navigation { display: flex; gap: 8px; align-items: center; }
.date-navigation h2 { min-width: 220px; margin: 0 0 0 8px; font-size: 21px; letter-spacing: -.02em; text-transform: capitalize; }
.segmented { display: inline-flex; border: 1px solid var(--line); padding: 3px; border-radius: 9px; background: var(--surface-muted); }
.segmented button { min-height: 34px; padding: 5px 14px; border: 0; border-radius: 6px; color: var(--ink-muted); background: transparent; font-weight: 600; }
.segmented button.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgb(23 35 31 / 10%); }
.legend { min-height: 44px; padding: 7px 20px 12px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.legend-item { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-muted); }
.team-hover-target { border-radius: 5px; cursor: help; }
.legend-item.team-hover-target:hover, .legend-item.team-hover-target:focus-visible { color: var(--ink); background: var(--surface-muted); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--team-color); }
.legend-dot.home-legend { border: 1px solid #aeb8b1; background: white; }
.legend-dot.branch-legend { border-radius: 2px; background: var(--branch-color); }
.branch-legend-item { padding-left: 8px; border-left: 1px solid var(--line); }
.month-calendar { overflow-x: auto; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-lg) var(--radius-lg); overscroll-behavior-inline: contain; }
.timeline { width: max(100%, var(--timeline-width, 1368px)); min-width: max-content; background: white; }
.timeline.month-days-28 { --month-days: 28; --timeline-width: 1254px; }
.timeline.month-days-29 { --month-days: 29; --timeline-width: 1292px; }
.timeline.month-days-30 { --month-days: 30; --timeline-width: 1330px; }
.timeline.month-days-31 { --month-days: 31; --timeline-width: 1368px; }
.timeline-header, .timeline-row { width: max(100%, var(--timeline-width)); min-width: var(--timeline-width); display: grid; grid-template-columns: 190px repeat(var(--month-days), minmax(38px, 1fr)); }
.timeline-header { min-height: 54px; border-bottom: 1px solid #cbd4cc; background: #fafbf8; }
.timeline-corner, .timeline-team { position: sticky; left: 0; z-index: 5; border-right: 1px solid #c5cec7; background: #f7f9f5; }
.timeline-corner { padding: 10px 14px; display: grid; align-content: center; }
.timeline-corner span { color: var(--ink-muted); font-size: 9px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.timeline-corner strong { font-size: 12px; }
.timeline-date { grid-row: 1; min-width: 0; display: grid; place-content: center; gap: 1px; border-right: 1px solid #e4e8e3; color: var(--ink-muted); text-align: center; }
.timeline-date span { font-size: 8px; font-weight: 700; text-transform: uppercase; }
.timeline-date strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.timeline-date.weekend { background: #f2f4f0; }
.timeline-date.today { position: relative; background: #fff4bf; color: #69520a; }
.timeline-date.today::after { content: ""; position: absolute; right: 6px; bottom: 3px; left: 6px; height: 2px; border-radius: 2px; background: #d3a91d; }
.timeline-row { position: relative; min-height: 66px; border-bottom: 1px solid var(--line); }
.timeline-row:last-child { border-bottom: 0; }
.timeline-team { grid-column: 1; grid-row: 1; min-width: 0; padding: 10px 12px; display: flex; align-items: center; gap: 9px; }
.timeline-team > i { width: 9px; height: 36px; flex: 0 0 auto; border-radius: 8px; background: var(--team-color); }
.timeline-team > span { min-width: 0; display: grid; }
.timeline-team strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-team small { overflow: hidden; color: var(--ink-muted); font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.timeline-day { grid-row: 1; min-width: 0; border-right: 1px solid #edf0ec; background: white; }
.timeline-day.weekend { background: #f7f8f5; }
.timeline-day.home { background: repeating-linear-gradient(135deg, #f4f6f2, #f4f6f2 5px, #fff 5px, #fff 10px); }
.timeline-day.today { background: #fff8d8; box-shadow: inset 1px 0 #ead272, inset -1px 0 #ead272; }
.timeline-period { position: relative; z-index: 2; grid-row: 1; min-width: 0; height: 42px; margin: 12px 2px; padding: 0; overflow: hidden; border: 1px solid color-mix(in srgb, var(--team-color) 78%, black); border-radius: 8px; background: var(--team-color); color: var(--chip-text, white); text-align: left; box-shadow: 0 2px 6px rgb(23 35 31 / 12%); }
.timeline-period:hover { filter: brightness(.97); box-shadow: 0 3px 9px rgb(23 35 31 / 18%); }
.timeline-period.home { border-color: color-mix(in srgb, var(--team-color) 62%, white); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--team-color) 17%, white), color-mix(in srgb, var(--team-color) 17%, white) 5px, white 5px, white 10px); color: var(--ink); }
.timeline-period.continues-before { border-left: 0; border-radius: 0 8px 8px 0; margin-left: 0; }
.timeline-period.continues-after { border-right: 0; border-radius: 8px 0 0 8px; margin-right: 0; }
.timeline-period.continues-before.continues-after { border-radius: 0; }
.timeline-period.continues-before::before, .timeline-period.continues-after::after { content: ""; position: absolute; top: 0; bottom: 0; width: 7px; background: linear-gradient(90deg, rgb(255 255 255 / 34%), transparent); }
.timeline-period.continues-before::before { left: 0; }
.timeline-period.continues-after::after { right: 0; transform: rotate(180deg); }
.timeline-period-copy { height: 100%; min-width: 0; padding: 5px 9px 10px; display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.timeline-period-copy strong { flex: 0 0 auto; font-size: 10px; }
.timeline-period-copy > span:not(.timeline-branch-badges), .timeline-period-copy > small { overflow: hidden; font-size: 9px; font-weight: 650; opacity: .84; text-overflow: ellipsis; }
.timeline-period-copy small { font-weight: 550; opacity: .72; }
.timeline-branch-badges { min-width: 0; display: inline-flex; gap: 3px; overflow: hidden; }
.timeline-branch { flex: 0 1 auto; min-width: 0; padding: 2px 5px; overflow: hidden; border-radius: 9px; background: var(--branch-soft); color: var(--branch-color); font-size: 8px; font-style: normal; font-weight: 800; text-overflow: ellipsis; }
.timeline-period.compact .timeline-period-copy { padding-inline: 6px; }
.timeline-period.compact .timeline-period-copy span, .timeline-period.compact .timeline-period-copy small { display: none; }
.timeline-branch-days { position: absolute; right: 2px; bottom: 2px; left: 2px; height: 6px; display: flex; gap: 1px; pointer-events: none; }
.timeline-branch-day { min-width: 0; display: flex; flex: 1 1 0; gap: 1px; overflow: hidden; border-radius: 2px; }
.timeline-branch-day > i { min-width: 0; flex: 1 1 0; background: var(--branch-color); }
.timeline-empty { z-index: 2; grid-column: 2 / -1; grid-row: 1; align-self: center; justify-self: start; margin-left: 12px; color: #9aa49f; font-size: 10px; font-style: italic; }
.timeline-col-2 { grid-column-start: 2; } .timeline-col-3 { grid-column-start: 3; } .timeline-col-4 { grid-column-start: 4; } .timeline-col-5 { grid-column-start: 5; }
.timeline-col-6 { grid-column-start: 6; } .timeline-col-7 { grid-column-start: 7; } .timeline-col-8 { grid-column-start: 8; } .timeline-col-9 { grid-column-start: 9; }
.timeline-col-10 { grid-column-start: 10; } .timeline-col-11 { grid-column-start: 11; } .timeline-col-12 { grid-column-start: 12; } .timeline-col-13 { grid-column-start: 13; }
.timeline-col-14 { grid-column-start: 14; } .timeline-col-15 { grid-column-start: 15; } .timeline-col-16 { grid-column-start: 16; } .timeline-col-17 { grid-column-start: 17; }
.timeline-col-18 { grid-column-start: 18; } .timeline-col-19 { grid-column-start: 19; } .timeline-col-20 { grid-column-start: 20; } .timeline-col-21 { grid-column-start: 21; }
.timeline-col-22 { grid-column-start: 22; } .timeline-col-23 { grid-column-start: 23; } .timeline-col-24 { grid-column-start: 24; } .timeline-col-25 { grid-column-start: 25; }
.timeline-col-26 { grid-column-start: 26; } .timeline-col-27 { grid-column-start: 27; } .timeline-col-28 { grid-column-start: 28; } .timeline-col-29 { grid-column-start: 29; }
.timeline-col-30 { grid-column-start: 30; } .timeline-col-31 { grid-column-start: 31; } .timeline-col-32 { grid-column-start: 32; }
.timeline-span-1 { grid-column-end: span 1; } .timeline-span-2 { grid-column-end: span 2; } .timeline-span-3 { grid-column-end: span 3; } .timeline-span-4 { grid-column-end: span 4; }
.timeline-span-5 { grid-column-end: span 5; } .timeline-span-6 { grid-column-end: span 6; } .timeline-span-7 { grid-column-end: span 7; } .timeline-span-8 { grid-column-end: span 8; }
.timeline-span-9 { grid-column-end: span 9; } .timeline-span-10 { grid-column-end: span 10; } .timeline-span-11 { grid-column-end: span 11; } .timeline-span-12 { grid-column-end: span 12; }
.timeline-span-13 { grid-column-end: span 13; } .timeline-span-14 { grid-column-end: span 14; } .timeline-span-15 { grid-column-end: span 15; } .timeline-span-16 { grid-column-end: span 16; }
.timeline-span-17 { grid-column-end: span 17; } .timeline-span-18 { grid-column-end: span 18; } .timeline-span-19 { grid-column-end: span 19; } .timeline-span-20 { grid-column-end: span 20; }
.timeline-span-21 { grid-column-end: span 21; } .timeline-span-22 { grid-column-end: span 22; } .timeline-span-23 { grid-column-end: span 23; } .timeline-span-24 { grid-column-end: span 24; }
.timeline-span-25 { grid-column-end: span 25; } .timeline-span-26 { grid-column-end: span 26; } .timeline-span-27 { grid-column-end: span 27; } .timeline-span-28 { grid-column-end: span 28; }
.timeline-span-29 { grid-column-end: span 29; } .timeline-span-30 { grid-column-end: span 30; } .timeline-span-31 { grid-column-end: span 31; }
.year-calendar { padding: 0 16px 18px; display: grid; grid-template-columns: repeat(2, minmax(360px, 1fr)); gap: 12px; border-top: 1px solid var(--line); }
.year-month { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-top: 14px; overflow: hidden; }
.year-month h3 { margin: 0 0 8px; font-size: 14px; text-transform: capitalize; }
.year-day-header { display: grid; grid-template-columns: 96px repeat(31, minmax(3px, 1fr)); align-items: end; margin-bottom: 3px; }
.year-day-label { padding-left: 2px; color: var(--ink-muted); font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.year-day-number { min-width: 0; color: var(--ink-muted); font-size: 7px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1; text-align: center; }
.year-day-number.invalid { visibility: hidden; }
.year-day-number.today { margin: -3px 0; padding: 3px 0; border-radius: 4px; background: #f2cf4a; color: #4f3b00; font-weight: 900; }
.year-team-block { padding: 5px 0 7px; border-top: 1px solid #edf0ec; }
.year-team-block:first-of-type { border-top: 0; }
.year-team { display: grid; grid-template-columns: 96px repeat(31, minmax(3px, 1fr)); align-items: center; height: 24px; }
.year-team-name { position: sticky; left: 0; z-index: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 700; background: white; padding: 2px 5px 2px 2px; }
.year-team-name:hover, .year-team-name:focus-visible { color: var(--brand-strong); background: var(--surface-muted); }
.year-day { min-width: 0; height: 12px; padding: 0; display: flex; align-items: flex-end; justify-content: center; gap: 1px; border: 0; border-radius: 2px; background: #edf0ec; margin-right: 1px; }
.year-day.work { background: var(--team-color); }
.year-day.empty-day { border: 1px solid #dfe5df; background: white; }
.year-day.work:is(button) { cursor: pointer; }
.year-day.work:is(button):hover { filter: brightness(1.12); }
.year-day.today { box-shadow: inset 0 0 0 2px #ffd84a, inset 0 0 0 3px #654d00; }
.year-day.empty-day.today { background: #fff8d8; }
.year-day.invalid { visibility: hidden; }

.section-heading { display: flex; justify-content: flex-end; align-items: end; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 26px; }
.team-grid { display: grid; grid-template-columns: repeat(3, minmax(280px, 1fr)); gap: 16px; }
.team-card { background: white; border: 1px solid var(--line); border-top: 4px solid var(--team-color); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.team-card-head { padding: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.team-card h3 { margin: 3px 0 0; font-size: 20px; }
.country { color: var(--ink-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.team-stat { color: var(--ink-muted); background: var(--surface-muted); padding: 5px 8px; border-radius: 20px; font-size: 11px; white-space: nowrap; }
.contact-list { border-top: 1px solid var(--line); }
.contact-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid #edf0ec; }
.contact-row:last-child { border-bottom: 0; }
.contact-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; flex-wrap: wrap; }
.contact-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--team-color, #3d7a55) 13%, white); color: color-mix(in srgb, var(--team-color, #3d7a55) 75%, black); font-size: 11px; font-weight: 800; }
.contact-copy { min-width: 0; display: grid; }
.contact-copy strong { font-size: 13px; }
.contact-copy span, .contact-copy a { color: var(--ink-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.leader-tag, .access-tag { color: var(--brand-strong); font-size: 10px; font-weight: 750; background: #e7f2e7; border-radius: 20px; padding: 3px 6px; }
.access-tag { color: #2f5e7d; background: #e5f1f7; }
.team-card-actions { padding: 12px 18px; display: flex; gap: 8px; background: #fafbf8; border-top: 1px solid var(--line); }
.team-scope-note { margin-left: auto; align-self: center; color: var(--ink-muted); font-size: 10px; }
.branch-grid { display: grid; grid-template-columns: repeat(3, minmax(280px, 1fr)); gap: 16px; }
.branch-card { position: relative; min-height: 190px; padding: 18px; overflow: hidden; border: 1px solid var(--line); border-top: 4px solid var(--branch-color); border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow); }
.branch-card-mark { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--branch-soft); color: var(--branch-color); font-size: 19px; }
.branch-card-copy { padding-right: 44px; }
.branch-card-copy > span { color: var(--branch-color); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.branch-card-copy h3 { margin: 3px 0; font-size: 20px; }
.branch-card-copy p { min-height: 34px; margin: 0; color: var(--ink-muted); font-size: 11px; }
.branch-card-stats { margin: 14px 0 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.branch-card-stats span { padding: 8px; border-radius: 8px; background: var(--branch-soft); color: var(--branch-color); font-size: 9px; }
.branch-card-stats strong { display: block; color: var(--ink); font-size: 17px; }
.branch-map-panel { margin-top: 18px; overflow: hidden; }
.branch-map-panel .panel-heading > div { display: grid; }
.branch-map-panel .panel-heading .eyebrow { margin: 0 0 2px; }
.branch-map { height: 420px; background: #e8eee8; }
.branch-map-empty { margin: 0; padding: 12px 18px; color: var(--ink-muted); font-size: 12px; }
.branch-map-marker { border: 0; background: transparent; }
.branch-map-marker span { width: 24px; height: 24px; display: block; border: 4px solid white; border-radius: 50% 50% 50% 0; background: var(--branch-color); box-shadow: 0 2px 8px rgb(18 45 58 / 35%); transform: rotate(-45deg); }
.branch-map .leaflet-control-attribution { font-size: 9px; }
.link-button { border: 0; background: transparent; color: var(--brand-strong); padding: 5px; font-size: 12px; font-weight: 650; }
.link-button.invite-action { color: #276b4b; text-decoration: underline; text-decoration-color: #b7d5c0; text-underline-offset: 3px; }
.link-button.danger-link { color: #a33a34; }
.invite-row { padding: 11px 12px; border: 1px solid #cddccf; border-radius: 10px; background: #f2f7ef; }
.invite-row input { accent-color: var(--brand); }
.empty { padding: 32px; text-align: center; color: var(--ink-muted); }
.admin-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.panel-heading { min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-heading h3 { margin: 0; font-size: 16px; }
.count-badge, .subtle { color: var(--ink-muted); font-size: 11px; }
.record-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid #edf0ec; }
.record-row:last-child { border: 0; }
.record-copy { min-width: 0; display: grid; }
.record-copy strong { font-size: 13px; }
.record-copy span { color: var(--ink-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.role-badge { font-size: 10px; font-weight: 750; border-radius: 20px; padding: 4px 7px; background: var(--surface-muted); color: var(--ink-muted); }
.role-badge.admin { background: #e7f2e7; color: var(--brand-strong); }
.account-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.audit-list { max-height: 540px; overflow: auto; }
.audit-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; padding: 12px 18px; align-items: start; border-bottom: 1px solid #edf0ec; }
.audit-mark { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-top: 6px; }
.audit-copy { display: grid; font-size: 12px; }
.audit-copy span { color: var(--ink-muted); font-size: 11px; }
.audit-time { color: var(--ink-muted); font-size: 10px; white-space: nowrap; }

.dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 0; border-radius: var(--radius-lg); padding: 0; box-shadow: 0 24px 90px rgb(13 35 28 / 28%); color: var(--ink); }
.dialog::backdrop { background: rgb(12 30 24 / 55%); backdrop-filter: blur(3px); }
.dialog form { padding: 22px; }
.small-dialog { width: min(480px, calc(100vw - 32px)); }
.dialog-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.dialog-head h2 { margin: 2px 0 0; font-size: 23px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.color-field { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.color-field legend, .date-range-picker legend { margin-bottom: 7px; padding: 0; color: #36423e; font-size: 13px; font-weight: 700; }
.color-swatches { min-height: 46px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-swatch { position: relative; width: 42px; height: 42px; padding: 5px; border: 2px solid transparent; border-radius: 50%; background: transparent; }
.color-swatch > span { width: 28px; height: 28px; display: block; border: 2px solid white; border-radius: 50%; background: var(--team-color, var(--branch-color)); box-shadow: 0 0 0 1px rgb(23 35 31 / 28%); }
.color-swatch:hover:not(:disabled) { background: var(--surface-muted); }
.color-swatch.selected { border-color: var(--ink); }
.color-swatch.selected::after { content: "✓"; position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; display: grid; place-items: center; border: 2px solid white; border-radius: 50%; background: var(--ink); color: white; font-size: 10px; font-weight: 900; }
.color-swatch:disabled { cursor: not-allowed; opacity: .2; filter: grayscale(.7); }
.date-range-picker { position: relative; margin: 0 0 18px; padding: 0; border: 0; }
.date-range-trigger { width: 100%; min-height: 48px; padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; border: 1px solid #cbd4cc; border-radius: var(--radius-sm); background: white; color: var(--ink); font-weight: 650; text-align: left; }
.date-range-trigger[aria-expanded="true"] { border-color: var(--focus); box-shadow: 0 0 0 3px rgb(36 107 219 / 12%); }
.date-range-popover { position: absolute; z-index: 12; top: calc(100% - 10px); left: 0; width: min(390px, 100%); padding: 14px; border: 1px solid #cbd4cc; border-radius: 14px; background: white; box-shadow: 0 18px 45px rgb(23 35 31 / 20%); }
.range-calendar-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; text-align: center; }
.range-calendar-head strong { text-transform: capitalize; }
.range-weekdays, .range-calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.range-weekdays { margin: 12px 0 5px; color: var(--ink-muted); font-size: 10px; font-weight: 750; text-align: center; }
.range-calendar-days button { min-width: 0; min-height: 38px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.range-calendar-days button:hover { background: var(--surface-muted); }
.range-calendar-days button.between { border-radius: 0; background: #e4f0e5; }
.range-calendar-days button.selected { background: var(--brand); color: white; font-weight: 650; }
.range-calendar-days button.today:not(.selected) { box-shadow: inset 0 0 0 2px var(--accent); }
.range-calendar-foot { margin-top: 12px; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); }
.range-calendar-foot > span { color: var(--ink-muted); font-size: 10px; }
.optional { color: var(--ink-muted); font-weight: 500; }
.field-help { color: var(--ink-muted); font-size: 11px; font-weight: 500; }
.member-email-help { margin: -11px 0 17px; }
.check-row { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 9px; }
.check-row input { width: 20px; min-height: 20px; }
.invisible-label { color: transparent; }
.status-preview { min-height: 44px; display: flex; align-items: center; padding: 11px 12px; border-radius: var(--radius-sm); color: var(--success); background: #e8f3e9; font-size: 13px; }
.status-preview.home { color: var(--ink-muted); background: repeating-linear-gradient(135deg, #eef0ec, #eef0ec 6px, white 6px, white 12px); border: 1px solid var(--line); }
.work-period-help { margin: 0 0 18px; padding: 11px 12px; display: grid; gap: 3px; border: 1px solid #cce0d1; border-radius: var(--radius-sm); background: #edf7ee; }
.work-period-help strong { color: var(--success); font-size: 12px; }
.work-period-help span { color: var(--ink-muted); font-size: 11px; font-weight: 550; }
.period-group-info { margin: -3px 0 16px; padding: 10px 12px; display: grid; grid-template-columns: 10px 1fr 1fr; gap: 10px; align-items: center; border: 1px solid #dbe4dc; border-radius: var(--radius-sm); background: #f7faf7; }
.group-info-mark { width: 8px; height: 36px; border-radius: 8px; background: var(--team-color); }
.period-group-info > span { min-width: 0; display: grid; }
.period-group-info small { color: var(--ink-muted); font-size: 9px; font-weight: 650; }
.period-group-info strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.branch-allocation { margin: 0 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fafbf8; }
.branch-allocation legend { padding: 0 6px; font-size: 13px; font-weight: 750; }
.branch-allocation > p { margin: 0 0 10px; color: var(--ink-muted); font-size: 10px; font-weight: 500; }
.allocation-empty { margin: 0 !important; padding: 9px; border-radius: 7px; background: white; color: var(--ink-muted); }
.branch-range-add { width: 100%; margin-top: 9px; }
.branch-range-card { margin-top: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.branch-range-card.highlighted { border-color: #d8a22e; box-shadow: 0 0 0 3px rgb(216 162 46 / 15%); }
.branch-range-head { display: grid; grid-template-columns: 1fr 36px; gap: 8px; align-items: start; }
.branch-range-head label { margin-bottom: 10px; }
.branch-range-remove { width: 36px; height: 36px; margin-top: 22px; }
.branch-date-picker { margin-bottom: 10px; }
.branch-date-popover { position: static; width: 100%; margin-top: 8px; box-shadow: none; }
.range-day-unavailable { min-height: 38px; border-radius: 8px; background: #f5f6f3; opacity: .45; }
.branch-range-people { margin: 0; padding: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; border: 1px solid #e2e7e2; border-radius: 8px; }
.branch-range-people legend { padding: 0 5px; color: var(--ink-muted); font-size: 10px; font-weight: 750; }
.range-person { min-width: 0; margin: 0; display: flex; align-items: center; gap: 7px; font-size: 11px; }
.range-person input { width: 18px; min-height: 18px; flex: 0 0 auto; }
.range-person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-tooltip { position: fixed; z-index: 90; top: 112px; right: 24px; width: min(290px, calc(100vw - 32px)); padding: 14px; border: 1px solid #cdd8d0; border-radius: 12px; background: white; color: var(--ink); box-shadow: 0 16px 45px rgb(13 35 28 / 22%); pointer-events: none; }
.tooltip-kicker { display: block; color: var(--brand); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.team-tooltip > strong { display: block; margin: 2px 0 10px; font-size: 17px; }
.tooltip-metrics { display: grid; grid-template-columns: .7fr 1.3fr; gap: 7px; }
.tooltip-metrics > span { padding: 8px; display: grid; border-radius: 7px; background: var(--surface-muted); font-size: 10px; }
.tooltip-metrics b { font-size: 18px; }
.tooltip-metrics small { color: var(--ink-muted); font-size: 8px; }
.tooltip-members { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 4px; }
.tooltip-members span { padding: 3px 6px; border-radius: 10px; background: #f3f5f1; color: var(--ink-muted); font-size: 9px; }
.dialog-actions { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; }
.spacer { flex: 1; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--nav); color: white; border-radius: 9px; padding: 11px 16px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; font-weight: 650; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--error); }

@media (max-width: 1120px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
  .branch-grid { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
  .year-calendar { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; background: var(--nav); }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; min-height: 100dvh; background: var(--nav); color: var(--ink-on-dark); }
  .login-card .eyebrow { color: #a9cd79; }
  .login-card h2 { color: white; }
  .login-card .muted, .login-card label, .login-card .security-note { color: rgb(248 251 247 / 72%); }
  .login-card .security-note span { color: #a9cd79; }
  .login-card .form-error { color: #ffd0d0; }
  .login-card input { border-color: rgb(255 255 255 / 28%); }
  .login-card .button.primary { background: #4f9668; }
  .mobile-logo { display: flex; padding: 0; background: transparent; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 60; inset: auto 0 0; width: 100%; height: calc(76px + env(safe-area-inset-bottom)); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); transform: none; box-shadow: 0 -8px 30px rgb(13 35 28 / 18%); }
  .sidebar .logo, .sidebar-foot { display: none; }
  .sidebar nav { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .nav-item { min-width: 0; min-height: 58px; padding: 6px 2px; flex-direction: column; justify-content: center; gap: 3px; border-radius: 11px; font-size: 10.5px; line-height: 1.05; text-align: center; }
  .nav-item span { width: auto; font-size: 18px; line-height: 1; }
  .nav-item b { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-item.active { background: rgb(255 255 255 / 15%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%); }
  .main-column { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .mobile-menu { display: none; }
  .topbar { min-height: 84px; }
  .today-label { display: none; }
  .admin-layout { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .content { padding: 14px 10px 28px; }
  .topbar { min-height: 92px; padding: 30px 12px 12px; align-items: center; }
  .topbar .eyebrow { font-size: 9px; }
  .topbar h1 { font-size: 23px; }
  .top-actions { gap: 7px; }
  .sync-status { position: absolute; top: 8px; right: 12px; font-size: 10px; line-height: 1.2; }
  #new-period { min-height: 42px; padding: 8px 10px; font-size: 12px; white-space: nowrap; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .summary-card { padding: 12px; }
  .summary-card .label { font-size: 9px; }
  .summary-card strong { font-size: 22px; }
  .summary-card .detail { font-size: 10px; }
  .calendar-toolbar { align-items: stretch; flex-direction: column; padding: 14px; }
  .date-navigation { display: grid; grid-template-columns: 40px auto 40px 1fr; }
  .date-navigation h2 { grid-column: 1 / -1; grid-row: 2; margin: 7px 0 0; min-width: 0; }
  .segmented { align-self: flex-start; }
  .legend { padding: 6px 14px 10px; }
  .timeline.month-days-28 { --timeline-width: 1156px; }
  .timeline.month-days-29 { --timeline-width: 1192px; }
  .timeline.month-days-30 { --timeline-width: 1228px; }
  .timeline.month-days-31 { --timeline-width: 1264px; }
  .timeline-header, .timeline-row { grid-template-columns: 148px repeat(var(--month-days), minmax(36px, 1fr)); }
  .timeline-corner, .timeline-team { width: 148px; }
  .timeline-period-copy small { display: none; }
  .team-grid { grid-template-columns: 1fr; }
  .branch-grid { grid-template-columns: 1fr; }
  .year-calendar { width: 100%; grid-template-columns: minmax(0, 1fr); padding-inline: 6px; gap: 8px; }
  .year-month { width: 100%; min-width: 0; padding: 9px 7px; }
  .year-day-header, .year-team { width: 100%; min-width: 0; grid-template-columns: 54px repeat(31, minmax(0, 1fr)); }
  .year-team-name { position: static; min-width: 0; padding-right: 3px; font-size: 8px; }
  .year-day-label { font-size: 6px; }
  .year-day-number { overflow: hidden; font-size: 6px; letter-spacing: -.04em; }
  .year-day { height: 10px; margin-right: 1px; border-radius: 1px; }
  .year-day.today { box-shadow: inset 0 0 0 1px #ffd84a, inset 0 0 0 2px #654d00; }
  .section-heading { align-items: flex-start; gap: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .invisible-label { display: none; }
  .dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
  .dialog form { min-height: 100%; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }
  .dialog-head { position: sticky; z-index: 2; top: -18px; margin: -18px -16px 18px; padding: 16px; border-bottom: 1px solid var(--line); background: white; }
  .dialog-actions { position: sticky; z-index: 2; bottom: calc(-18px - env(safe-area-inset-bottom)); margin: 8px -16px calc(-18px - env(safe-area-inset-bottom)); padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); flex-wrap: wrap; background: white; }
  .dialog-actions .button { flex: 1 1 auto; min-height: 46px; }
  .period-group-info { grid-template-columns: 10px 1fr; }
  .period-group-info > span:last-child { grid-column: 2; }
  .branch-range-people { grid-template-columns: 1fr; }
  .date-range-popover { position: static; width: 100%; margin-top: 8px; box-shadow: none; }
  .team-tooltip { top: auto; right: 16px; bottom: calc(90px + env(safe-area-inset-bottom)); left: 16px; width: auto; }
  .contact-row { grid-template-columns: 34px 1fr; align-items: start; padding: 13px 14px; }
  .contact-actions { grid-column: 2; justify-content: flex-start; }
  .contact-actions .link-button { min-height: 38px; padding: 7px 5px; }
  .team-card-actions { padding: 10px 14px; flex-wrap: wrap; }
  .team-scope-note { flex-basis: 100%; margin-left: 5px; }
  .record-row { grid-template-columns: 38px 1fr; padding: 12px 14px; }
  .account-actions { grid-column: 2; justify-content: flex-start; }
  .branch-map { height: 340px; }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); text-align: center; }
}

@media (max-width: 360px) {
  .year-day-header, .year-team { grid-template-columns: 48px repeat(31, minmax(0, 1fr)); }
  .year-team-name { font-size: 7px; }
  .year-day-number { font-size: 5px; }
  .year-day { margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
