:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #17243a;
  background: #f4f6fa;
  font-synthesis: none;
  --navy: #17243a;
  --blue: #00437b;
  --brand-red: #ed1844;
  --brand-red-contrast: #b81438;
  --line: #e4e9f1;
  --muted: #748198;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; text-decoration: none; }
.topbar { height: 90px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 15px; letter-spacing: -.3px; }
.brand-logo { display: block; width: 125px; height: auto; flex: 0 0 auto; }
.brand-caption { color: var(--muted); font-size: 11px; letter-spacing: .3px; }
.user-menu { display: flex; align-items: center; gap: 18px; color: #59667b; font-size: 13px; }
.user-menu form { margin: 0; }
.link-button { padding: 0; border: 0; background: none; color: var(--blue); cursor: pointer; font: inherit; }
.app-shell { display: flex; min-height: calc(100vh - 90px); }
.sidebar { width: 224px; flex: 0 0 224px; padding: 22px 12px; border-right: 1px solid var(--line); background: #fff; }
.sidebar-menu-toggle { display: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 5px; }
.sidebar-link { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; border-radius: 7px; color: #536078; font-size: 13px; font-weight: 600; }
.sidebar-link:hover { background: #f1f5f8; color: var(--blue); }
.sidebar-count { min-width: 22px; padding: 3px 6px; border-radius: 12px; background: #e8f1f8; color: var(--blue); font-size: 11px; text-align: center; }
.page { flex: 1; width: 100%; min-width: 0; max-width: 1600px; margin: 0 auto; padding: 34px 32px 54px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 26px; }
.page-heading h1, .login-card h1 { margin: 2px 0 6px; font-size: 29px; letter-spacing: -.8px; }
.eyebrow { margin: 0; color: var(--brand-red-contrast); font-size: 10px; font-weight: 800; letter-spacing: 1.4px; }
.muted { color: var(--muted); font-size: 13px; }
.page-heading .muted { margin: 0; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
.button.primary { background: var(--blue); color: white; box-shadow: 0 3px 8px #00437b2a; }
.button.secondary { background: #fff; border-color: var(--line); color: #4a5870; }
.toolbar { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.week-nav, .filters { display: flex; align-items: center; gap: 11px; }
.week-nav strong { min-width: 150px; text-align: center; font-size: 14px; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: #58667b; font-size: 18px; }
.calendar-page-heading .button { min-height: 46px; }
.calendar-new-job { white-space: nowrap; }
.today-link { min-height: 44px; margin-left: 3px; color: var(--blue); font-size: 12px; font-weight: 700; }
.filters select, .status-form select { min-height: 34px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 7px; background-color: white; color: #46546b; font: inherit; font-size: 12px; }
.calendar-toggle { display: flex; gap: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; padding: 17px 2px; color: #69768a; font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.calendar-swipe-hint { margin: 10px 0 0; }
.calendar-scroll { width: 100%; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.calendar-grid { display: grid; grid-template-columns: 58px repeat(7, minmax(0, 1fr)); min-width: 0; background: white; }
.calendar-grid-day { grid-template-columns: 58px minmax(0, 1fr); min-width: 0; }
.time-axis-column { position: sticky; left: 0; z-index: 4; background: #fff; border-right: 1px solid var(--line); }
.time-axis-heading { font-size: 9px; }
.time-axis-body { position: relative; height: var(--calendar-height); }
.time-label { position: absolute; top: 0; right: 6px; transform: translateY(-50%); color: var(--muted); font-size: 9px; }
.time-label-start { transform: none; }
.time-label-end { transform: translateY(-100%); }
.day-column { min-width: 0; border-right: 1px solid var(--line); }
.calendar-grid-day .day-column { min-width: 0; }
.day-column:last-child { border-right: 0; }
.day-heading { position: sticky; top: 0; z-index: 3; height: 61px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.day-heading strong { color: var(--navy); font-size: 17px; }
.day-content { position: relative; height: var(--calendar-height); overflow: hidden; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--calendar-slot-height) - 1px), #e8edf4 calc(var(--calendar-slot-height) - 1px), #e8edf4 var(--calendar-slot-height)); }
.calendar-slot { position: absolute; z-index: 0; left: 0; right: 0; height: var(--calendar-slot-height); border-bottom: 1px solid #f0f2f6; }
.calendar-slot:hover, .calendar-slot:focus-visible { background: #00437b0d; outline: 0; }
.calendar-slot-readonly { pointer-events: none; }
.calendar-empty-label { position: absolute; top: 12px; left: 8px; color: var(--muted); font-size: 11px; }
.calendar-appointment { position: absolute; z-index: 2; display: flex; flex-direction: column; overflow: hidden; min-width: 0; padding: 4px 5px; border: 1px solid var(--location-border, #aeb8c7); border-left: 4px solid var(--location-border, #aeb8c7); border-radius: 5px; background: var(--location-bg, #f8fafc); box-shadow: 0 1px 4px #17243a1a; }
.location-color-0 { --location-bg: #18703e; --location-border: #18703e; }
.location-color-1 { --location-bg: #185caa; --location-border: #185caa; }
.location-color-2 { --location-bg: #b52a32; --location-border: #b52a32; }
.location-color-3 { --location-bg: #f5efff; --location-border: #8052ba; }
.location-color-4 { --location-bg: #fff0f2; --location-border: #bf4a62; }
.location-color-5 { --location-bg: #e9f7f8; --location-border: #27848b; }
.location-color-6 { --location-bg: #f5f5e9; --location-border: #7a8536; }
.location-color-7 { --location-bg: #465469; --location-border: #465469; }
.location-dot-0 { background: #18703e; }
.location-dot-1 { background: #185caa; }
.location-dot-2 { background: #b52a32; }
.location-dot-3 { background: #8052ba; }
.location-dot-4 { background: #bf4a62; }
.location-dot-5 { background: #27848b; }
.location-dot-6 { background: #7a8536; }
.location-dot-7 { background: #626c83; }
.appointment-main { display: flex; min-height: 0; flex: 1; flex-direction: column; overflow: hidden; padding-right: 0; color: inherit; line-height: 1.15; }
.appointment-open { width: 100%; min-width: 0; padding: 2px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; }
.appointment-open:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.google-calendar-appointment { background: var(--appointment-background, #465469); border-left: 3px dashed #fff9; }
.google-calendar-dot { background: #465469; }
.appointment-open-google { width: 100%; min-width: 0; padding: 2px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.appointment-open-google:focus-visible { outline: 2px solid #247545; outline-offset: -2px; }
.appointment-time { color: #43516a; font-size: 9px; font-weight: 750; white-space: nowrap; }
.appointment-customer { overflow: hidden; font-size: 11px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.appointment-kind, .appointment-location { overflow: hidden; color: #526078; font-size: 9px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.calendar-appointment { color: #fff; }
.calendar-appointment .appointment-main { gap: 1px; line-height: 1.15; }
.calendar-appointment .appointment-time { flex-shrink: 0; color: #fff; font-size: 11px; font-weight: 750; }
.calendar-appointment .appointment-customer { flex-shrink: 0; color: #fff; font-size: 12px; }
.calendar-appointment .appointment-kind, .calendar-appointment .appointment-location { color: #fff; }
.calendar-appointment .appointment-customer { white-space: normal; overflow-wrap: anywhere; line-height: 1.2; flex-shrink: 1; }
.calendar-appointment:focus-within { z-index: 4; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1b3557; }
.google-detail-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.google-details-list > div { min-width: 0; }
.google-details-list { grid-template-columns: minmax(0, 1fr); }
.google-details-list a, .google-participants { overflow-wrap: anywhere; }
.google-participants li { margin-bottom: 10px; }
@media (min-width: 761px) {
  .calendar-grid:not(.calendar-grid-day) { grid-template-columns: 48px repeat(7, minmax(220px, 1fr)); min-width: 1588px; }
}
.appointment-plate { display: block; flex-shrink: 0; overflow: hidden; color: #fff; font-size: 12px; font-weight: 800; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .calendar-grid:not(.calendar-grid-day) { grid-template-columns: 48px repeat(7, minmax(220px, 1fr)); min-width: 1588px; }
}
.calendar-leave-summary { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 5px 0; padding: 7px 10px; border-radius: 6px; background: #f5efff; color: #62428f; font-size: 11px; }
.calendar-leave-summary span { color: #748198; }
.job-card { margin-bottom: 9px; padding: 10px; border: 1px solid var(--line); border-left: 3px solid #aeb8c7; border-radius: 7px; background: #fff; box-shadow: 0 2px 6px #17243a08; }
.status-border-open { border-left-color: #e2a72e; }
.status-border-urgent { border-left-color: #e05252; }
.status-border-occupied { border-left-color: var(--blue); }
.status-border-done { border-left-color: #35a878; }
.job-card-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 7px; }
.job-time { color: #526078; font-size: 10px; font-weight: 700; }
.status-pill { padding: 3px 6px; border-radius: 10px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.status-open { background: #fff4d8; color: #a76b00; }
.status-urgent { background: #fde7e5; color: #c33f38; }
.status-occupied { background: #e6eff5; color: var(--blue); }
.status-done { background: #e3f6ed; color: #24835c; }
.status-requested { background: #fff4d8; color: #a76b00; }
.status-ordered { background: #e6eff5; color: var(--blue); }
.status-received { background: #e3f6ed; color: #24835c; }
.status-cancelled { background: #fde7e5; color: #c33f38; }
.job-title { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 750; line-height: 1.35; }
.job-meta { margin-top: 3px; color: #748198; font-size: 10px; line-height: 1.35; }
.employee-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 9px; color: #55637a; font-size: 9px; line-height: 1.4; }
.employee-item { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.employee-item > span:last-child { overflow-wrap: anywhere; }
.avatar { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: #e9f1f7; color: var(--blue); font-size: 9px; font-weight: 700; }
.service-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.service-tags span { padding: 3px 5px; border-radius: 4px; background: #f1f3f7; color: #627087; font-size: 8px; }
.appointment-dialog { width: min(560px, calc(100vw - 32px)); max-height: min(82vh, 760px); margin: auto; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--navy); box-shadow: 0 20px 70px #101c3070; }
.appointment-dialog::backdrop { background: #101c3070; }
.appointment-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.appointment-dialog-header h2 { margin: 4px 0 0; font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.appointment-dialog-close { width: 44px; height: 44px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #536078; font-size: 25px; cursor: pointer; }
.appointment-details-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.appointment-details-list > div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafd; }
.appointment-details-list dt, .calendar-status-form label { margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.appointment-details-list dd { margin: 0; font-size: 14px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.appointment-details-list .status-pill { display: inline-block; padding: 5px 9px; font-size: 12px; }
.appointment-dialog-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 18px; }
.calendar-status-form { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.calendar-status-form label { flex: 0 0 100%; margin: 0; }
.calendar-status-form select { min-width: 150px; min-height: 44px; flex: 1; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy); font: inherit; }
.empty-day { min-height: 75px; display: grid; place-items: center; border: 1px dashed #dce2eb; border-radius: 7px; color: #8a96a9; font-size: 11px; }
.add-day-link { display: block; padding: 8px 2px; color: var(--blue); font-size: 10px; text-align: center; }
.messages { margin-bottom: 16px; }
.message { padding: 11px 14px; border-radius: 7px; background: #eaf2f8; color: var(--blue); font-size: 13px; }
.message.error { margin: 10px 0; background: #fde7e5; color: #a4332d; }
.job-form { max-width: 900px; }
.job-form .form-section { margin-bottom: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.job-form .form-section h2 { margin: 0 0 12px; font-size: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.job-form .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.field { display: flex; flex-direction: column; gap: 7px; color: #4c5a70; font-size: 12px; font-weight: 650; }
.field-wide { grid-column: 1 / -1; }
.form-control { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid #dfe5ee; border-radius: 7px; background: white; color: var(--navy); font: inherit; font-size: 13px; }
.job-form .form-control { min-height: 36px; padding: 7px 9px; }
.job-form .field-help { font-size: 11px; }
textarea.form-control { min-height: 100px; resize: vertical; }
.checkbox-list ul { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 0; padding: 0; list-style: none; }
.job-form .checkbox-list ul, .job-form .checkbox-list > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px; }
.job-form .checkbox-list > div { width: 100%; min-height: 0; padding: 0; border: 0; background: transparent; }
.job-form .checkbox-list > div > div { min-width: 0; }
.checkbox-list li, .check-card { color: #4c5a70; font-size: 12px; font-weight: 500; }
.checkbox-list label { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; }
.job-form .checkbox-list label { min-height: 34px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
.checkbox-list input, .check-card input { width: auto; min-height: 0; margin: 0; padding: 0; accent-color: var(--blue); }
.checkbox-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 18px; }
.check-card { display: flex; align-items: center; gap: 7px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
.notes-field { font-weight: 600; }
.field-error { color: #c33f38; font-size: 11px; font-weight: 500; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; }
.task-sections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 15px; }
.task-section, .task-card, .empty-state { padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.section-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.section-heading h2 { margin: 0; font-size: 15px; }
.count-badge { min-width: 21px; padding: 3px 6px; border-radius: 12px; background: #eef2f8; color: #65728a; font-size: 10px; text-align: center; }
.task-card { margin-bottom: 10px; border-left: 3px solid #aeb8c7; }
.task-card:last-child { margin-bottom: 0; }
.priority-border-low { border-left-color: #9daaba; }
.priority-border-normal { border-left-color: #4386d9; }
.priority-border-high { border-left-color: #e2a72e; }
.priority-border-urgent { border-left-color: #e05252; }
.task-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.task-title { color: var(--navy); font-size: 13px; font-weight: 750; line-height: 1.4; }
.task-description { margin: 8px 0; color: #5d6a80; font-size: 12px; line-height: 1.5; white-space: pre-line; }
.task-meta { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.priority-pill { display: inline-block; flex: 0 0 auto; padding: 3px 7px; border-radius: 10px; font-size: 9px; font-weight: 700; }
.priority-low { background: #eff2f5; color: #5f6e81; }
.priority-normal { background: #e8f1f8; color: var(--blue); }
.priority-high { background: #fff4d8; color: #a76b00; }
.priority-urgent { background: #fde7e5; color: #c33f38; }
.complete-form { margin-top: 11px; }
.small-button { min-height: 30px; padding: 0 10px; background: #f0f5f9; color: var(--blue); font-size: 11px; }
.task-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.task-list .task-card { margin: 0; }
.task-filter { justify-content: flex-start; }
.task-filter label, .inline-form label { color: #536078; font-size: 12px; font-weight: 650; }
.task-filter .compact-input { margin: 0; }
.compact-input { width: auto; min-width: 160px; min-height: 36px; }
.empty-state { color: var(--muted); font-size: 12px; }
.report-tag { display: inline-block; margin-top: 7px; padding: 3px 6px; border-radius: 5px; background: #f2f3f7; color: #69768a; font-size: 9px; }
.text-link { display: inline-block; margin-top: 9px; color: var(--blue); font-size: 11px; font-weight: 700; }
.operation-form { max-width: 980px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.report-task-list { display: grid; gap: 7px; }
.report-task { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; color: #536078; font-size: 11px; }
.report-task strong { color: var(--navy); }
.table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.report-table th, .report-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.report-table th { color: #68758a; font-size: 10px; text-transform: uppercase; }
.weekly-filters { justify-content: flex-end; }
.weekly-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
.weekly-summary > div, .weekly-month-summary > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.weekly-summary span, .weekly-month-summary span { color: var(--muted); font-size: 10px; }
.weekly-summary strong, .weekly-month-summary strong { color: var(--navy); font-size: 15px; }
.weekly-month-summary { display: grid; grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 15px; }
.weekly-month-summary .eyebrow { font-size: 9px; }
.weekly-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 9px; }
.weekly-toolbar p { margin: 0; }
.weekly-table-wrap { max-height: calc(100vh - 330px); min-height: 320px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.weekly-table { table-layout: fixed; font-size: 10px; }
.weekly-table-admin { min-width: 2050px; }
.weekly-table-employee { min-width: 1380px; }
.weekly-table th { position: sticky; z-index: 1; top: 0; padding: 8px 6px; background: #f7f9fc; font-size: 9px; }
.weekly-table th:nth-child(1) { width: 130px; }
.weekly-table th:nth-child(2) { width: 155px; }
.weekly-table th:nth-child(3) { width: 105px; }
.weekly-table th:nth-child(4) { width: 120px; }
.weekly-table-admin th:nth-child(5) { width: 105px; }
.weekly-table-admin th:nth-child(6) { width: 160px; }
.weekly-table-admin th:nth-child(7), .weekly-table-admin th:nth-child(8) { width: 128px; }
.weekly-table-admin th:nth-child(9) { width: 170px; }
.weekly-table-admin th:nth-child(10) { width: 145px; }
.weekly-table-admin th:nth-child(11), .weekly-table-admin th:nth-child(12), .weekly-table-admin th:nth-child(13), .weekly-table-admin th:nth-child(14), .weekly-table-admin th:nth-child(15) { width: 125px; }
.weekly-table-employee th:nth-child(5) { width: 160px; }
.weekly-table-employee th:nth-child(6), .weekly-table-employee th:nth-child(7) { width: 128px; }
.weekly-table-employee th:nth-child(8) { width: 170px; }
.weekly-table-employee th:nth-child(9) { width: 145px; }
.weekly-table-employee th:nth-child(10) { width: 125px; }
.weekly-table td { padding: 3px 4px; white-space: normal; vertical-align: middle; }
.weekly-input { width: 100%; min-width: 0; height: 29px; padding: 4px 5px; border: 1px solid #e1e6ee; border-radius: 4px; background: #fff; color: var(--navy); font: inherit; font-size: 10px; }
.weekly-input:focus { border-color: var(--blue); outline: 2px solid #00437b22; }
.weekly-date-cell small, .weekly-job-label { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.money-input { text-align: right; }
.deductible-control { display: grid; grid-template-columns: 38px minmax(40px, 1fr) 38px; gap: 3px; }
.deductible-step, .payment-quick { min-height: 25px; padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; background: #f6f8fb; color: #4c5a70; font: inherit; font-size: 9px; font-weight: 700; cursor: pointer; }
.payment-quick-actions { display: flex; gap: 4px; margin-top: 3px; }
.payment-quick { flex: 1; }
.payment-quick.cash { border-color: #b9e5d0; background: #e6f7ee; color: #20754f; }
.payment-quick.transfer { border-color: #f1c1be; background: #fff0ef; color: #b43e37; }
.payment-quick.no-deductible { border-color: #c4d6e2; background: #edf4f8; color: var(--blue); }
.weekly-save-state { color: var(--muted); font-size: 9px; }
.weekly-row:focus-within { background: #f8fbff; }
.weekly-input:disabled, .deductible-step:disabled, .payment-quick:disabled { background: #f1f3f6; color: #8a96a9; cursor: not-allowed; }
.employee-weekly-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.weekly-open-payments { max-width: 100%; padding: 16px; }
.weekly-open-payments .section-heading { margin-bottom: 6px; }
.weekly-open-payments .muted { margin: 0 0 12px; }
.open-payment-table { min-width: 760px; }
.open-payment-table .text-link { margin: 0; }
.payment-status { display: inline-block; padding: 4px 7px; border-radius: 12px; background: #eef2f8; color: #536078; font-size: 10px; font-weight: 700; }
.payment-status-open, .payment-status-transfer_pending { background: #fde7e5; color: #a4332d; }
.payment-status-partially_paid { background: #fff4d8; color: #8d5b00; }
.payment-status-paid { background: #e3f6ed; color: #20754f; }
.payment-open { background: #fffafa; }
.payment-overdue { background: #fff0ef; }
.payment-confirm-form { display: flex; align-items: center; gap: 6px; }
.payment-confirm-form .weekly-input { width: 135px; }
.payment-confirm-form .button { min-height: 28px; padding: 0 8px; white-space: nowrap; }
.payment-overdue { background: #fff7f6; }
.overdue-label { display: block; margin-top: 3px; color: #b43e37; font-size: 9px; }
.button.danger { background: #b43e37; color: #fff; }
.message.warning { background: #fff4d8; color: #805400; }
.leave-conflict-warning ul { margin: 8px 0; padding-left: 20px; }
.leave-warning-confirm { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 700; }
.leave-calendar-card { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; padding: 9px; border: 1px solid #c4d6e2; border-radius: 7px; background: #edf4f8; color: var(--blue); font-size: 10px; }
.leave-calendar-card span { color: #536078; }
.leave-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.leave-status { display: inline-block; padding: 4px 7px; border-radius: 12px; background: #fff4d8; color: #8d5b00; font-size: 10px; font-weight: 700; }
.leave-status-approved { background: #e3f6ed; color: #20754f; }
.leave-status-rejected { background: #fde7e5; color: #a4332d; }
.overlap-warning { display: block; margin-top: 5px; color: #a4332d; font-size: 10px; }
.leave-review-form { display: grid; min-width: 180px; gap: 5px; }
.leave-review-form .button { width: 100%; }
.compact-input { max-width: 210px; }
.admin-dashboard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.dashboard-stat { display: flex; min-width: 0; flex-direction: column; gap: 7px; padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.dashboard-stat > span { color: var(--muted); font-size: 11px; }
.dashboard-stat > strong { color: var(--navy); font-size: 23px; }
.dashboard-stat > a { color: var(--blue); font-size: 11px; font-weight: 700; }
.dashboard-stat.urgent { border-top: 3px solid #d34b45; }
.dashboard-stat.success { border-top: 3px solid #35a878; }
.dashboard-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.dashboard-columns .form-section { min-width: 0; }
.dashboard-notifications { margin-top: 14px; }
.dashboard-notifications .section-heading { justify-content: space-between; }
.notification-card { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.notification-card .text-link { align-self: flex-start; }
.document-table { min-width: 600px; }
.weekly-filters .button, .export-form .button { flex: 0 0 auto; }
.activity-section { margin-top: 18px; }
.activity-section h2 { margin-top: 0; font-size: 15px; }
.activity-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 9px 0; border-top: 1px solid var(--line); color: #536078; font-size: 11px; }
.activity-row time { color: var(--muted); }
.login-page .topbar { display: none; }
.login-page .app-shell { min-height: 100vh; }
.login-card { max-width: 390px; margin: 7vh auto; padding: 30px; border: 1px solid var(--line); border-top: 3px solid var(--brand-red); border-radius: 12px; background: white; box-shadow: 0 12px 40px #17243a0d; }
.login-logo { display: block; width: 190px; max-width: 100%; height: auto; margin: 0 auto 22px; }
.stack-form { display: flex; flex-direction: column; gap: 9px; margin-top: 20px; }
.stack-form label { margin-top: 5px; color: #4c5a70; font-size: 12px; font-weight: 650; }
.stack-form input { min-height: 40px; padding: 8px 10px; border: 1px solid #dfe5ee; border-radius: 7px; font: inherit; }
.full { width: 100%; margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 760px) {
  .topbar { height: 76px; padding: 0 16px; }
  .brand-logo { width: 105px; }
  .app-shell { min-height: calc(100vh - 76px); flex-direction: column; }
  .sidebar { width: 100%; flex: 0 0 auto; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-menu-toggle { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #536078; font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; }
  .sidebar-menu-toggle::-webkit-details-marker { display: none; }
  .sidebar nav { flex-direction: row; overflow-x: auto; }
  .sidebar-navigation[open] nav { margin-top: 7px; }
  .sidebar-link { flex: 0 0 auto; padding: 0 10px; white-space: nowrap; }
  .page { padding: 24px 14px 40px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .page-heading h1 { font-size: 25px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .week-nav { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; justify-content: stretch; gap: 8px; }
  .week-nav strong { min-width: 0; font-size: 13px; }
  .week-nav .icon-button { width: 48px; height: 48px; font-size: 20px; }
  .week-nav .today-link { grid-column: 1 / -1; justify-self: center; min-width: 100px; }
  .calendar-page-heading .button { width: 100%; min-height: 50px; }
  .calendar-toolbar { padding: 12px; }
  .calendar-toolbar .calendar-toggle .button { min-height: 44px; }
  #week-nav { touch-action: pan-y; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters select { min-width: 0; width: 100%; }
  .calendar-grid { grid-template-columns: 48px repeat(7, minmax(170px, 1fr)); min-width: 1240px; }
  .calendar-grid-day { grid-template-columns: 48px minmax(0, 1fr); min-width: 480px; }
  .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
  .job-form .form-grid { grid-template-columns: minmax(0, 1fr); }
  .task-sections, .task-list { grid-template-columns: 1fr; }
  .task-filter { align-items: flex-start; flex-wrap: wrap; }
  .weekly-filters { justify-content: flex-start; }
  .weekly-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weekly-month-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weekly-toolbar { align-items: flex-start; flex-direction: column; }
  .weekly-table-wrap { max-height: 70vh; }
  .payment-confirm-form { align-items: flex-start; flex-direction: column; }
  .admin-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-columns { grid-template-columns: 1fr; }
  .export-form { align-items: stretch; flex-direction: column; }
  .export-form .compact-input { width: 100%; max-width: none; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .calendar-grid { grid-template-columns: 48px repeat(7, minmax(170px, 1fr)); min-width: 1240px; }
  .calendar-grid-day { grid-template-columns: 48px minmax(0, 1fr); min-width: 480px; }
}

@media (max-width: 480px) {
  .user-menu > span { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-section { padding: 16px; }
  .admin-dashboard-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-stat { padding: 12px; }
  .dashboard-stat > strong { font-size: 19px; }
  .filters { grid-template-columns: 1fr; }
  .appointment-dialog { width: calc(100vw - 20px); max-height: 88vh; padding: 18px; border-radius: 12px; }
  .appointment-dialog-header { margin-bottom: 14px; }
  .appointment-dialog-header h2 { font-size: 19px; }
  .appointment-details-list { grid-template-columns: 1fr; gap: 8px; }
  .appointment-details-list > div { padding: 10px; }
  .appointment-dialog-actions { align-items: stretch; flex-direction: column; }
  .appointment-dialog-actions > .button { width: 100%; min-height: 46px; }
  .calendar-status-form select, .calendar-status-form .button { width: 100%; min-height: 46px; }
}
