:root {
  --ink: #17211c;
  --muted: #68736d;
  --line: #dfe6e1;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --brand: #176b4d;
  --brand-dark: #0e5139;
  --brand-soft: #e2f2eb;
  --danger: #ad2e2e;
  --danger-soft: #fae8e8;
  --warning: #8a5b00;
  --warning-soft: #fff3d8;
  --radius: 14px;
  --shadow: 0 8px 26px rgba(25, 49, 38, .07);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(27px, 3vw, 38px); line-height: 1.15; letter-spacing: -.03em; }
h2 { margin-bottom: 16px; font-size: 18px; }
small { color: var(--muted); }

.topbar { position: sticky; top: 0; z-index: 10; min-height: 68px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; padding: 10px clamp(18px, 4vw, 54px); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); width: fit-content; }
.brand:hover { text-decoration: none; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand small { margin-top: 4px; font-size: 11px; }
.brand-mark { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; color: white; background: var(--brand); font-size: 20px; font-weight: 800; }
.brand-mark.large { width: 54px; height: 54px; border-radius: 15px; font-size: 27px; }
.main-nav { display: flex; align-items: center; gap: 8px; }
.main-nav a { color: #34423a; font-weight: 650; }
.nav-primary, .nav-group > summary, .nav-coming-soon { min-height: 38px; display: inline-flex; align-items: center; padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.nav-primary:hover, .nav-group > summary:hover, .nav-group[open] > summary { background: var(--brand-soft); text-decoration: none; }
.nav-group { position: relative; }
.nav-group > summary { color: #34423a; cursor: pointer; font-weight: 650; list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: '▾'; margin-left: 6px; color: var(--muted); font-size: 10px; }
.nav-menu { position: absolute; top: calc(100% + 7px); left: 0; z-index: 20; min-width: 195px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.nav-menu a { display: block; padding: 9px 11px; border-radius: 7px; white-space: nowrap; }
.nav-menu a:hover { background: var(--brand-soft); text-decoration: none; }
.nav-coming-soon { color: #7b8580; cursor: default; font-weight: 650; }
.nav-coming-soon small { margin-left: 5px; padding: 1px 5px; border-radius: 999px; background: #edf1ef; font-size: 9px; text-transform: uppercase; }
.nav-time-active { color: var(--brand-dark) !important; background: var(--brand-soft); }
.nav-time-active small { margin-left: 6px; padding: 2px 6px; border-radius: 999px; color: white; background: var(--brand); font-size: 9px; font-variant-numeric: tabular-nums; }
.user-menu { justify-self: end; display: flex; align-items: center; gap: 14px; }
.user-menu > a { color: var(--ink); font-weight: 600; }

.page { width: min(1240px, calc(100% - 36px)); margin: 0 auto; padding: 42px 0 80px; }
.page-centered { min-height: 100vh; display: grid; place-items: center; padding: 30px 0; }
.page-heading { margin-bottom: 26px; }
.page-heading.split { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.eyebrow { margin-bottom: 5px; color: var(--brand); font-weight: 750; font-size: 12px; text-transform: uppercase; letter-spacing: .09em; }
.muted { color: var(--muted); }

.panel, .login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 24px; }
.login-card { width: min(430px, 100%); padding: 38px; text-align: center; }
.login-brand { margin-bottom: 20px; }
.login-card .form-stack { margin-top: 24px; text-align: left; }
.error-card { display: flex; flex-direction: column; align-items: center; }

.button { min-height: 42px; display: inline-flex; justify-content: center; align-items: center; padding: 9px 17px; border: 1px solid transparent; border-radius: 9px; font: inherit; font-weight: 700; cursor: pointer; transition: transform .12s, background .12s; }
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button-primary { color: white; background: var(--brand); }
.button-primary:hover { background: var(--brand-dark); }
.button-secondary { color: var(--ink); background: white; border-color: var(--line); }
.button-danger { color: var(--danger); background: var(--danger-soft); border-color: #f2caca; }
.button.small { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.button.full { width: 100%; }
.button-link { padding: 0; border: 0; color: var(--brand); background: transparent; font: inherit; cursor: pointer; }
.button-link.danger { color: var(--danger); }

.form-stack { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: grid; gap: 7px; color: #34423a; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #cbd5cf; border-radius: 8px; color: var(--ink); background: white; font: inherit; outline: none; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23,107,77,.13); }
.optional { color: var(--muted); font-weight: 450; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.form-panel { width: min(700px, 100%); }
.form-error, .flash { padding: 12px 14px; border-radius: 9px; }
.form-error, .flash-error { color: #7c2020; background: var(--danger-soft); border: 1px solid #efc8c8; }
.flash-success { color: #14553e; background: var(--brand-soft); border: 1px solid #c6e5d8; }
.flash { margin-bottom: 22px; font-weight: 600; }

.minimax-config-list { display: grid; gap: 9px; margin-top: 18px; }
.minimax-config-list > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.minimax-config-list code, .minimax-organisations code { overflow-wrap: anywhere; font-size: 12px; }
.minimax-test-result { margin-top: 18px; padding: 14px 16px; border: 1px solid; border-radius: 9px; }
.minimax-test-result p { margin: 5px 0; }
.minimax-test-result small { opacity: .75; }
.minimax-organisations { margin-bottom: 0; }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 22px; }
.stat-card { padding: 18px 20px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.stat-card span { display: block; color: var(--muted); font-size: 13px; }
.stat-card strong { margin-right: 5px; font-size: 30px; line-height: 1.3; }
.stat-card.accent { color: white; background: var(--brand); border-color: var(--brand); }
.stat-card.accent span, .stat-card.accent small { color: #d8eee5; }

.content-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; align-items: start; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.panel-heading h2 { margin-bottom: 0; }
.table-wrap { margin: 17px -24px -24px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 18px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #fafcfb; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.note-cell { max-width: 220px; color: var(--muted); }

.status { display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.status-approved { color: #13533c; background: var(--brand-soft); }
.status-pending, .status-cancellation_requested { color: var(--warning); background: var(--warning-soft); }
.status-rejected, .status-cancelled { color: #7c2020; background: var(--danger-soft); }
.absence-list { display: grid; gap: 4px; margin-top: 15px; }
.absence-item { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid var(--line); }
.absence-item div { display: flex; flex-direction: column; }
.avatar { flex: 0 0 auto; width: 35px; height: 35px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--brand-dark); background: var(--brand-soft); font-weight: 800; }
.large-avatar { width: 46px; height: 46px; font-size: 18px; }
.empty-state { padding: 35px 15px; text-align: center; color: var(--muted); }

.calendar-list { display: grid; }
.calendar-row { display: flex; align-items: center; gap: 15px; padding: 15px 4px; border-top: 1px solid var(--line); }
.calendar-row:first-child { border-top: 0; }
.date-block { width: 67px; display: flex; flex-direction: column; text-align: center; color: var(--brand); }
.date-block strong { font-size: 17px; }
.date-block span { color: var(--muted); font-size: 11px; }
.calendar-info { display: flex; flex-direction: column; }
.calendar-info span { color: var(--muted); font-size: 13px; }

.calendar-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; margin: 4px 0 22px; }
.view-switcher { display: inline-flex; justify-self: start; gap: 9px; }
.view-switch-button { min-height: 40px; display: inline-flex; align-items: center; padding: 8px 15px; border: 1px solid #cbd5cf; border-radius: 9px; color: #34423a; background: white; box-shadow: 0 2px 7px rgba(25, 49, 38, .05); font-size: 13px; font-weight: 750; }
.view-switch-button:hover { border-color: #9caf9f; text-decoration: none; transform: translateY(-1px); }
.view-switch-button.active { color: white; border-color: var(--brand); background: var(--brand); box-shadow: 0 3px 9px rgba(23, 107, 77, .18); }
.period-switcher { grid-column: 2; display: flex; align-items: center; justify-content: center; gap: 15px; min-width: 220px; text-transform: capitalize; }
.period-arrow { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--brand); background: white; font-size: 23px; line-height: 1; }
.period-arrow:hover { text-decoration: none; background: var(--brand-soft); }
.calendar-grid-panel { padding: 0; overflow: hidden; }
.monthly-calendar-wrap { overflow-x: auto; }
.monthly-calendar { width: 100%; min-width: 1050px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.monthly-calendar th, .monthly-calendar td { height: 42px; padding: 0; border-top: 0; border-right: 1px solid #cbd5cf; border-bottom: 1px solid #cbd5cf; text-align: center; }
.monthly-calendar thead th { position: sticky; top: 0; z-index: 2; height: 45px; background: #f8faf9; }
.monthly-calendar .employee-column { position: sticky; left: 0; z-index: 3; width: 156px; min-width: 156px; padding: 0 10px; overflow: hidden; text-align: left; background: white; box-shadow: 2px 0 0 #bfcac3; }
.monthly-calendar thead .employee-column { z-index: 4; background: #fafcfb; }
.monthly-calendar .day-column, .monthly-calendar .day-cell { width: 31px; min-width: 27px; }
.monthly-calendar .day-column strong { display: block; color: var(--ink); font-size: 12px; line-height: 1.1; }
.monthly-calendar .weekend-label { display: block; margin-top: 2px; color: #69736d; font-size: 8px; font-weight: 800; line-height: 1; letter-spacing: .02em; }
.monthly-calendar .employee-column { color: var(--ink); font-size: 13px; text-transform: none; letter-spacing: normal; white-space: nowrap; }
.monthly-calendar .employee-name { overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.mini-avatar { width: 25px; height: 25px; margin-right: 7px; font-size: 10px; vertical-align: middle; }
.monthly-calendar .total-column { position: sticky; right: 0; z-index: 3; width: 48px; min-width: 48px; background: white; box-shadow: -2px 0 0 #bfcac3; }
.monthly-calendar thead .total-column { z-index: 4; background: #fafcfb; }
.monthly-calendar .non-working { background: #f0f3f1; }
.monthly-calendar .holiday { background: #f7eeee; }
.monthly-calendar .today { box-shadow: inset 2px 0 0 #17211c, inset -2px 0 0 #17211c; }
.monthly-calendar tbody tr { --employee-color: #176b4d; --employee-soft: #dcefe7; --employee-text: #0e5139; }
.monthly-calendar tbody .employee-column { border-left: 5px solid var(--employee-color); }
.monthly-calendar tbody .mini-avatar { color: var(--employee-text); background: var(--employee-soft); }
.monthly-calendar .day-cell.leave-full { background: var(--employee-color); }
.monthly-calendar .day-cell.leave-half { color: var(--employee-text); background: repeating-linear-gradient(135deg, var(--employee-soft), var(--employee-soft) 5px, white 5px, white 9px); font-weight: 800; }
.employee-color-0 { --employee-color: #176b4d !important; --employee-soft: #dcefe7 !important; --employee-text: #0e5139 !important; }
.employee-color-1 { --employee-color: #2f66a8 !important; --employee-soft: #e1ebf7 !important; --employee-text: #204b80 !important; }
.employee-color-2 { --employee-color: #b85c16 !important; --employee-soft: #f8e6d7 !important; --employee-text: #81400f !important; }
.employee-color-3 { --employee-color: #7651a8 !important; --employee-soft: #ece5f5 !important; --employee-text: #55387d !important; }
.employee-color-4 { --employee-color: #0f7c7a !important; --employee-soft: #daf1ef !important; --employee-text: #095957 !important; }
.employee-color-5 { --employee-color: #a64672 !important; --employee-soft: #f4e0e9 !important; --employee-text: #773050 !important; }
.employee-color-6 { --employee-color: #9a7200 !important; --employee-soft: #f6edcf !important; --employee-text: #6b5000 !important; }
.employee-color-7 { --employee-color: #53677a !important; --employee-soft: #e4e9ee !important; --employee-text: #394958 !important; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 15px 18px; color: var(--muted); font-size: 12px; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { width: 18px; height: 13px; display: inline-block; border: 1px solid var(--line); border-radius: 3px; }
.legend-swatch.employee { background: linear-gradient(90deg, #176b4d 0 25%, #2f66a8 25% 50%, #b85c16 50% 75%, #7651a8 75%); border-color: transparent; }
.legend-swatch.half { background: repeating-linear-gradient(135deg, var(--brand-soft), var(--brand-soft) 4px, #c7e5d7 4px, #c7e5d7 8px); }
.legend-swatch.non-working { background: #f0f3f1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.test-cleanup-panel { margin-top: 28px; border-color: #edcf99; }
.test-request-preview { margin: 18px 0; padding: 13px 15px; border-radius: 9px; background: var(--warning-soft); }
.test-request-preview summary { cursor: pointer; font-weight: 700; }
.test-request-preview ul { margin: 12px 0 0; padding-left: 20px; }
.test-cleanup-form { display: grid; grid-template-columns: minmax(220px, 320px) 1fr auto; align-items: end; gap: 16px; }
.checkbox-label { display: flex; align-items: center; gap: 9px; min-height: 43px; }
.checkbox-label input { width: 18px; min-height: 18px; margin: 0; }

.request-cards { display: grid; gap: 14px; }
.request-card { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, .8fr); gap: 30px; }
.request-card.needs-action { border-left: 4px solid var(--brand); }
.request-main { display: flex; gap: 15px; }
.request-main h2 { margin-bottom: 4px; }
.request-period { margin-bottom: 9px; font-size: 17px; font-weight: 700; }
.request-period span { color: var(--muted); font-size: 14px; }
.request-note { margin: 12px 0 0; color: var(--muted); }
.decision-form { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.request-delete { grid-column: 1 / -1; padding-top: 11px; border-top: 1px solid var(--line); }
.request-delete summary { width: fit-content; color: var(--danger); cursor: pointer; font-size: 13px; font-weight: 700; }
.request-delete-form { display: grid; grid-template-columns: minmax(210px, 280px) minmax(260px, 1fr) auto; align-items: end; gap: 14px; margin-top: 13px; }
.request-delete-form .compact { min-height: 34px; }

.users-grid { grid-template-columns: minmax(280px, .8fr) repeat(2, minmax(0,1fr)); }
.user-list { display: grid; }
.user-row { display: grid; grid-template-columns: auto minmax(180px, .8fr) minmax(360px, 1.7fr); align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.user-row:first-child { border-top: 0; }
.user-row.inactive .avatar, .user-row.inactive .user-data { opacity: .55; }
.user-data { min-width: 180px; display: flex; flex: 1; flex-direction: column; }
.user-actions { display: grid; gap: 8px; }
.user-edit { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafcfb; }
.user-edit summary { width: fit-content; color: var(--brand); cursor: pointer; font-size: 13px; font-weight: 700; }
.user-edit-form { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.user-edit-form .button { grid-column: 1 / -1; justify-self: end; }
.balance-form { display: flex; align-items: end; gap: 8px; }
.balance-form label { width: 72px; font-size: 11px; }
.balance-form input { min-height: 34px; padding: 6px 8px; }
.password-reset-form { display: flex; align-items: end; justify-content: flex-end; gap: 8px; }
.password-reset-form label { width: 190px; font-size: 11px; }
.password-reset-form input { min-height: 34px; padding: 6px 8px; }
.status-form { display: flex; justify-content: flex-end; }

.archive-tabs { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.archive-panel { padding-top: 8px; }
.archive-table-wrap { margin-top: 0; }
.archive-table-wrap td { vertical-align: top; }
.restore-request summary { color: var(--brand); cursor: pointer; font-weight: 700; }
.restore-request form { width: 190px; margin-top: 9px; padding: 10px; border-radius: 8px; background: var(--brand-soft); }
.restore-request p { margin-bottom: 9px; font-size: 12px; }
.text-nowrap { white-space: nowrap; }
.text-danger { color: var(--danger); }

.heading-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.reminder-form-panel { width: min(820px, 100%); }
.reminder-rule-note { padding: 13px 15px; border: 1px solid #c6e5d8; border-radius: 9px; color: #14553e; background: var(--brand-soft); font-size: 13px; }
.reminder-summary { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: -7px 0 22px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.65); font-size: 12px; }
.reminder-summary strong { color: var(--ink); }
.reminder-list-panel { padding-top: 8px; }
.reminder-table-wrap { margin-top: 0; }
.reminder-table td { vertical-align: top; }
.reminder-table td:first-child { min-width: 230px; }
.reminder-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; min-width: 128px; }
.reminder-row-actions form { margin: 0; }
.reminder-detail-grid { margin-bottom: 20px; }
.reminder-actions-panel { display: grid; gap: 10px; }
.reminder-actions-panel h2 { margin-bottom: 4px; }
.reminder-actions-panel form { margin: 0; }
.reminder-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 22px; margin: 20px 0; }
.reminder-data-grid div { padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.reminder-data-grid dt { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.reminder-data-grid dd { margin: 4px 0 0; }
.message-preview { display: grid; gap: 7px; padding: 16px; border-radius: 10px; background: #f8faf9; }
.message-preview span { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.message-preview p { margin: 0; white-space: pre-wrap; }
.message-preview .automatic-reply-footer { padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.send-now-action, .archive-reminder-action { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.send-now-action summary, .archive-reminder-action summary { cursor: pointer; color: var(--brand); font-weight: 700; }
.archive-reminder-action summary { color: var(--danger); }
.send-now-action form, .archive-reminder-action form { display: grid; gap: 10px; margin-top: 10px; }
.send-now-action .checkbox-label, .archive-reminder-action .checkbox-label { align-items: start; min-height: 0; font-size: 12px; }
.reminder-history-panel { margin-top: 20px; }
.reminder-status-active, .reminder-status-received, .reminder-delivery-sent { color: #13533c; background: var(--brand-soft); }
.reminder-status-waiting { color: var(--warning); background: var(--warning-soft); }
.reminder-status-overdue, .reminder-delivery-error { color: #7c2020; background: var(--danger-soft); }
.reminder-status-paused, .reminder-status-cancelled, .reminder-delivery-skipped, .reminder-delivery-processing { color: #4e5a54; background: #e9eeeb; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; }
  .main-nav { order: 3; grid-column: 1 / -1; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
  .nav-menu { top: calc(100% + 4px); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid, .users-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .request-card { grid-template-columns: 1fr; }
  .request-delete-form { grid-template-columns: 1fr; align-items: stretch; }
  .test-cleanup-form { grid-template-columns: 1fr; align-items: stretch; }
  .user-row { grid-template-columns: auto 1fr; align-items: start; }
  .user-actions { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .topbar { padding: 10px 16px; }
  .user-menu > a { display: none; }
  .main-nav { gap: 18px; font-size: 13px; }
  .page { width: min(100% - 24px, 1240px); padding-top: 26px; }
  .page-heading.split { align-items: start; flex-direction: column; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 25px; }
  .panel, .login-card { padding: 18px; }
  .table-wrap { margin: 15px -18px -18px; }
  .form-row { grid-template-columns: 1fr; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .user-row { align-items: start; flex-wrap: wrap; }
  .user-actions, .balance-form, .password-reset-form, .status-form { width: 100%; }
  .user-edit-form { grid-template-columns: 1fr; }
  .user-edit-form .button { grid-column: 1; justify-self: stretch; }
  .password-reset-form, .status-form { justify-content: flex-start; }
  .calendar-toolbar { grid-template-columns: 1fr; }
  .view-switcher, .period-switcher { grid-column: 1; justify-self: center; }
  .monthly-calendar { min-width: 1000px; }
  .calendar-heading .button { width: 100%; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .reminder-data-grid { grid-template-columns: 1fr; }
  .reminder-summary { display: grid; }
}

/* Beleženje časa */
.time-overview-grid { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(230px, .75fr); gap: 20px; align-items: stretch; margin-bottom: 20px; }
.timer-panel { margin: 0; display: flex; flex-direction: column; }
.timer-extension-action { display: flex; justify-content: flex-end; margin-top: auto; padding-top: 18px; }
.timer-panel.timer-running { border: 1px solid #7bc6a8; background: linear-gradient(135deg, #effaf5, #fff); }
.timer-status, .timer-start-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.timer-status h2, .timer-start-heading h2 { margin-bottom: 4px; }
.timer-status p, .timer-start-heading p { margin: 0; }
.timer-pulse { width: 13px; height: 13px; flex: 0 0 auto; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 7px rgba(23,107,77,.12); animation: timer-pulse 1.7s infinite; }
@keyframes timer-pulse { 50% { box-shadow: 0 0 0 13px rgba(23,107,77,0); } }
.timer-clock { margin-left: auto; font-size: 30px; font-variant-numeric: tabular-nums; }
.timer-start-form { display: grid; grid-template-columns: minmax(280px, 1fr) 105px; align-items: center; gap: 18px; margin-top: 16px; }
.timer-start-fields { display: grid; gap: 12px; }
.timer-start-button { display: flex; align-items: center; flex-direction: column; gap: 7px; padding: 5px; border: 0; color: var(--brand-dark); background: transparent; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.timer-start-button:hover .timer-start-icon, .timer-start-button:focus-visible .timer-start-icon { background: var(--brand-dark); transform: translateY(-2px); box-shadow: 0 7px 15px rgba(14,81,57,.24); }
.timer-start-button:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 10px; }
.timer-start-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--brand); box-shadow: 0 4px 11px rgba(14,81,57,.18); transition: background .12s, transform .12s, box-shadow .12s; }
.timer-start-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.timer-stop-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px; margin-top: 16px; }
.timer-cancel-form { margin-top: 9px; text-align: right; }
.time-quick-actions { display: flex; flex-direction: column; gap: 10px; }
.time-quick-actions > div { flex: 1; }
.time-quick-actions h2 { margin-bottom: 7px; }
.time-quick-actions .button { width: 100%; }
.time-week-toolbar { display: flex; align-items: center; justify-content: center; gap: 13px; margin: 18px 0 13px; }
.time-week-toolbar div { display: grid; min-width: 210px; text-align: center; }
.time-week-toolbar small { color: var(--muted); }
.time-grid-panel, .time-report-panel { padding: 0; overflow: hidden; }
.time-grid-scroll, .time-report-scroll { overflow-x: auto; }
.time-grid { width: 100%; min-width: 910px; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.time-grid th, .time-grid td { padding: 7px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.time-grid th:last-child, .time-grid td:last-child { border-right: 0; }
.time-grid tbody tr:last-child th, .time-grid tbody tr:last-child td { border-bottom: 0; }
.time-grid thead th { background: #f7f9f8; }
.time-grid thead th:first-child, .time-grid tbody th { position: sticky; left: 0; z-index: 2; width: 290px; min-width: 290px; padding-left: 12px; text-align: left; background: white; }
.time-grid thead th:first-child { z-index: 3; background: #f7f9f8; }
.time-grid thead th:not(:first-child):not(:last-child) { width: 76px; min-width: 76px; }
.time-grid thead th:last-child { width: 80px; min-width: 80px; }
.time-grid thead th span, .time-grid thead th strong, .time-grid tbody th strong, .time-grid tbody th small { display: block; }
.time-grid thead th span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.time-grid thead th strong { margin: 2px 0; font-size: 17px; }
.time-grid tbody th strong { color: #10271e; font-weight: 800; }
.time-grid tbody th small { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; text-transform: none; letter-spacing: normal; }
.time-grid .weekend { background: #f3f6f4; }
.time-grid [data-day-index].is-active-day { background: #eaf4f8; }
.time-day-totals th { font-size: 11px; font-variant-numeric: tabular-nums; }
.time-cell-form { display: grid; grid-template-columns: minmax(38px, 1fr) 22px; align-items: center; gap: 2px; }
.time-cell-input { width: 100%; min-width: 0; min-height: 35px; padding: 5px 4px; border: 1px solid transparent; border-radius: 6px; color: var(--ink); background: transparent; font: inherit; font-variant-numeric: tabular-nums; text-align: right; transition: opacity .12s ease, border-color .12s ease, background .12s ease; }
.time-cell-input:not(.has-time) { opacity: 0; }
.time-cell-input::placeholder { color: #aab3af; }
.time-cell-form:hover .time-cell-input:not(:disabled), .time-cell-form:focus-within .time-cell-input, .is-active-day .time-cell-input:not(:disabled) { opacity: 1; border-color: #cbd8e0; background: white; }
.time-cell-input:hover:not(:disabled), .time-cell-input:focus { border-color: #68ad90; outline: 0; box-shadow: 0 0 0 2px rgba(23,107,77,.1); }
.time-cell-input.has-time { color: var(--brand-dark); font-weight: 750; }
.is-active-day .time-cell-input.has-time, .time-cell-form:focus-within .time-cell-input.has-time { background: var(--brand-soft); }
.time-cell-input:disabled { cursor: not-allowed; opacity: .6; }
.time-note-button { display: grid; width: 22px; height: 35px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 6px; color: #84908a; background: transparent; font-size: 17px; line-height: 1; opacity: 0; cursor: pointer; transition: opacity .12s ease, border-color .12s ease, background .12s ease; }
.time-cell-form:hover .time-note-button:not(:disabled), .time-cell-form:focus-within .time-note-button, .is-active-day .time-note-button:not(:disabled), .time-note-button.has-note { opacity: 1; }
.time-note-button:hover:not(:disabled), .time-note-button:focus-visible { border-color: #9bcdb9; color: var(--brand); background: var(--brand-soft); outline: 0; }
.time-note-button.has-note { color: var(--brand); background: var(--brand-soft); }
.time-note-button:disabled { cursor: not-allowed; opacity: .45; }
.time-cell { width: 100%; min-height: 35px; border: 1px solid transparent; border-radius: 7px; color: #9aa39e; background: transparent; font: inherit; font-variant-numeric: tabular-nums; }
.time-cell.has-time { color: var(--brand-dark); background: var(--brand-soft); font-weight: 750; }
.time-cell-multiple { display: grid; align-content: center; text-decoration: none; }
.time-cell-multiple small { display: block; color: var(--muted); font-size: 8px; font-weight: 600; text-transform: uppercase; }
.time-grid-help { margin: 9px 2px 0; color: var(--muted); font-size: 12px; text-align: right; }
.inline-save-notice { margin: 10px 0 18px; padding: 10px 13px; color: #14553e; background: var(--brand-soft); border: 1px solid #c6e5d8; border-radius: 9px; font-weight: 700; }
.time-employee-name { color: var(--brand); }
.time-employee-switch { min-width: 260px; }
.time-employee-switch label { margin: 0; }
.time-note-dialog { width: min(430px, calc(100% - 28px)); padding: 20px; border: 0; border-radius: 12px; color: var(--ink); box-shadow: 0 22px 70px rgba(12,32,24,.28); }
.time-note-dialog::backdrop { background: rgba(10,24,18,.35); }
.time-note-dialog .section-heading { margin-bottom: 12px; }
.time-note-dialog textarea { width: 100%; resize: vertical; }
.time-note-dialog .muted { margin: 5px 0 0; text-align: right; }
.time-note-dialog .form-actions { margin-bottom: 0; }
.time-row-total { color: var(--brand-dark); background: #f7f9f8; font-weight: 800; font-variant-numeric: tabular-nums; }
.time-entry-panel, .time-entries-panel { margin-top: 20px; }
.time-entry-fields { display: grid; grid-template-columns: 150px minmax(190px, 1fr) minmax(180px, 1fr) 120px; gap: 12px; }
.time-entry-list { display: grid; gap: 9px; }
.time-entry-item { border: 1px solid var(--line); border-radius: 9px; background: #fbfcfb; }
.time-entry-item > summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 15px; cursor: pointer; }
.time-entry-item > summary span { display: grid; gap: 3px; }
.time-entry-item > summary small { color: var(--muted); }
.time-entry-edit { display: grid; grid-template-columns: 150px 1fr 1fr 120px; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.time-entry-edit .span-2 { grid-column: span 2; }
.time-entry-edit-actions { align-self: end; text-align: right; }
.time-entry-delete { padding: 0 14px 14px; text-align: right; }
.locked-note { margin: 0; padding: 14px; border-top: 1px solid var(--line); color: var(--muted); }
.client-admin-grid { grid-template-columns: 1fr; }
#nova-stranka { scroll-margin-top: 88px; }
.new-client-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: end; }
.new-client-form .checkbox-label { align-self: end; }
.new-client-form .button { width: min(240px, 100%); justify-self: end; }
.client-list { display: grid; gap: 10px; }
.client-list-toolbar { margin-bottom: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.client-list-toolbar label { width: min(620px, 100%); }
.client-item { border: 1px solid var(--line); border-radius: 10px; }
.client-item[hidden] { display: none; }
.client-item.inactive { opacity: .7; }
.client-item > summary { display: flex; align-items: center; justify-content: space-between; padding: 14px; cursor: pointer; }
.client-item > summary > span:first-child { display: grid; gap: 3px; }
.client-item > summary small { color: var(--muted); }
.client-item-body { display: grid; gap: 13px; padding: 14px; border-top: 1px solid var(--line); background: #fbfcfb; }
.client-edit-form { display: grid; grid-template-columns: minmax(210px, 1fr) 100px 135px 145px auto auto; align-items: end; gap: 10px; }
.work-types-block { padding: 13px; border-radius: 9px; background: white; }
.work-types-block h3 { margin-bottom: 3px; }
.work-type-list { display: grid; gap: 8px; margin: 10px 0; }
.work-type-row { display: flex; align-items: center; gap: 10px; }
.work-type-row.inactive { opacity: .65; }
.work-type-edit { display: grid; grid-template-columns: minmax(180px, 1fr) 180px auto; align-items: end; gap: 8px; flex: 1; }
.work-type-add { display: grid; grid-template-columns: minmax(180px, 1fr) 180px auto; gap: 8px; }
.work-type-add input { min-height: 34px; }
.client-picker-panel { padding: 0; overflow: hidden; }
.client-picker-toolbar, .client-picker-save { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 16px 18px; }
.client-picker-toolbar { border-bottom: 1px solid var(--line); background: #f7f9f8; }
.client-search { width: min(520px, 100%); }
.client-picker-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.client-picker-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 620px; overflow-y: auto; }
.client-picker-item { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 13px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.client-picker-item[hidden] { display: none; }
.client-picker-item:nth-child(even) { border-right: 0; }
.client-picker-item:hover { background: #f7fbf9; }
.client-picker-item input { position: absolute; opacity: 0; pointer-events: none; }
.client-picker-check { width: 21px; height: 21px; flex: 0 0 auto; border: 2px solid #aab7b1; border-radius: 6px; background: white; }
.client-picker-item input:checked + .client-picker-check { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 4px white; }
.client-picker-item input:focus-visible + .client-picker-check { outline: 3px solid rgba(23,107,77,.2); outline-offset: 2px; }
.client-picker-name { display: grid; min-width: 0; gap: 3px; }
.client-picker-name strong, .client-picker-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-picker-name small { color: var(--muted); }
.client-picker-empty { margin: 20px; }
.client-picker-save { border-top: 1px solid var(--line); }
.client-import-panel { margin-bottom: 20px; }
.client-import-form { display: grid; grid-template-columns: minmax(280px, 1fr) auto; align-items: end; gap: 14px; margin-top: 16px; }
.client-import-form input[type="file"] { padding: 9px; background: white; }
.billing-import-form { display: grid; grid-template-columns: minmax(280px, 1.35fr) minmax(175px, .65fr) minmax(240px, 1fr) auto; align-items: end; gap: 14px; margin-top: 16px; }
.billing-import-form input[type="file"] { padding: 9px; background: white; }
.import-errors { margin-bottom: 20px; border-color: #e4aaaa; background: var(--danger-soft); }
.import-errors h2 { color: var(--danger); }
.import-errors ul { margin: 12px 0 0; padding-left: 22px; }
.client-import-preview { padding: 0; overflow: hidden; }
.client-import-preview > .section-heading { margin: 0; padding: 18px; border-bottom: 1px solid var(--line); }
.client-import-scroll { overflow-x: auto; }
.client-import-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 13px; }
.client-import-table th, .client-import-table td { padding: 11px 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.client-import-table th:last-child, .client-import-table td:last-child { border-right: 0; }
.client-import-table thead th { background: #f2f6f4; }
.client-import-confirm { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; }
.client-import-confirm p { margin: 0; }
.client-import-confirm .form-actions { margin: 0; }
.actitime-import-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 18px; }
.actitime-mapping-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 0 18px 18px; }
.actitime-mapping-grid > div { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb; }
.actitime-mapping-grid h3 { margin: 0 0 10px; }
.actitime-mapping-grid ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.actitime-mapping-grid li { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.actitime-mapping-grid li:last-child { padding-bottom: 0; border-bottom: 0; }
.actitime-mapping-grid span { color: var(--muted); }
.billing-import-note { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #f7faf8; color: var(--muted); font-size: 12px; }
.billing-import-table { min-width: 1280px; }
.billing-import-table td small { display: block; max-width: 420px; margin-top: 4px; color: var(--muted); line-height: 1.35; }
.billing-import-table td:nth-child(7) { max-width: 310px; color: #765313; background: #fffaf0; }
.billing-import-table .import-row-skipped { opacity: .7; background: var(--danger-soft); }
.report-filter-panel { margin-bottom: 14px; }
.report-filters { display: grid; grid-template-columns: 150px 150px 1fr 1fr auto auto; align-items: end; gap: 11px; }
.report-filters .checkbox-label { align-self: center; white-space: nowrap; }
.report-view-tabs { display: inline-flex; gap: 4px; margin: -8px 0 16px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.report-view-tabs a { padding: 8px 14px; border-radius: 8px; color: var(--muted); font-weight: 750; }
.report-view-tabs a:hover, .report-view-tabs a.active { color: white; background: var(--brand); text-decoration: none; }
.report-filters-multi { grid-template-columns: 150px 150px minmax(180px, 1fr) minmax(200px, 1.3fr) auto auto; }
.report-filters-personal { grid-template-columns: 150px 150px minmax(240px, 1fr) auto auto; }
.report-multi-filter { position: relative; }
.report-multi-filter > summary { min-height: 43px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #cbd5cf; border-radius: 8px; background: white; color: #34423a; cursor: pointer; font-size: 13px; font-weight: 700; list-style: none; }
.report-multi-filter > summary::-webkit-details-marker { display: none; }
.report-multi-filter > summary span { color: var(--muted); font-size: 11px; font-weight: 600; }
.report-multi-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 15; width: min(340px, 82vw); max-height: 360px; overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.report-multi-menu > p { margin-bottom: 9px; color: var(--muted); font-size: 11px; }
.report-multi-menu .checkbox-label { display: flex; align-items: center; gap: 8px; padding: 7px 5px; white-space: normal; }
.report-multi-menu .checkbox-label input { width: auto; min-height: auto; }
.report-client-menu { width: min(400px, 86vw); }
.report-filter-search { margin-bottom: 8px; }
.report-filter-search input { min-height: 38px; }
.report-filter-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.report-filter-shortcuts .button { padding: 6px 9px; }
.report-compare { padding-bottom: 11px; }
.detail-report-actions { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 18px 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--brand-soft); }
.detail-report-actions > div { display: flex; gap: 12px; align-items: center; }
.detail-report-actions > div span { color: var(--muted); }
.client-detail-report { margin-bottom: 18px; padding: 0; overflow: hidden; }
.client-detail-report .section-heading { margin: 0; padding: 20px 22px; }
.detail-report-scroll { overflow-x: auto; }
.detail-report-table { width: 100%; min-width: 850px; border-collapse: collapse; font-size: 12px; }
.detail-report-table th, .detail-report-table td { padding: 10px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; vertical-align: top; }
.detail-report-table th:last-child, .detail-report-table td:last-child { border-right: 0; }
.detail-report-table thead th { background: #f2f6f4; color: #43534b; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.detail-report-table th:nth-child(1) { width: 18%; }
.detail-report-table th:nth-child(2) { width: 10%; }
.detail-report-table th:nth-child(3) { width: 12%; }
.detail-report-table th:nth-child(4) { width: 17%; }
.detail-report-table th:nth-child(5) { width: 8%; text-align: right; }
.detail-report-table td:nth-child(5) { text-align: right; }
.detail-comment { white-space: pre-line; }
.report-lock-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.report-lock-bar.locked { border-color: #e3ca8e; background: #fff9e9; }
.report-lock-bar > div { display: grid; gap: 3px; }
.report-lock-bar small { color: var(--muted); }
.time-report-table { width: 100%; min-width: 780px; border-collapse: collapse; font-size: 13px; }
.report-period-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 13px 15px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.report-period-note strong { color: var(--ink); }
.time-report-table th, .time-report-table td { padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: right; }
.time-report-table thead th, .time-report-table tfoot th, .time-report-table tfoot td { background: #f2f6f4; }
.time-report-table th:first-child { position: sticky; left: 0; z-index: 2; min-width: 220px; text-align: left; background: white; }
.time-report-table thead th:first-child, .time-report-table tfoot th:first-child { background: #f2f6f4; }
.time-report-table td strong, .time-report-table td small, .time-report-table tbody th strong, .time-report-table tbody th small { display: block; }
.time-report-table td small, .time-report-table tbody th small { margin-top: 3px; color: var(--muted); font-weight: 400; }
.time-report-table td.missing-current { background: #fff1ed; }
.report-legend { display: flex; align-items: center; gap: 7px; margin: 12px 15px; color: var(--muted); font-size: 12px; }
.report-legend span { width: 14px; height: 14px; border-radius: 3px; background: #fff1ed; }

@media (max-width: 900px) {
  .timer-start-form, .timer-stop-form, .time-entry-fields, .client-edit-form, .report-filters, .client-import-form, .billing-import-form { grid-template-columns: 1fr 1fr; }
  .timer-start-form { grid-template-columns: minmax(260px, 1fr) 105px; }
  .timer-start-form .button, .timer-stop-form .button { align-self: end; }
  .time-overview-grid { grid-template-columns: 1fr; }
  .time-quick-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .time-quick-actions > div { grid-column: 1 / -1; }
  .client-admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .timer-status, .timer-start-heading { align-items: flex-start; flex-direction: column; }
  .timer-clock { margin-left: 26px; }
  .timer-start-form, .timer-stop-form, .time-entry-fields, .time-entry-edit, .client-edit-form, .report-filters, .client-import-form, .billing-import-form { grid-template-columns: 1fr; }
  .timer-start-button { justify-self: center; }
  .time-quick-actions, .new-client-form { grid-template-columns: 1fr; }
  .new-client-form .button { width: 100%; }
  .time-entry-edit .span-2 { grid-column: 1; }
  .time-week-toolbar { flex-wrap: wrap; }
  .report-lock-bar { align-items: flex-start; flex-direction: column; }
  .client-picker-toolbar, .client-picker-save { align-items: stretch; flex-direction: column; }
  .client-picker-list { grid-template-columns: 1fr; }
  .client-picker-item { border-right: 0; }
  .work-type-row { align-items: flex-start; flex-direction: column; }
  .work-type-edit, .work-type-add { width: 100%; grid-template-columns: 1fr; }
  .client-import-confirm { align-items: stretch; flex-direction: column; }
  .actitime-import-summary, .actitime-mapping-grid { grid-template-columns: 1fr; }
}

@media (hover: none) {
  .time-cell-input:not(.has-time), .time-note-button:not(:disabled) { opacity: 1; }
  .time-cell-input:not(:disabled) { border-color: #d8e0dc; background: white; }
}

/* Obračun in računi */
.billing-stats { margin-bottom: 20px; }
.billing-stats .stat-card strong { font-size: 28px; }
.billing-stats .stat-card small { display: block; margin-top: 4px; color: rgba(255,255,255,.78); }
.billing-home-grid { grid-template-columns: minmax(290px, .7fr) minmax(0, 1.3fr); align-items: start; }
.billing-service-list { margin-bottom: 20px; }
.billing-client-directory { padding: 0; overflow: hidden; }
.billing-client-directory > .section-heading { margin: 0; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.billing-client-directory > .billing-search { margin: 16px 20px; }
.billing-client-list { display: grid; border-top: 1px solid var(--line); }
.billing-client-row { display: grid; grid-template-columns: minmax(260px, 1.45fr) minmax(260px, 1fr) 150px auto; align-items: center; gap: 18px; padding: 15px 20px; border-bottom: 1px solid var(--line); color: inherit; }
.billing-client-row[hidden], [data-billing-service-item][hidden], [data-admin-client-item][hidden] { display: none; }
.potential-clients { margin-top: 20px; }
.potential-client-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 13px 15px; margin-bottom: 18px; }
.potential-client-form .span-2 { grid-column: span 2; }
.potential-client-list { display: grid; gap: 10px; }
.billing-client-row:hover { background: #f6faf8; text-decoration: none; }
.billing-client-main, .billing-client-count { display: grid; gap: 4px; min-width: 0; }
.billing-client-main strong, .billing-client-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-client-main small, .billing-client-count small, .billing-client-types { color: var(--muted); font-size: 12px; }
.billing-client-count { text-align: right; }
.billing-client-count strong { font-size: 20px; }
.billing-client-status { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.billing-client-status > div { display: grid; gap: 4px; }
.billing-client-status small { color: var(--muted); }
.billing-client-status.archived { border-color: #e3ca8e; background: #fff9e9; }
.billing-service-create-panel { margin: 0 0 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: #fafcfb; }
.billing-service-create-panel > .section-heading { margin-bottom: 15px; }
.billing-service-create-form { padding: 0; }
.compact-heading { align-items: center; }
.compact-heading h3 { margin: 0; }
.minimax-mapping-panel { margin-top: 20px; }
.minimax-mapping-list { display: grid; margin: 18px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.minimax-mapping-row { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(320px, 1.2fr); align-items: center; gap: 18px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.minimax-mapping-row:last-child { border-bottom: 0; }
.minimax-mapping-row > span { display: grid; gap: 4px; min-width: 0; }
.minimax-mapping-row small { color: var(--muted); }
.minimax-suggestion { color: var(--brand-dark) !important; }
.minimax-stored { color: var(--brand-dark) !important; font-weight: 700; }
.minimax-save-state { display: grid; gap: 3px; margin: 16px 0; padding: 12px 14px; border: 1px solid #b9dfcf; border-radius: 9px; background: var(--brand-soft); }
.minimax-save-state span { color: var(--muted); font-size: 13px; }
.minimax-ledger-test-form { display: grid; gap: 18px; }
.minimax-ledger-test-form .button { min-height: 43px; }
.minimax-ledger-archive-row { display: grid; grid-template-columns: 190px 230px; gap: 12px; align-items: end; }
.minimax-ledger-help, .minimax-ledger-disclaimer { margin: 13px 0 0; }
.minimax-ledger-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.minimax-ledger-table { min-width: 880px; }
.minimax-ledger-table td:nth-last-child(-n+2), .minimax-ledger-table th:nth-last-child(-n+2) { text-align: right; }
.minimax-document-test-form { display: grid; gap: 18px; }
.minimax-document-query-row { display: grid; grid-template-columns: minmax(280px, 1fr) 190px auto; align-items: end; gap: 12px; }
.minimax-document-test-form .button { min-height: 43px; }
.minimax-document-archive-group { margin: 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb; }
.minimax-document-archive-group legend { padding: 0 8px; color: var(--brand-dark); font-size: 13px; font-weight: 750; }
.minimax-document-archive-row { display: grid; grid-template-columns: 190px 190px 190px; gap: 12px; align-items: end; }
.minimax-document-results { display: grid; gap: 18px; }
.minimax-document-result { overflow: hidden; }
.minimax-document-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 16px; }
.minimax-document-table { min-width: 720px; }
.minimax-document-table td:last-child, .minimax-document-table th:last-child { text-align: right; }
.minimax-baseline-list { display: grid; }
.minimax-baseline-item { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); align-items: end; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.minimax-baseline-item:last-child { border-bottom: 0; }
.minimax-baseline-item > div { display: grid; gap: 4px; }
.minimax-baseline-item small { color: var(--muted); }
.minimax-baseline-form { display: flex; align-items: end; justify-content: flex-end; gap: 10px; }
.minimax-baseline-form label { min-width: 130px; }
.billing-service-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px 15px; align-items: end; }
.billing-service-form.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.billing-service-form .span-2 { grid-column: span 2; }
.billing-service-form fieldset { min-width: 0; margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.billing-service-form legend { padding: 0 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.billing-time-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.billing-allocation-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.billing-time-fields[hidden], .billing-allocation-fields[hidden] { display: none; }
.billing-allocation-row { display: grid; grid-template-columns: minmax(0, 1fr) 85px; gap: 8px; }
.billing-search { display: block; width: min(620px, 100%); margin-bottom: 15px; }
.billing-service-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.billing-service-toolbar .billing-search { flex: 1; margin-bottom: 0; }
.billing-service-toolbar .button { flex: 0 0 auto; }
.billing-time-allocation-note { margin: 0; padding: 11px 13px; border-radius: 8px; color: var(--brand-dark); background: var(--brand-soft); font-size: 13px; }
.billing-run-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.billing-run-summary article { display: grid; gap: 5px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.billing-run-summary article span { color: var(--muted); font-size: 12px; }
.billing-run-summary article strong { font-size: 22px; }
.billing-run-summary article.accent { color: white; border-color: var(--brand); background: var(--brand); }
.billing-run-summary article.accent span { color: rgba(255,255,255,.8); }
.billing-run-action { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 14px 17px; border: 1px solid #b9dfcf; border-radius: 10px; background: var(--brand-soft); }
.billing-run-action.locked { border-color: #e3ca8e; background: #fff9e9; }
.billing-run-action > div { display: grid; gap: 3px; }
.billing-run-action small { color: var(--muted); }
.billing-run-action details { position: relative; }
.billing-run-action details > summary { list-style: none; cursor: pointer; }
.billing-run-action details > summary::-webkit-details-marker { display: none; }
.billing-run-action details > form { position: absolute; top: calc(100% + 7px); right: 0; z-index: 5; width: 330px; display: grid; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.billing-invoice-list { display: grid; gap: 16px; }
.billing-empty-run { display: grid; justify-items: center; gap: 12px; padding: 28px; }
.billing-empty-run .empty-state { padding: 0; }
.billing-invoice { padding: 0; overflow: hidden; }
.billing-invoice.inactive { opacity: .72; }
.billing-invoice > .section-heading { margin: 0; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.billing-invoice-total { display: flex; align-items: center; gap: 15px; }
.billing-invoice-total strong { font-size: 21px; }
.billing-comparison { display: flex; align-items: end; gap: 14px; padding: 11px 19px; border-bottom: 1px solid var(--line); background: #f7f9f8; }
.billing-comparison > div { display: grid; flex: 1; gap: 2px; }
.billing-comparison small { color: var(--muted); }
.billing-comparison form { display: flex; align-items: end; gap: 8px; }
.billing-comparison input { width: 130px; }
.billing-comparison-result { min-width: 125px; text-align: right; }
.billing-comparison.matches { background: var(--brand-soft); }
.billing-comparison.differs { background: var(--danger-soft); }
.billing-due-form { display: flex; align-items: center; gap: 6px; }
.billing-due-form label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.billing-due-form input { width: 57px; min-height: 32px; padding: 5px 7px; }
.billing-line-list { display: grid; }
.billing-line { display: grid; grid-template-columns: minmax(150px,.7fr) minmax(260px,1.8fr) 105px 105px 135px auto auto; align-items: end; gap: 10px; padding: 14px 19px; border-bottom: 1px solid var(--line); }
.billing-line.excluded { opacity: .58; background: #f4f6f5; }
.billing-line-heading { display: grid; gap: 3px; align-self: center; }
.billing-line-heading small { color: var(--muted); }
.billing-line-value { display: grid; gap: 3px; align-self: center; text-align: right; }
.billing-line-value span { color: var(--muted); font-size: 11px; }
.billing-line-allocation { grid-column: 2 / -1; margin: -2px 0 0; color: var(--brand-dark); font-size: 11px; }
.billing-line-source-note { grid-column: 2 / -1; margin: -2px 0 0; padding: 7px 9px; border-radius: 6px; color: var(--brand-dark); background: var(--brand-soft); font-size: 11px; }
.billing-line-source-note.error { color: var(--danger); background: var(--danger-soft); }
.billing-skip-note { margin: 0; padding: 11px 19px; color: var(--danger); background: var(--danger-soft); }
.billing-skip-action { margin: 12px 19px 16px; }
.billing-skip-action > summary { color: var(--danger); cursor: pointer; font-weight: 700; }
.billing-skip-action form { display: flex; align-items: end; gap: 10px; margin-top: 10px; }
.billing-skip-action label { flex: 1; }
.danger-text { color: var(--danger); }
.billing-status-needs_input, .billing-status-error { color: #7c2020; background: var(--danger-soft); }
.billing-status-ready, .billing-status-approved, .billing-status-completed, .billing-status-issued { color: #13533c; background: var(--brand-soft); }
.billing-status-zero, .billing-status-skipped, .billing-status-draft { color: #4e5a54; background: #e9eeeb; }
.billing-status-minimax_draft { color: #73500c; background: #fff2c9; }
.minimax-catalog-panel { margin-bottom: 18px; }
.minimax-catalog-table { max-height: 430px; overflow: auto; }
.minimax-catalog-choice-table th:first-child, .minimax-catalog-choice-table th:nth-child(2),
.minimax-catalog-choice-table td:first-child, .minimax-catalog-choice-table td:nth-child(2) { width: 115px; text-align: center; }
.minimax-catalog-table input { width: 18px; height: 18px; }
.sticky-form-actions { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }

@media (max-width: 1050px) {
  .potential-client-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .minimax-document-query-row { grid-template-columns: minmax(240px, 1fr) 180px; }
  .minimax-document-query-row .button { grid-column: 2; }
  .minimax-document-archive-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .minimax-ledger-archive-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .minimax-baseline-item { grid-template-columns: 1fr; }
  .minimax-baseline-form { justify-content: flex-start; flex-wrap: wrap; }
  .billing-service-form, .billing-service-form.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-client-row { grid-template-columns: minmax(240px, 1.2fr) minmax(220px, 1fr) 135px auto; }
  .billing-line { grid-template-columns: minmax(150px,.8fr) minmax(260px,2fr) 90px 90px; }
  .billing-line-value, .billing-line .checkbox-label, .billing-line .button { grid-row: 2; }
  .billing-line-allocation, .billing-line-source-note { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .potential-client-form { grid-template-columns: 1fr; }
  .potential-client-form .span-2 { grid-column: 1; }
  .minimax-ledger-summary, .minimax-document-summary { grid-template-columns: 1fr; }
  .minimax-document-query-row, .minimax-document-archive-row, .minimax-ledger-archive-row { grid-template-columns: 1fr; }
  .minimax-document-query-row .button { grid-column: 1; }
  .minimax-baseline-form { align-items: stretch; flex-direction: column; }
  .billing-home-grid, .billing-service-form, .billing-service-form.compact, .billing-time-fields, .billing-allocation-fields, .billing-run-summary { grid-template-columns: 1fr; }
  .billing-service-form .span-2 { grid-column: 1; }
  .billing-run-action { align-items: stretch; flex-direction: column; }
  .billing-comparison, .billing-comparison form { align-items: stretch; flex-direction: column; }
  .billing-comparison-result { text-align: left; }
  .billing-run-action details > form { position: static; width: 100%; margin-top: 8px; }
  .billing-line { grid-template-columns: 1fr 1fr; }
  .billing-client-row { grid-template-columns: 1fr auto; gap: 8px 14px; }
  .billing-client-types { grid-column: 1 / -1; }
  .billing-client-count { text-align: left; }
  .billing-client-status { align-items: stretch; flex-direction: column; }
  .billing-line-heading, .billing-description, .billing-line-allocation, .billing-line-source-note { grid-column: 1 / -1; }
  .billing-skip-action form { align-items: stretch; flex-direction: column; }
  .minimax-mapping-row { grid-template-columns: 1fr; }
  .billing-service-toolbar { align-items: stretch; flex-direction: column; }
  .billing-service-toolbar .button { align-self: flex-start; }
}

/* Stripe */
.stripe-settings-heading h1 { margin-bottom: 18px; }
.stripe-section { margin-bottom: 20px; }
.stripe-section > h2, .stripe-section-heading h2, .stripe-repeat h2 { margin-bottom: 0; }
.stripe-section-heading, .stripe-header-actions, .stripe-row-actions { display: flex; align-items: center; gap: 10px; }
.stripe-section-heading { justify-content: space-between; margin-bottom: 16px; }
.stripe-header-actions { justify-content: flex-end; flex-wrap: wrap; }
.stripe-run-form { display: grid; gap: 14px; }
.stripe-run-primary-row { display: grid; grid-template-columns: minmax(280px,520px) 180px; gap: 14px; }
.stripe-run-mode-row { display: flex; align-items: end; gap: 16px; }
.stripe-run-mode-row label { width: min(340px,100%); flex: 0 0 auto; }
.stripe-run-mode-row p { margin: 0 0 11px; color: var(--muted); font-size: 13px; }
.stripe-help, .stripe-note { margin: 16px 0 0; color: var(--muted); }
.stripe-success { margin: 12px 0 0; padding: 11px 13px; border-radius: 8px; color: var(--brand-dark); background: var(--brand-soft); font-weight: 650; }
.stripe-warning { color: var(--warning); background: var(--warning-soft); border: 1px solid #eed49b; }
.stripe-run-meta { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; margin-bottom: 14px; }
.stripe-run-meta > div, .stripe-history-table td > strong, .stripe-history-table td > small, .stripe-settings-table td > small { display: block; }
.stripe-run-meta span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.stripe-run-meta code { overflow-wrap: anywhere; font-size: 12px; }
.stripe-summary-table { max-width: 720px; }
.stripe-summary-table td:last-child, .stripe-summary-table th:last-child, .money-cell { text-align: right; }
.stripe-summary-table tbody tr:nth-last-child(-n+2) { background: var(--brand-soft); }
.stripe-summary-table + .stripe-note, .stripe-section .table-wrap + .stripe-note { margin-top: 40px; }
.stripe-row-actions { flex-wrap: wrap; }
.stripe-row-actions form { margin: 0; }
.stripe-history-table td > small, .stripe-settings-table td > small { margin-top: 3px; color: var(--muted); }
.stripe-repeat { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.stripe-repeat p { margin-bottom: 0; color: var(--muted); }
.stripe-repeat form { display: flex; align-items: end; gap: 10px; min-width: 430px; }
.stripe-repeat form label { flex: 1; }
.stripe-account-form { display: grid; gap: 20px; }
.stripe-minimax-transfer { display: flex; align-items: end; justify-content: space-between; gap: 24px; border-color: #b9dfcf; background: var(--brand-soft); }
.stripe-minimax-transfer > div { flex: 1; }
.stripe-minimax-transfer p { margin: 7px 0 0; }
.stripe-minimax-transfer form { display: grid; gap: 10px; min-width: 330px; }
.stripe-settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.stripe-form-section-title { margin: 10px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
 .stripe-run-primary-row { grid-template-columns: minmax(260px,1fr) 180px; }
 .stripe-run-meta { grid-template-columns: 1fr 1fr; }
 .stripe-repeat { align-items: stretch; flex-direction: column; }
 .stripe-minimax-transfer { align-items: stretch; flex-direction: column; }
 .stripe-minimax-transfer form { min-width: 0; }
 .stripe-repeat form { min-width: 0; }
}
@media (max-width: 620px) {
 .stripe-run-primary-row, .stripe-settings-grid, .stripe-run-meta { grid-template-columns: 1fr; }
 .stripe-run-mode-row { align-items: stretch; flex-direction: column; gap: 7px; }
 .stripe-run-mode-row p { margin-bottom: 0; }
 .stripe-header-actions { justify-content: flex-start; }
 .stripe-repeat form { align-items: stretch; flex-direction: column; }
}


/* Invoice diagnostic follows the portal panels without edge-to-edge table overlap. */
.stripe-invoice-check .table-wrap { margin: 20px 0 0; }
.stripe-invoice-check td { overflow-wrap: anywhere; min-width: 120px; max-width: 420px; }
.stripe-invoice-check .section-heading { flex-wrap: wrap; gap: 16px; }
.stripe-invoice-check .section-heading form { margin: 0; }
.stripe-invoice-check .stripe-note { margin-top: 20px; line-height: 1.6; }
.minimax-invoice-detail-panel { margin-bottom: 20px; }
.minimax-invoice-detail-panel .table-wrap { margin: 16px 0 0; }
.minimax-invoice-detail-panel .minimax-invoice-detail-help { margin: 20px 0 0; line-height: 1.6; }
.minimax-invoice-detail-panel h3 { margin-top: 24px; }
.minimax-invoice-detail-query { grid-template-columns: minmax(0, 1fr) minmax(160px, 220px) auto; }
.minimax-invoice-detail-query label { min-width: 0; }
.minimax-invoice-detail-query .button { margin: 0; align-self: end; }
@media (max-width: 760px) {
  .minimax-invoice-detail-query { grid-template-columns: minmax(0, 1fr); }
  .minimax-invoice-detail-query .button { grid-column: 1; justify-self: start; }
}

/* Orders comparison: spacing independent of the legacy negative table margins. */
.order-check .table-wrap { margin: 20px 0; max-width:100%; overflow-x:auto; }
.order-check .panel { margin-top:24px; }
.order-check-form { display:grid; gap:18px; max-width:850px; }
.order-check-form label { display:block; min-width:0; }
.order-check-form input,.order-check-form select,.order-check-form textarea { width:100%; box-sizing:border-box; max-width:100%; }
.order-check-form p { margin:0; line-height:1.6; }
.order-check-actions { display:flex; flex-wrap:wrap; gap:18px; align-items:center; margin:20px 0; }
.order-check td,.order-check th { overflow-wrap:anywhere; }
.additional-service-form { max-width: 960px; }
.additional-service-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.additional-service-fields .span-2 { grid-column: 1 / -1; }
.additional-service-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; margin-block: 1rem; }
#dodatne-storitve { scroll-margin-top: 1rem; }
@media (max-width: 640px) { .additional-service-fields { grid-template-columns: 1fr; } }
