:root {
  --ink: #16231f;
  --muted: #68766e;
  --line: #d7e1db;
  --canvas: #f3f6f2;
  --surface: #ffffff;
  --forest: #12352f;
  --green: #1d7356;
  --mint: #d9efe5;
  --amber: #bf7517;
  --red: #b33c35;
  --shadow: 0 14px 34px rgba(18, 53, 47, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: Tahoma, Arial, sans-serif; font-size: 15px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.site-shell { min-height: 100vh; }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(340px, .7fr); }
.brand-panel { background: var(--forest); color: white; padding: clamp(2rem, 8vw, 8rem); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.brand-panel::before, .brand-panel::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.brand-panel::before { width: 34rem; height: 34rem; inset-block-end: -16rem; inset-inline-start: -8rem; }
.brand-panel::after { width: 22rem; height: 22rem; inset-block-start: -8rem; inset-inline-end: -4rem; }
.brand-panel > * { position: relative; z-index: 1; }
.brand-mark { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 20px; background: #d6edd9; color: var(--forest); font-size: 25px; font-weight: 800; letter-spacing: -1px; margin-bottom: 2rem; }
.brand-mark.small { width: 42px; height: 42px; margin: 0; border-radius: 13px; font-size: 16px; }
.brand-panel h1 { max-width: 550px; font-size: clamp(2rem, 4vw, 4.25rem); line-height: 1.1; margin: .4rem 0 1rem; }
.brand-panel > p:not(.eyebrow) { max-width: 430px; color: #c1d8ce; font-size: 18px; line-height: 1.8; margin: 0; }
.eyebrow { color: var(--green); font-size: 11px; letter-spacing: .14em; font-weight: 800; margin: 0; text-transform: uppercase; }
.brand-panel .eyebrow { color: #b6ddc9; }
.login-card { align-self: center; background: var(--surface); margin: 2rem; padding: 2.5rem; border-radius: 20px; box-shadow: var(--shadow); }
.login-card h2 { margin: .45rem 0 2rem; font-size: 27px; }

label { display: grid; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; outline: none; }
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,115,86,.12); }
.login-card label + label { margin-top: 1rem; }
.form-message { min-height: 1.3rem; margin: .85rem 0; color: var(--green); font-size: 13px; font-weight: 700; }
.form-message.error { color: var(--red); }

.button { border: 1px solid transparent; border-radius: 9px; min-height: 40px; padding: 9px 16px; font-weight: 800; transition: background .15s, border-color .15s, transform .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--forest); color: #fff; }
.button-primary:hover { background: #0c2923; }
.button-secondary { border-color: var(--green); background: #fff; color: var(--green); }
.button-quiet { background: transparent; color: var(--forest); border-color: var(--line); }
.button-wide { width: 100%; margin-top: .3rem; }
.form-actions, .card-actions, .row-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.language-switch { display: inline-flex; border: 1px solid rgba(18,53,47,.18); border-radius: 9px; overflow: hidden; background: white; }
.login-language { margin-top: 3rem; align-self: flex-start; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); }
.language-button { border: 0; padding: 7px 11px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; }
.language-button.active { color: white; background: var(--forest); }
.login-language .language-button { color: #d8e8df; }
.login-language .language-button.active { color: var(--forest); background: #d6edd9; }

.app-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 14px clamp(1rem, 4vw, 4rem); background: white; border-bottom: 1px solid var(--line); }
.brand-compact, .header-actions, .user-badge { display: flex; align-items: center; gap: 10px; }
.brand-compact strong { display: block; margin-top: 2px; }
.header-actions { gap: 14px; }
.user-badge { display: grid; gap: 1px; text-align: start; }
.user-badge span { font-size: 13px; font-weight: 800; }
.user-badge small { color: var(--muted); font-size: 11px; }
.app-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.navigation { padding: 24px 14px; background: #e8eee9; border-inline-end: 1px solid var(--line); display: grid; align-content: start; gap: 5px; }
.nav-button { text-align: start; border: 0; background: transparent; border-radius: 8px; padding: 11px 12px; color: #4d5d55; font-size: 13px; font-weight: 800; }
.nav-button:hover { color: var(--forest); background: rgba(255,255,255,.55); }
.nav-button.active { color: white; background: var(--forest); box-shadow: 0 5px 14px rgba(18,53,47,.16); }
.content { width: min(1180px, 100%); margin: 0 auto; padding: clamp(1.1rem, 3vw, 2.7rem); }
.page { display: none; }
.page.active { display: block; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.page-heading h1 { margin: .25rem 0 0; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.filter-label { width: min(280px, 100%); }
.panel { margin-bottom: 1.25rem; padding: clamp(1rem, 2.5vw, 1.5rem); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 3px 12px rgba(18,53,47,.025); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.panel-heading h2 { font-size: 16px; margin: 0; }
.help-text { margin: 0 0 1.3rem; color: var(--muted); line-height: 1.7; }
.statistics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 1.25rem; }
.stat-card { padding: 17px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); }
.stat-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-card strong { display: block; margin-top: 8px; color: var(--forest); font-size: 28px; }
.form-grid { display: grid; gap: 14px; margin-bottom: 1.25rem; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.worker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 12px; }
.worker-card { min-height: 128px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.worker-card h2 { margin: 0 0 10px; font-size: 16px; }
.worker-card p { margin: 4px 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.worker-card .card-actions { margin-top: 14px; }
.criteria-list { display: grid; gap: 9px; }
.criterion-row { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 9px; align-items: end; }
.criterion-row .button { padding: 7px; min-height: 39px; color: var(--red); background: #fff4f3; }
.criteria-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 1.2rem; }
.select-worker { width: min(450px, 100%); margin-bottom: 1.3rem; }
.score-inputs { display: grid; gap: 12px; }
.score-row { display: grid; grid-template-columns: 1fr minmax(120px, 2fr) 64px; gap: 13px; align-items: center; padding: 12px; background: #f7f9f7; border-radius: 10px; }
.score-row label { gap: 2px; }
.score-row label span { font-size: 14px; }
.score-row label small { color: var(--muted); font-size: 11px; font-weight: 400; }
input[type="range"] { accent-color: var(--green); padding: 0; box-shadow: none; }
.score-value { display: grid; place-items: center; min-height: 34px; color: var(--forest); background: var(--mint); border-radius: 8px; font-weight: 800; font-size: 13px; }
.score-summary { display: flex; align-items: center; justify-content: space-between; padding: 16px; margin: 1.2rem 0; color: var(--forest); background: var(--mint); border-radius: 10px; font-weight: 800; }
.score-summary strong { font-size: 25px; }
.table-panel { overflow-x: auto; padding: 0; }
.monthly-wash-table { min-width: 1420px; }
.monthly-wash-table th, .monthly-wash-table td { min-width: 38px; padding: 10px 8px; text-align: center; }
.monthly-wash-table th:first-child, .monthly-wash-table td:first-child { min-width: 150px; text-align: start; }
.monthly-wash-table th:last-child, .monthly-wash-table td:last-child { min-width: 88px; font-weight: 800; }
.monthly-wash-table .wash-cell-recorded { color: var(--forest); background: var(--mint); font-weight: 800; }
table { width: 100%; border-collapse: collapse; min-width: 670px; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; font-size: 13px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.score-pill { display: inline-block; min-width: 60px; padding: 6px 8px; border-radius: 20px; color: #1a5140; background: var(--mint); text-align: center; font-weight: 800; font-size: 12px; }
.score-pill.mid { color: #8b580f; background: #fff0d5; }
.score-pill.low { color: #963832; background: #fff0ef; }
.link-button { padding: 0; color: var(--green); border: 0; background: transparent; font-weight: 800; text-decoration: underline; }
.destructive-link { color: var(--red); }
.empty-state { padding: 2rem; color: var(--muted); text-align: center; }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; }
.status::before { width: 7px; height: 7px; border-radius: 50%; background: var(--green); content: ""; }
.status.inactive::before { background: var(--red); }
.toggle { width: 40px; height: 22px; position: relative; appearance: none; border: 0; border-radius: 20px; background: #c7d0cb; cursor: pointer; }
.toggle::after { width: 16px; height: 16px; position: absolute; content: ""; top: 3px; inset-inline-start: 3px; border-radius: 50%; background: white; transition: transform .15s; }
.toggle:checked { background: var(--green); }
[dir="rtl"] .toggle:checked::after { transform: translateX(-18px); }
[dir="ltr"] .toggle:checked::after { transform: translateX(18px); }
.detail-dialog { width: min(620px, calc(100% - 2rem)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.detail-dialog::backdrop { background: rgba(9,31,26,.5); }
.detail-dialog > div { padding: 2rem; }
.dialog-close { position: absolute; inset-block-start: 12px; inset-inline-end: 12px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #edf2ee; color: var(--forest); font-size: 18px; }
.detail-meta { color: var(--muted); font-size: 13px; line-height: 1.8; }
.detail-list { margin: 1.4rem 0; padding: 0; list-style: none; }
.detail-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-list li span:last-child { color: var(--forest); font-weight: 800; }
.notes-box { padding: 13px; background: #f6f8f6; border-radius: 9px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 850px) {
  .login-view { grid-template-columns: 1fr; }
  .brand-panel { min-height: 340px; padding: 2.5rem 1.5rem; }
  .brand-panel h1 { font-size: 2.1rem; }
  .login-language { margin-top: 1.5rem; }
  .login-card { max-width: 540px; width: calc(100% - 2rem); justify-self: center; margin: 1.25rem 0 2rem; }
  .app-layout { grid-template-columns: 1fr; }
  .navigation { display: flex; overflow-x: auto; padding: 10px 14px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .nav-button { flex: 0 0 auto; }
  .statistics, .form-grid.four, .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .app-header { align-items: flex-start; }
  .header-actions { justify-content: end; flex-wrap: wrap; }
  .user-badge { display: none; }
  .statistics, .form-grid.four, .form-grid.three { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .filter-label { width: 100%; }
  .criterion-row { grid-template-columns: 1fr 36px; }
  .score-row { grid-template-columns: 1fr 55px; }
  .score-row input { grid-column: 1 / -1; grid-row: 2; }
}
