:root {
  --ink: #17231f;
  --muted: #65716c;
  --paper: #f3f1eb;
  --card: #fff;
  --line: #dedfd9;
  --green: #0b2a40;
  --green-dark: #061d2d;
  --mint: #dce7ee;
  --success: #0d5d46;
  --success-soft: #dcece5;
  --amber: #e9b44c;
  --danger: #a33d36;
  --shadow: 0 18px 45px rgba(28, 43, 36, .08);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; }
.demo-banner { display: grid; gap: 7px; margin: 20px 0; padding: 16px 20px; border: 1px solid #dbb45b; border-radius: 12px; background: #fff5d9; color: #654600; font-size: 13px; }
.demo-banner strong { font-size: 12px; letter-spacing: .06em; }
.demo-modules-fieldset { min-width: 0; margin: 24px 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.demo-modules-fieldset legend { padding: 0 7px; font-weight: 800; }
.demo-mode #password-button, .demo-mode #employee-password-button { display: none; }
.demo-mode button:disabled { cursor: not-allowed; opacity: .5; }
.demo-mode #admin-actions, .demo-mode #candidate-form, .demo-mode #invoice-client-form, .demo-mode #invoice-form, .demo-mode #tpv-license-form, .demo-mode #establishment-user-form, .demo-mode #other-document-form, .demo-mode #important-notice-form, .demo-mode #schedule-import-section, .demo-mode #hours-admin-section, .demo-mode .employee-actions, .demo-mode #app-view button.danger { display: none; }
.topbar { min-height: 78px; padding: 8px max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(23,35,31,.1); background: rgba(243,241,235,.9); }
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.brand img { width: 168px; height: auto; display: block; mix-blend-mode: multiply; }
.brand small { padding-left: 14px; border-left: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
.user-menu { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 14px; }
main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.login-layout { min-height: calc(100vh - 78px); padding: 58px 0 76px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 80px; align-items: center; }
.login-copy h1 { max-width: 650px; margin: 12px 0 18px; font-family: Georgia, serif; font-size: clamp(56px, 7vw, 92px); line-height: .98; font-weight: 500; letter-spacing: -.055em; }
.login-copy > p { max-width: 520px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.privacy-card { margin-top: 38px; max-width: 460px; display: flex; gap: 15px; align-items: center; }
.privacy-icon { flex: 0 0 38px; height: 38px; display: grid; place-items: center; color: var(--green); background: var(--mint); border-radius: 50%; font-weight: 800; }
.privacy-card strong, .privacy-card small { display: block; }
.privacy-card small { margin-top: 4px; color: var(--muted); line-height: 1.5; }
.card { background: var(--card); border: 1px solid rgba(23,35,31,.08); border-radius: 18px; box-shadow: var(--shadow); }
.login-card { padding: 42px; }
.login-card h2, .card h2 { margin: 8px 0 4px; font-family: Georgia, serif; font-size: 31px; font-weight: 500; }
.muted { color: var(--muted); }
label { display: grid; gap: 8px; margin: 20px 0; color: #36423d; font-size: 12px; font-weight: 750; letter-spacing: .04em; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; color: var(--ink); background: #fbfbf9; outline: none; }
textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; color: var(--ink); background: #fbfbf9; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(11,42,64,.12); }
.button { border: 0; border-radius: 9px; padding: 11px 16px; font-weight: 750; font-size: 13px; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--green); }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { color: var(--green); background: var(--mint); }
.button.ghost { padding: 8px 12px; color: var(--green); background: transparent; border: 1px solid var(--line); }
.button.danger { padding: 8px 11px; color: var(--danger); background: #faecea; }
.button.full { width: 100%; padding: 14px; }
.login-help { margin-top: 16px; text-align: center; }
.text-button { padding: 4px; border: 0; color: var(--green); background: transparent; font-size: 13px; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--green-dark); }
.hidden { display: none !important; }
.message { margin: 14px 0 0; padding: 10px; border-radius: 8px; font-size: 12px; }
.message.error { color: var(--danger); background: #faecea; }
.message.success { color: var(--success); background: var(--success-soft); }
.app-view { padding: 66px 0 80px; }
.welcome { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 38px; }
.welcome h1 { margin: 8px 0 6px; font-family: Georgia, serif; font-size: clamp(38px, 5vw, 60px); font-weight: 500; letter-spacing: -.035em; }
.admin-menu-shell { position: sticky; top: 12px; z-index: 8; width: min(340px, 100%); margin-bottom: 28px; }
.admin-menu-toggle { width: 100%; padding: 12px 14px; display: flex; align-items: center; gap: 13px; border: 1px solid rgba(23,35,31,.08); color: var(--ink); background: var(--card); text-align: left; }
.admin-menu-toggle > span:last-child { min-width: 0; display: grid; gap: 2px; }
.admin-menu-toggle small { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.admin-menu-toggle strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hamburger-lines { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; gap: 4px; padding: 10px; border-radius: 11px; background: var(--mint); }
.hamburger-lines span { width: 18px; height: 2px; display: block; border-radius: 999px; background: var(--green); }
.admin-menu { position: absolute; top: calc(100% + 8px); left: 0; width: min(340px, calc(100vw - 40px)); padding: 8px; display: grid; gap: 5px; max-height: var(--admin-menu-available-height, calc(100dvh - 100px)); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; box-shadow: 0 18px 45px rgba(11,42,64,.16); }
.admin-menu-group { min-width: 0; border-bottom: 1px solid var(--line); }
.admin-menu-group:last-child { border-bottom: 0; }
.admin-menu-group summary { padding: 12px 7px; color: var(--ink); font-size: 12px; font-weight: 800; cursor: pointer; overflow-wrap: anywhere; }
.admin-menu-group summary:hover { color: var(--green); background: #eef3f7; border-radius: 8px; }
.admin-menu-group[open] summary { color: var(--green); }
.admin-menu-group-items { display: grid; gap: 3px; padding: 0 0 8px 9px; }
.admin-menu-group summary:focus-visible, .admin-menu-button:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; border-radius: 8px; }
.employee-menu { position: sticky; top: 12px; z-index: 5; margin-bottom: 28px; padding: 8px; display: flex; gap: 5px; overflow-x: auto; box-shadow: 0 10px 28px rgba(11,42,64,.1); }
.admin-menu-button, .employee-menu-button { flex: 1 0 auto; min-width: 105px; padding: 11px 13px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; white-space: nowrap; }
.admin-menu-button { width: 100%; min-width: 0; text-align: left; white-space: normal; }
.admin-menu-button:hover, .employee-menu-button:hover { color: var(--green); background: #eef3f7; }
.admin-menu-button.active, .employee-menu-button.active { color: white; background: var(--green); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
.admin-module-grid { grid-template-columns: 1fr; }
.admin-grid .card { padding: 28px; }
.card-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.card-heading h2 { margin: 0; }
.card-heading p { margin: 5px 0 0; font-size: 13px; }
.icon-box { flex: 0 0 43px; height: 43px; display: grid; place-items: center; border-radius: 11px; color: var(--green); background: var(--mint); font-size: 22px; font-weight: 500; }
.file-drop { padding: 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px dashed #b9c4cc; border-radius: 10px; background: #fafbfd; }
.file-drop input { width: 100%; margin-bottom: 8px; padding: 0; border: 0; background: transparent; }
.file-drop span { color: var(--green); }
.file-drop small { color: var(--muted); }
.section-card { margin-top: 22px; padding: 30px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-title > div { min-width: 0; }
.section-title h2 { margin: 6px 0 0; }
.count { padding: 6px 10px; border-radius: 20px; color: var(--green); background: var(--mint); font-size: 12px; font-weight: 800; }
.employee-list, .payroll-list { margin-top: 24px; }
.employee-row, .payroll-row { display: grid; align-items: center; gap: 14px; padding: 15px 0; border-top: 1px solid var(--line); }
.employee-row { grid-template-columns: 44px minmax(150px, 1fr) minmax(190px, .65fr) auto auto; }
.employee-actions { display: flex; gap: 8px; }
.employee-profile-open { min-width: 0; padding: 7px 9px; border: 0; border-radius: 9px; color: inherit; background: transparent; text-align: left; }
.employee-profile-open:hover, .employee-profile-open:focus-visible { background: #eef3f7; outline: none; }
.employee-profile-open strong, .employee-profile-open small, .employee-profile-open em { display: block; }
.employee-profile-open em { margin-top: 5px; color: var(--green); font-size: 10px; font-style: normal; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.role-chip { display: inline-block; margin-top: 6px; padding: 4px 7px; border-radius: 999px; color: var(--green); background: var(--mint); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.employee-vacation-balance > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.employee-vacation-balance > div { display: flex; gap: 6px; }
.employee-vacation-balance input { width: 82px; padding: 8px 9px; }
.employee-vacation-balance .button { padding: 8px 10px; }
.payroll-row { grid-template-columns: 48px 1fr 1fr auto; }
.payroll-result-heading { display: flex; justify-content: flex-end; min-height: 30px; margin-top: 18px; }
.avatar, .pdf-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; color: var(--green); background: var(--mint); font-weight: 850; font-size: 12px; }
.pdf-icon { color: #9d423c; background: #faecea; }
.row-main { min-width: 0; }
.row-main strong, .row-main small { display: block; }
.row-main small { margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.status { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.status.active { color: var(--success); }
.status.inactive { color: var(--danger); }
.row-actions { display: flex; gap: 8px; }
.empty { padding: 55px 20px 35px; text-align: center; }
.empty span { width: 54px; height: 54px; margin: auto; display: grid; place-items: center; border-radius: 14px; color: #9d423c; background: #faecea; font-size: 12px; font-weight: 850; }
.empty h3 { margin: 16px 0 5px; font-family: Georgia, serif; font-size: 24px; }
.empty p { margin: 0; font-size: 13px; }
.vacation-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.vacation-balance-summary { margin-top: 22px; padding: 20px 22px; border-radius: 14px; color: var(--green); background: var(--mint); }
.vacation-balance-summary strong { display: block; margin-top: 7px; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.vacation-balance-summary strong span { color: #6f5a1f; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 14px; font-weight: 750; white-space: nowrap; }
.vacation-balance-summary p { margin: 6px 0 0; font-size: 12px; }
.vacation-form-submit { display: flex; justify-content: flex-end; }
.vacation-list { display: grid; gap: 14px; margin-top: 24px; }
.vacation-card { padding: 18px; display: grid; grid-template-columns: minmax(190px, 1.2fr) 1fr auto; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: #fcfcfa; }
.vacation-main strong, .vacation-main small { display: block; }
.vacation-main small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.vacation-note { color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.vacation-status { display: inline-block; padding: 6px 9px; border-radius: 20px; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.vacation-status.pending { color: #7a5a12; background: #fbefcc; }
.vacation-status.approved { color: var(--success); background: var(--success-soft); }
.vacation-status.rejected { color: var(--danger); background: #faecea; }
.vacation-status.revoked { color: var(--muted); background: #eef0ed; }
.vacation-actions { min-width: 250px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vacation-actions textarea { grid-column: 1 / -1; min-height: 64px; font-size: 12px; }
.vacation-actions .button { padding: 9px; }
.vacation-actions.resolved small { grid-column: 1 / -1; }
.email-state { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; text-align: right; }
.vacation-calendar-panel { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.vacation-calendar-head { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 20px; }
.vacation-calendar-head h3 { margin: 5px 0 6px; font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.vacation-calendar-head label { width: 130px; margin: 0; }
.vacation-calendar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.vacation-calendar-month { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fcfcfa; }
.vacation-calendar-month > strong { display: block; margin-bottom: 11px; color: var(--green); font-family: Georgia, serif; font-size: 18px; font-weight: 600; }
.vacation-calendar-weekdays, .vacation-calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.vacation-calendar-weekdays span { color: var(--muted); font-size: 10px; font-weight: 850; text-align: center; }
.vacation-calendar-days { margin-top: 6px; }
.vacation-calendar-day { min-height: 27px; display: grid; place-items: center; border-radius: 7px; color: var(--ink); background: #f5f7f4; font-size: 11px; font-weight: 750; cursor: default; }
.vacation-calendar-day.empty { background: transparent; }
.vacation-calendar-day.pending { color: #6f4e06; background: #ffe8a3; box-shadow: inset 0 0 0 1px #e8c76d; }
.vacation-calendar-day.approved { color: #0f5132; background: #ccefdc; box-shadow: inset 0 0 0 1px #9ad2b2; }
.vacation-calendar-day.mixed { color: #0b2a40; background: linear-gradient(135deg, #ffe8a3 0 50%, #ccefdc 50% 100%); box-shadow: inset 0 0 0 1px #c9c9a6; }
.notice-form { margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fcfcfa; }
.notice-list { display: grid; gap: 14px; margin-top: 24px; }
.notice-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fcfcfa; }
.notice-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.notice-heading strong { color: var(--ink); font-size: 17px; font-weight: 900; overflow-wrap: anywhere; }
.notice-heading small { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.notice-card p { margin: 14px 0 0; color: var(--ink); font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.candidate-form { margin-top: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.candidate-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.candidate-form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.candidate-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.candidate-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #fcfcfa; }
.candidate-heading { display: flex; align-items: center; gap: 12px; }
.candidate-card p { min-height: 42px; margin: 15px 0; color: var(--muted); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.candidate-actions { display: flex; justify-content: flex-end; gap: 8px; }
.candidate-open:not(.button) { padding: 0; border: 0; background: transparent; color: var(--ink); font-weight: 800; text-align: left; overflow-wrap: anywhere; }
.candidate-open:not(.button):hover { color: var(--green); text-decoration: underline; }
.candidate-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.candidate-badges span { padding: 5px 8px; border-radius: 8px; font-size: 11px; background: var(--mint); }
.candidate-badges .called { color: var(--success); background: var(--success-soft); font-weight: 800; }
.candidate-card > .candidate-actions { margin-top: 12px; }
#candidate-detail-dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
.candidate-detail-description, .candidate-note p { white-space: pre-wrap; overflow-wrap: anywhere; }
.candidate-called-label { display: flex; align-items: center; gap: 10px; margin: 20px 0; }
.candidate-called-label input { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; }
.candidate-detail-block { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 12px; }
.candidate-detail-block h3 { font-size: 18px; }
.candidate-cv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.candidate-note-list { display: grid; gap: 12px; list-style: none; padding: 0; margin: 20px 0; }
.candidate-note { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f6f8fa; }
.candidate-note > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12px; }
.candidate-note time { color: var(--muted); }
.candidate-note p { margin: 10px 0 0; font-size: 14px; line-height: 1.5; }
.security-panel { margin-top: 24px; padding: 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border: 1px solid var(--line); border-radius: 13px; background: #fcfcfa; }
.security-panel strong { font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.security-panel p { max-width: 650px; margin: 7px 0 0; line-height: 1.55; }
.settings-panel { margin-top: 24px; padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: #fcfcfa; }
.settings-toggle { margin: 0; display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.settings-toggle input { flex: 0 0 22px; width: 22px; height: 22px; margin-top: 2px; accent-color: var(--green); }
.settings-toggle span, .settings-toggle strong, .settings-toggle small { display: block; }
.settings-toggle strong { color: var(--ink); font-size: 15px; }
.settings-toggle small { max-width: 720px; margin-top: 7px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.55; }
.settings-toggle.compact-toggle { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.permissions-panel { margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fcfcfa; }
.permissions-panel strong, .permissions-panel small { display: block; }
.permissions-panel small { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 14px; }
.permission-grid label { margin: 0; display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 13px; font-weight: 750; letter-spacing: 0; }
.permission-grid input { flex: 0 0 18px; width: 18px; height: 18px; padding: 0; accent-color: var(--green); }
.settings-subsection { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.settings-subsection h3 { margin: 6px 0 6px; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; margin-top: 18px; }
.settings-grid .wide, .candidate-form-grid .wide { grid-column: 1 / -1; }
.settings-actions { margin-top: 22px; display: flex; justify-content: flex-end; }
.tpv-license-card h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.tpv-license-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 18px; margin: 18px 0 0; }
.tpv-license-details dt { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.tpv-license-details dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.establishment-password summary { cursor: pointer; color: var(--green); font-size: 13px; }
.establishment-password span { display: block; margin-top: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.weekly-schedules-list { display: grid; gap: 16px; min-width: 0; }
.weekly-schedule-card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.weekly-schedule-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; background: var(--mint); }
.weekly-schedule-title { display: grid; gap: 6px; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.weekly-schedule-title small { color: var(--muted); }
.weekly-schedule-heading .button { flex-shrink: 0; }
.weekly-schedule-content { min-width: 0; padding: 6px; }
.weekly-schedule-content .weekly-schedule-scroll { max-width: 100%; margin-top: 0; }
.weekly-schedule-table { width: 100%; min-width: 860px; table-layout: fixed; border-collapse: collapse; font-size: 11px; }
.weekly-schedule-table caption { padding: 8px; text-align: left; font-weight: 700; }
.weekly-schedule-table th, .weekly-schedule-table td { padding: 7px 2px; text-align: left; border: 1px solid var(--line); vertical-align: middle; }
.weekly-schedule-table thead th[rowspan] { width: 16%; }
.weekly-schedule-table thead th, .weekly-schedule-table tfoot th, .weekly-schedule-table tfoot td { background: var(--mint); }
.weekly-schedule-table small { display: block; margin-top: 3px; font-size: 9px; font-weight: 500; }
.weekly-schedule-table thead th[colspan], .weekly-schedule-table thead tr:nth-child(2) th { text-align: center; }
.weekly-schedule-table thead tr:nth-child(2) th { padding: 6px 1px; font-size: 10px; }
.weekly-schedule-table .weekly-shift-cell { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.weekly-schedule-table tbody th { padding-left: 7px; overflow-wrap: anywhere; background: #fff; }
.weekly-schedule-table tfoot th { padding-left: 7px; overflow-wrap: anywhere; font-size: 10px; }
.weekly-schedule-table tfoot td { text-align: center; }
.weekly-schedule-table tbody tr:nth-child(even) td { background: #f6f8fa; }
.weekly-schedule-table tbody tr td.has-shift { background: #dcfce7; color: #14532d; font-weight: 800; }
.weekly-schedule-table .has-shift strong { font-weight: 800; }
.weekly-schedule-title:focus-visible, .weekly-schedule-scroll:focus-visible { outline: 3px solid #2458a6; outline-offset: 3px; }
@media (min-width: 900px) {
  .weekly-schedule-table { min-width: 0; }
}
@media (max-width: 600px) {
  .weekly-schedule-heading { align-items: flex-start; flex-direction: column; }
  .weekly-schedule-content { padding: 6px; }
}

.table-wrapper { margin-top: 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.data-table { width: 100%; min-width: 720px; border-collapse: collapse; background: #fcfcfa; }
.data-table th, .data-table td { padding: 14px 15px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: top; }
.data-table th { color: var(--muted); background: #f6f8fa; font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table small { color: var(--muted); overflow-wrap: anywhere; }
.invoice-lines-block { margin-top: 18px; }
.invoice-clients-panel { margin-bottom: 28px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.invoice-client-list { display: grid; gap: 10px; margin: 20px 0 0; }
.invoice-client-card { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(160px, .8fr) auto; gap: 16px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcfa; }
.invoice-client-card strong, .invoice-client-card small { display: block; }
.invoice-client-card small { margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.invoice-client-actions { display: flex; justify-content: flex-end; gap: 8px; }
.invoice-lines-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.invoice-lines-heading strong, .invoice-lines-heading small { display: block; }
.invoice-lines-heading small { margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 500; }
.invoice-lines { display: grid; gap: 12px; }
.invoice-line { display: grid; grid-template-columns: minmax(0, 1fr) 180px auto; gap: 14px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fcfcfa; }
.invoice-line textarea { min-height: 84px; }
.invoice-remove-line { margin-bottom: 2px; }
.invoice-history { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.document-preview { margin-top: 18px; padding: 16px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 13px; background: #fcfcfa; }
.document-preview strong { color: var(--ink); font-size: 14px; }
.document-preview span { color: var(--green); font-size: 16px; font-weight: 900; }
.document-preview small { color: var(--muted); font-size: 12px; }
.import-help { max-width: 760px; margin: 16px 0 4px; line-height: 1.6; }
.import-preview { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line); }
.import-list { display: grid; gap: 10px; margin: 20px 0; }
.import-row { display: grid; grid-template-columns: minmax(190px, .8fr) 1.8fr minmax(110px, .5fr); gap: 16px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcfa; }
.import-row.invalid { border-color: #e8c4c1; background: #fff9f8; }
.import-row.ignored { border-color: #d7dce0; background: #f7f9fa; }
.import-person strong, .import-person small, .import-result strong, .import-result small { display: block; }
.import-person small, .import-result small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.import-shifts { display: flex; flex-wrap: wrap; gap: 6px; }
.import-shifts span { padding: 5px 7px; border-radius: 7px; color: var(--muted); background: #f0f2ee; font-size: 10px; }
.import-result { color: var(--green); font-size: 12px; font-weight: 800; text-align: right; }
.import-row.invalid .import-result { color: var(--danger); }
.import-row.ignored .import-result { color: var(--muted); }
.schedule-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.schedule-editor-head { display: grid; grid-template-columns: 1fr 1.1fr 1.1fr; gap: 18px; margin-top: 12px; padding: 10px 16px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.schedule-editor { margin: 0 0 22px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.schedule-edit-row { display: grid; grid-template-columns: 1fr 1.1fr 1.1fr; gap: 18px; align-items: center; padding: 13px 16px; border-top: 1px solid var(--line); }
.schedule-edit-row:first-child { border-top: 0; }
.schedule-edit-row > strong { font-family: Georgia, serif; font-size: 17px; }
.schedule-field { margin: 0; display: grid; grid-template-columns: 28px minmax(0, 150px); align-items: center; gap: 8px; }
.schedule-field span { color: var(--muted); font-size: 11px; }
.schedule-field input { padding: 9px; }
.schedule-submit { display: flex; justify-content: flex-end; align-items: center; gap: 24px; }
.schedule-heading { align-items: end; }
.schedule-filter-panel { width: min(330px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.schedule-filter-panel label { margin: 0; }
.schedule-filter-panel select { padding: 12px 11px; background: #fbfbf9; }
.week-picker { width: 210px; margin: 0; }
.week-picker input { min-width: 0; max-width: 100%; }
.schedule-list { display: grid; gap: 18px; margin-top: 24px; }
.schedule-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.schedule-card-header { padding: 17px 19px; display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #f8f9f6; }
.schedule-card-header strong, .schedule-card-header small { display: block; }
.schedule-card-header small { margin-top: 4px; color: var(--muted); }
.hours-total { color: var(--green); font-family: Georgia, serif; font-size: 22px; white-space: nowrap; }
.schedule-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.schedule-day { min-width: 0; padding: 16px 10px; border-left: 1px solid var(--line); text-align: center; }
.schedule-day:first-child { border-left: 0; }
.schedule-day strong, .schedule-day small { display: block; }
.schedule-day strong { font-size: 12px; }
.schedule-day .day-date { margin: 4px 0 12px; color: var(--muted); font-size: 11px; }
.schedule-day .shift-time { margin-top: 6px; font-size: 12px; }
.schedule-day .day-hours { margin-top: 12px; color: var(--green); font-weight: 800; }
.schedule-day.off { color: #9da5a1; background: #fafaf8; }
.schedule-delete { margin-left: 12px; }
.schedule-block-title { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--green); background: #f6f8fa; font-size: 10px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.schedule-block-title:first-of-type { border-top: 0; }
.schedule-start { margin-top: 10px; color: var(--ink); font-family: Georgia, serif; font-size: 18px; }
.daily-shifts { display: grid; gap: 7px; margin-top: 10px; }
.daily-shifts span { font-size: 12px; }
.daily-shifts b { display: inline-block; min-width: 62px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.daily-hours { display: grid; gap: 5px; }
.daily-hours span { font-size: 11px; }
.daily-hours b { display: inline-block; min-width: 62px; color: var(--muted); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.schedule-hours-grid .schedule-day { padding-top: 20px; padding-bottom: 20px; }
.schedule-hours-grid.split { grid-template-columns: repeat(var(--visible-days, 7), minmax(0, 1fr)); }
.schedule-hours-grid .day-hours { margin: 8px 0 0; font-size: 16px; }
.hour-summary-days { display: grid; grid-template-columns: repeat(var(--visible-days, 7), minmax(0, 1fr)); }
.hour-summary-day { min-width: 0; padding: 20px 10px; border-left: 1px solid var(--line); text-align: center; }
.hour-summary-day:first-child { border-left: 0; }
.hour-summary-day strong, .hour-summary-day small { display: block; }
.hour-summary-day strong { font-size: 12px; }
.hour-summary-day .day-date { margin: 4px 0 12px; color: var(--muted); font-size: 11px; }
.hour-summary-day .day-hours { margin: 8px 0 0; color: var(--green); font-weight: 800; font-size: 16px; }
.hour-summary-day.off { color: #9da5a1; background: #fafaf8; }
.analysis-controls { margin-top: 18px; display: grid; grid-template-columns: 1fr 1.2fr 1fr auto; gap: 18px; align-items: end; }
.analysis-controls label { margin: 0; }
.analysis-action { padding-bottom: 1px; display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.analysis-action .button { min-height: 45px; }
.analysis-table-wrap { margin-top: 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.analysis-table { width: 100%; min-width: 980px; border-collapse: collapse; background: #fcfcfa; }
.analysis-table th, .analysis-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: right; font-size: 13px; }
.analysis-table th:first-child, .analysis-table td:first-child { text-align: left; }
.analysis-table th { color: var(--muted); background: #f6f8fa; font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.analysis-table tbody tr:hover { background: #f7fafb; }
.analysis-table tfoot td { color: var(--green); background: var(--mint); font-weight: 850; }
.analysis-money { color: var(--green); font-weight: 850; white-space: nowrap; }
.analysis-weeks { max-width: 260px; color: var(--muted); font-size: 12px; text-align: left !important; }
.analysis-adjustment { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.analysis-adjustment input { width: 100px; padding: 8px 9px; text-align: right; }
.analysis-adjustment .button { padding: 8px 10px; font-size: 11px; }
dialog { width: min(460px, calc(100% - 30px)); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 24px 70px rgba(0,0,0,.25); }
#employee-profile-dialog { width: min(620px, calc(100% - 30px)); }
dialog::backdrop { background: rgba(16, 28, 23, .55); }
.dialog-card { padding: 30px; }
.close { border: 0; background: transparent; color: var(--muted); font-size: 27px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 22px; }
.dialog-actions .button { width: 100%; padding: 14px; }
.employee-profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dialog-card .settings-toggle { margin-top: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcfa; }

@media (max-width: 800px) {
  main { width: min(100% - 26px, 1180px); }
  .topbar { min-height: 82px; padding: 9px 13px; gap: 12px; }
  .brand { min-width: 0; gap: 8px; }
  .brand img { width: min(185px, 48vw); }
  .brand small { display: none; }
  .user-menu { flex: 0 0 auto; }
  .user-menu .button { padding: 8px 10px; font-size: 12px; }
  .login-layout { min-height: auto; padding: 54px 0 90px; grid-template-columns: 1fr; gap: 38px; }
  .login-copy h1 { font-size: 54px; }
  .login-card { padding: 27px; }
  .app-view { padding: 40px 0; }
  .welcome { align-items: flex-start; flex-direction: column; }
  .admin-menu-shell, .employee-menu { top: 6px; margin-bottom: 22px; }
  .admin-menu-shell { width: 100%; }
  .admin-menu { width: 100%; }
  .admin-menu-button, .employee-menu-button { min-width: auto; }
  .admin-grid { grid-template-columns: 1fr; }
  .vacation-form-grid { grid-template-columns: 1fr; gap: 0; }
  .candidate-form-grid, .candidate-list, .employee-profile-grid, .settings-grid, .invoice-line { grid-template-columns: 1fr; gap: 0; }
  .invoice-client-card { grid-template-columns: 1fr; gap: 10px; }
  .invoice-client-actions { justify-content: stretch; }
  .invoice-client-actions .button { flex: 1; }
  .permission-grid { grid-template-columns: 1fr; }
  .invoice-lines-heading { align-items: stretch; flex-direction: column; }
  .candidate-list { gap: 12px; }
  .security-panel { align-items: stretch; flex-direction: column; }
  .security-panel .button { width: 100%; }
  .import-row { grid-template-columns: 1fr; }
  .import-result { text-align: left; }
  .vacation-form-submit .button { width: 100%; }
  .vacation-card { grid-template-columns: 1fr; gap: 12px; }
  .vacation-actions { min-width: 0; }
  .vacation-calendar-head { align-items: stretch; flex-direction: column; }
  .vacation-calendar-head label { width: 100%; }
  .vacation-calendar { grid-template-columns: 1fr; }
  .email-state { text-align: left; }
  .section-card { padding: 22px 18px; }
  .employee-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .payroll-row { grid-template-columns: 42px minmax(0, 1fr); align-items: start; }
  .employee-row .status, .payroll-row > .row-main:nth-child(3) { display: none; }
  .payroll-row .row-actions { grid-column: 1 / -1; padding-left: 56px; }
  .payroll-row .row-actions .button { flex: 1; text-align: center; }
  .employee-row .button { padding: 8px; font-size: 11px; }
  .employee-actions { grid-column: 2 / -1; flex-wrap: wrap; }
  .employee-actions .button { flex: 1; }
  .employee-vacation-balance { grid-column: 2 / -1; }
  .user-menu #user-name { display: none; }
  .dialog-actions { grid-template-columns: 1fr; }
  .schedule-controls { grid-template-columns: 1fr; gap: 0; }
  .analysis-controls { grid-template-columns: 1fr; gap: 12px; }
  .analysis-action .button { width: 100%; }
  .schedule-editor-head { display: none; }
  .schedule-edit-row { grid-template-columns: 1fr; gap: 9px; padding: 16px; }
  .schedule-field { grid-template-columns: 90px 1fr; }
  .schedule-field span { font-weight: 750; }
  .schedule-submit { align-items: stretch; flex-direction: column; gap: 12px; }
  .schedule-submit .button { width: 100%; }
  .schedule-heading { align-items: stretch; flex-direction: column; }
  .schedule-heading > div { width: 100%; min-width: 0; }
  .schedule-heading h2 { overflow-wrap: anywhere; }
  .schedule-filter-panel { width: 100%; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
  .week-picker { width: 100%; max-width: 100%; margin-top: 12px; display: grid; }
  .week-picker input { width: 100%; min-width: 0; max-width: 100%; font-size: 16px; }
  .schedule-days { grid-template-columns: 1fr; }
  .schedule-day { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 8px; padding: 12px 14px; border-left: 0; border-top: 1px solid var(--line); text-align: left; }
  .schedule-day:first-child { border-top: 0; }
  .schedule-day .day-date, .schedule-day .shift-time, .schedule-day .day-hours { margin: 0; }
  .schedule-hours-grid.split { grid-template-columns: 1fr !important; }
  .schedule-hours-grid .schedule-day { grid-template-columns: 1fr; gap: 11px; align-items: stretch; padding: 14px; text-align: left; }
  .schedule-hours-grid .schedule-day > div:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .schedule-hours-grid .schedule-day strong { font-size: 15px; }
  .schedule-hours-grid .schedule-day .day-date { font-size: 12px; white-space: nowrap; }
  .schedule-hours-grid .daily-hours { grid-template-columns: 1fr 1fr; gap: 8px; }
  .schedule-hours-grid .daily-hours span { min-width: 0; padding: 9px 10px; border-radius: 10px; background: #f6f8fa; font-size: 13px; line-height: 1.25; }
  .schedule-hours-grid .daily-hours b { display: block; min-width: 0; margin-bottom: 4px; font-size: 9px; }
  .schedule-hours-grid .day-hours { justify-self: start; padding: 5px 10px; border-radius: 999px; background: var(--mint); font-size: 18px; line-height: 1.15; }
  .hour-summary-days { grid-template-columns: 1fr !important; }
  .hour-summary-day { display: grid; grid-template-columns: 1fr; gap: 11px; align-items: stretch; padding: 14px; border-left: 0; border-top: 1px solid var(--line); text-align: left; }
  .hour-summary-day:first-child { border-top: 0; }
  .hour-summary-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .hour-summary-day strong { font-size: 15px; }
  .hour-summary-day .day-date { margin: 0; font-size: 12px; white-space: nowrap; }
  .hour-summary-day .daily-hours { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hour-summary-day .daily-hours span { min-width: 0; padding: 9px 10px; border-radius: 10px; background: #f6f8fa; font-size: 13px; line-height: 1.25; }
  .hour-summary-day .daily-hours b { display: block; min-width: 0; margin-bottom: 4px; font-size: 9px; }
  .hour-summary-day .day-hours { justify-self: start; margin: 0; padding: 5px 10px; border-radius: 999px; background: var(--mint); font-size: 18px; line-height: 1.15; }
  .schedule-card-header { align-items: flex-start; }
}

@media (max-width: 460px) {
  main { width: min(100% - 18px, 1180px); }
  .section-card { padding: 20px 14px; }
  .section-title { align-items: stretch; flex-direction: column; gap: 12px; }
  .section-title .count { align-self: flex-start; }
  .week-picker input[type="date"], .week-picker input[type="month"] { padding-left: 10px; padding-right: 10px; }
  .schedule-hours-grid .daily-hours { grid-template-columns: 1fr; }
  .schedule-hours-grid .schedule-day > div:first-child { align-items: flex-start; flex-direction: column; gap: 3px; }
  .hour-summary-day .daily-hours { grid-template-columns: 1fr; }
  .hour-summary-day-head { align-items: flex-start; flex-direction: column; gap: 3px; }
}
