:root {
  --green: #176b52;
  --green-dark: #0f4e3b;
  --green-soft: #e6f3ec;
  --green-pale: #f1f8f4;
  --ink: #17231d;
  --muted: #738078;
  --line: #e1e7e2;
  --paper: #ffffff;
  --canvas: #f4f6f3;
  --danger: #a54831;
  --danger-soft: #fff0eb;
  --shadow: 0 12px 42px rgba(24, 45, 35, 0.07);
  --shadow-strong: 0 28px 90px rgba(15, 31, 24, 0.22);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--green);
  color: #fff;
  font-size: 18px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(23, 107, 82, 0.2);
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(27px, 3vw, 42px); line-height: 1.08; letter-spacing: -0.04em; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -0.025em; }
.subtitle { margin-bottom: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.primary-button,
.outline-button,
.today-button,
.outline-action,
.print-button,
.cancel-button,
.danger-button,
.copy-button {
  min-height: 43px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 760;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.primary-button {
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: var(--green);
  color: #fff;
  box-shadow: 0 10px 24px rgba(23, 107, 82, 0.2);
}

.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: 0.62; transform: none; }
.button-link { text-decoration: none; }

/* Přihlášení */
.login-body {
  min-height: 100dvh;
  padding: 24px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 15% 15%, rgba(73, 151, 118, 0.12), transparent 29%),
    linear-gradient(140deg, #f4f7f3 0%, #e8efe9 100%);
}

.login-shell {
  width: min(1020px, 100%);
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(360px, 1.12fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 35px 100px rgba(22, 45, 34, 0.14);
}

.login-panel {
  padding: 68px clamp(34px, 6vw, 76px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-brand { margin-bottom: 52px; display: flex; align-items: center; gap: 12px; font-size: 17px; }
.login-panel h1 { font-size: 38px; }
.login-intro { max-width: 350px; margin-bottom: 28px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.login-form { display: grid; gap: 18px; }
.login-submit { width: 100%; min-height: 49px; margin-top: 4px; }
.login-help { margin-top: 26px; color: #859088; font-size: 11px; }
.login-help span { margin-right: 6px; color: var(--green); font-size: 8px; }

.login-visual {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  background: linear-gradient(145deg, #0d4937, #197359 58%, #246e58);
}

.login-visual::before,
.login-visual::after {
  position: absolute;
  content: '';
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.login-visual::before { width: 380px; height: 380px; top: -105px; right: -105px; }
.login-visual::after { width: 230px; height: 230px; right: 80px; bottom: -90px; }
.visual-grid { position: absolute; inset: 0; opacity: 0.13; background-image: linear-gradient(rgba(255,255,255,.45) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.45) 1px, transparent 1px); background-size: 38px 38px; mask-image: linear-gradient(to bottom, #000, transparent 88%); }
.visual-card { position: absolute; right: 48px; bottom: 64px; left: 48px; padding: 30px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 22px; background: rgba(255, 255, 255, 0.11); color: #fff; box-shadow: 0 25px 60px rgba(0,0,0,.13); backdrop-filter: blur(15px); }
.visual-card > span { font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.visual-card strong { margin-top: 18px; display: block; font-size: 31px; line-height: 1.18; letter-spacing: -.035em; }
.visual-card p { margin: 16px 0 0; color: rgba(255,255,255,.75); font-size: 13px; line-height: 1.6; }
.setup-card { width: min(500px, 100%); padding: 42px; border-radius: 24px; background: #fff; box-shadow: var(--shadow-strong); }
.setup-card .brand-mark { margin-bottom: 32px; }
.setup-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }

.field { min-width: 0; display: grid; gap: 7px; }
.field > span:first-child { color: #4c5952; font-size: 11px; font-weight: 750; }
.field small { color: #919b95; font-weight: 550; }
.field input,
.field select,
.field textarea,
.year-picker select,
.report-actions select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #dce3dd;
  border-radius: 10px;
  background: #fbfcfb;
  color: var(--ink);
  outline: none;
  transition: border 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.field textarea { min-height: 82px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .year-picker select:focus, .report-actions select:focus { border-color: #69a58f; background: #fff; box-shadow: 0 0 0 3px rgba(23, 107, 82, 0.1); }
.form-alert, .page-alert { padding: 11px 13px; border: 1px solid #f2d3c9; border-radius: 10px; background: var(--danger-soft); color: #8d432e; font-size: 11px; font-weight: 650; line-height: 1.45; }

/* Aplikace */
.app-layout { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 25px 18px 20px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fff; }
.brand { padding: 0 8px; display: flex; align-items: center; gap: 11px; color: var(--ink); font-size: 17px; font-weight: 830; text-decoration: none; }
.main-nav { margin-top: 46px; display: grid; gap: 5px; }
.nav-item { width: 100%; min-height: 44px; padding: 0 12px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 10px; background: transparent; color: #657069; font-size: 12px; font-weight: 690; text-align: left; }
.nav-item > span { width: 20px; color: #849089; font-size: 18px; text-align: center; }
.nav-item:hover { background: #f6f8f5; color: var(--ink); }
.nav-item.active { background: var(--green-soft); color: var(--green-dark); }
.nav-item.active > span { color: var(--green); }
.admin-nav { margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.sidebar-tip { margin: auto 5px 22px; padding: 16px; border: 1px solid #dfe9e2; border-radius: 14px; background: var(--green-pale); }
.tip-icon { width: 28px; height: 28px; margin-bottom: 10px; display: grid; place-items: center; border-radius: 9px; background: var(--green); color: #fff; font-size: 12px; }
.sidebar-tip strong { font-size: 11px; }
.sidebar-tip p { margin: 6px 0 0; color: #748079; font-size: 9px; line-height: 1.5; }
.profile { padding: 10px 7px 0; display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #dfeee6; color: var(--green-dark); font-size: 10px; font-weight: 820; }
.avatar.small { width: 31px; height: 31px; }
.profile-copy { min-width: 0; display: grid; }
.profile-copy strong, .profile-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 10px; }
.profile-copy small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; height: 64px; padding: 0 clamp(22px, 4vw, 58px); display: flex; align-items: center; justify-content: flex-end; border-bottom: 1px solid rgba(222, 228, 223, .9); background: rgba(255, 255, 255, .9); backdrop-filter: blur(16px); }
.mobile-brand { display: none; align-items: center; gap: 9px; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.secure-badge { padding: 6px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 770; }
.quiet-button { padding: 6px 0; border: 0; background: transparent; color: #68746d; font-size: 10px; font-weight: 700; }
.quiet-button:hover { color: var(--green); }
.logout-form { display: contents; }
.content-wrap, .admin-content { width: min(1320px, 100%); margin: 0 auto; padding: 42px clamp(24px, 4vw, 62px) 72px; }
.welcome-row, .admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.welcome-row > .primary-button, .admin-heading > .primary-button { flex: 0 0 auto; }
.summary-grid { margin-top: 34px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.summary-card { min-height: 150px; padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.summary-card.featured { color: #fff; border-color: transparent; background: linear-gradient(140deg, #176b52, #12533f); box-shadow: 0 17px 43px rgba(23, 107, 82, .18); }
.summary-heading { display: flex; align-items: center; gap: 9px; color: #637069; font-size: 10px; font-weight: 750; }
.featured .summary-heading { color: rgba(255,255,255,.78); }
.summary-symbol { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.15); color: #fff; font-size: 14px; }
.summary-symbol.lilac { background: #eeeaf7; color: #76649e; }
.summary-symbol.sand { background: #f7eddb; color: #9e7437; }
.summary-card > strong { margin-top: 17px; display: block; font-size: 29px; letter-spacing: -.04em; }
.summary-card > strong small { font-size: 13px; font-weight: 670; letter-spacing: 0; }
.summary-card > p { margin: 5px 0 0; color: #8a948e; font-size: 9px; }
.featured > p { color: rgba(255,255,255,.68); }
.page-alert { margin-top: 18px; }
.calendar-card { position: relative; margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.calendar-card.is-loading::after { position: absolute; inset: 86px 0 0; content: ''; z-index: 5; background: rgba(255,255,255,.6); backdrop-filter: blur(1px); }
.calendar-toolbar { min-height: 86px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.calendar-toolbar .section-kicker { margin-bottom: 4px; font-size: 8px; }
.calendar-actions { display: flex; align-items: center; gap: 6px; }
.year-picker select { width: 82px; height: 38px; min-height: 38px; padding: 0 8px; font-size: 11px; font-weight: 690; }
.outline-button, .today-button { height: 38px; min-height: 38px; border: 1px solid var(--line); background: #fff; color: #5d6962; }
.outline-button { width: 38px; padding: 0; font-size: 20px; }
.today-button { padding: 0 12px; }
.outline-button:hover, .today-button:hover { border-color: #9db8aa; background: var(--green-pale); color: var(--green); }
.weekday-row { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); background: #fafbfa; }
.weekday-row span { padding: 10px; color: #919a95; font-size: 8px; font-weight: 800; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day-cell { min-width: 0; min-height: 123px; padding: 7px; border-right: 1px solid #edf0ed; border-bottom: 1px solid #edf0ed; background: #fff; }
.day-cell:nth-child(7n) { border-right: 0; }
.day-cell:nth-last-child(-n + 7) { border-bottom: 0; }
.day-cell.outside { background: #fafbfa; }
.day-cell.today { background: #f5faf7; box-shadow: inset 0 0 0 1px #8cc1aa; }
.day-add { width: 100%; min-height: 27px; padding: 0 3px; display: flex; align-items: center; justify-content: space-between; border: 0; background: transparent; color: #535f58; text-align: left; }
.outside .day-add { color: #b1b8b3; }
.day-number { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; font-size: 10px; font-weight: 750; }
.today .day-number { background: var(--green); color: #fff; }
.add-hint { color: #a2aaa5; font-size: 7px; opacity: 0; transition: opacity 130ms ease; }
.day-cell:hover .add-hint { opacity: 1; }
.day-entries { margin-top: 4px; display: grid; gap: 4px; }
.work-entry { min-width: 0; padding: 7px 8px; display: grid; gap: 2px; border: 0; border-left: 3px solid; border-radius: 7px; color: var(--ink); text-align: left; }
.work-entry span, .work-entry strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-entry span { font-size: 8px; font-weight: 760; }
.work-entry strong { color: #5f6a64; font-size: 7px; font-weight: 620; }
.work-entry.teal, .mobile-entry.teal { border-color: #409a7d; background: #e9f5ef; }
.work-entry.amber, .mobile-entry.amber { border-color: #d29a49; background: #faf2e5; }
.work-entry.blue, .mobile-entry.blue { border-color: #668ca8; background: #eaf1f5; }
.work-entry.violet, .mobile-entry.violet { border-color: #8b7fb1; background: #f0edf7; }
.more-entries { padding: 2px 4px; border: 0; background: transparent; color: var(--green); font-size: 7px; font-weight: 750; text-align: left; }
.empty-state { padding: 17px 20px; display: flex; align-items: center; gap: 11px; border-top: 1px solid var(--line); background: #fbfcfb; }
.empty-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--green-soft); color: var(--green); }
.empty-state div { flex: 1; }
.empty-state strong { font-size: 11px; }
.empty-state p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.text-button { border: 0; background: transparent; color: var(--green); font-size: 10px; font-weight: 740; }
.mobile-agenda-list, .mobile-bottom-nav { display: none; }

/* Dialogy */
dialog { padding: 0; border: 0; background: transparent; }
dialog::backdrop { background: rgba(15, 27, 21, .52); backdrop-filter: blur(5px); }
.entry-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 32px); }
.small-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); }
.dialog-card { overflow: hidden; border: 1px solid rgba(255,255,255,.75); border-radius: 20px; background: #fff; box-shadow: var(--shadow-strong); }
.dialog-header { padding: 22px 23px 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.dialog-header .eyebrow { margin-bottom: 5px; font-size: 8px; }
.close-button { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 10px; background: #f2f4f2; color: #657069; font-size: 22px; line-height: 1; }
.dialog-body { padding: 20px 23px; max-height: calc(100dvh - 190px); overflow-y: auto; }
.entry-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.stacked-fields { display: grid; gap: 15px; }
.full-field { grid-column: 1 / -1; }
.entry-mode { padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border-radius: 11px; background: #eef2ef; }
.entry-mode button { min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: #6b766f; font-size: 11px; font-weight: 720; }
.entry-mode button.active { background: #fff; color: var(--green-dark); box-shadow: 0 2px 8px rgba(24,40,33,.08); }
.bulk-fields { padding: 14px; display: grid; gap: 12px; border: 1px solid #dce9e1; border-radius: 12px; background: #f5faf7; }
.bulk-date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-field { min-height: 40px; display: flex; align-items: center; gap: 9px; color: #52605a; font-size: 11px; font-weight: 650; }
.check-field input { width: 18px; height: 18px; accent-color: var(--green); }
.bulk-preview { margin: 0; color: var(--green-dark); font-size: 10px; font-weight: 690; line-height: 1.45; }
.dialog-intro { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.dialog-footer { padding: 15px 23px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); }
.dialog-footer > div { display: flex; align-items: center; gap: 8px; }
.cancel-button, .danger-button, .copy-button { padding: 0 14px; border: 0; background: #f1f3f1; color: #59645e; }
.danger-button { background: var(--danger-soft); color: var(--danger); }
.copy-button { border: 1px solid #dce5df; background: #fff; color: var(--green-dark); }
.password-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.password-row input { border-radius: 10px 0 0 10px; }
.password-row button { padding: 0 11px; border: 1px solid #dce3dd; border-left: 0; border-radius: 0 10px 10px 0; background: var(--green-pale); color: var(--green); font-size: 9px; font-weight: 750; }
.field-hint { margin: -5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

/* Administrace */
.admin-layout { margin-top: 29px; display: grid; grid-template-columns: 260px minmax(0, 1fr); align-items: start; gap: 16px; }
.employee-directory, .admin-report { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.employee-directory { position: sticky; top: 82px; }
.directory-title { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: #536059; font-size: 11px; font-weight: 760; }
.directory-title strong { min-width: 24px; height: 24px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 9px; }
.employee-list { max-height: 590px; padding: 8px; overflow-y: auto; }
.employee-button { width: 100%; padding: 9px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; }
.employee-button:hover { background: #f5f7f4; }
.employee-button.active { background: var(--green-soft); }
.employee-button.inactive { opacity: .58; }
.employee-button > span:nth-child(2) { min-width: 0; flex: 1; display: grid; }
.employee-button strong, .employee-button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.employee-button strong { font-size: 10px; }
.employee-button small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.employee-button em { padding: 3px 5px; border-radius: 5px; background: #f2eadc; color: #82683b; font-size: 7px; font-style: normal; font-weight: 800; }
.directory-placeholder { margin: 0; padding: 25px 17px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.admin-report { position: relative; min-width: 0; }
.admin-report.is-loading::after { position: absolute; inset: 80px 0 0; content: ''; background: rgba(255,255,255,.62); backdrop-filter: blur(1px); }
.report-toolbar { min-height: 88px; padding: 16px 19px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.report-toolbar small { margin-top: 4px; display: block; color: var(--muted); font-size: 9px; }
.report-actions { display: flex; align-items: center; gap: 6px; }
.report-actions select { width: auto; min-height: 36px; height: 36px; padding: 0 26px 0 9px; font-size: 10px; font-weight: 680; }
.outline-action, .print-button { min-height: 36px; height: 36px; padding: 0 11px; }
.outline-action { border: 1px solid var(--line); background: #fff; color: #58645d; font-size: 9px; }
.print-button { border: 0; background: var(--green); color: #fff; font-size: 9px; }
.outline-action:disabled, .print-button:disabled { cursor: not-allowed; opacity: .45; }
.table-wrap { overflow-x: auto; }
.attendance-table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 9px; }
.attendance-table th, .attendance-table td { padding: 11px 9px; border-bottom: 1px solid #edf0ed; text-align: left; vertical-align: top; }
.attendance-table th { background: #fafbfa; color: #7c8680; font-size: 7px; font-weight: 820; letter-spacing: .055em; text-transform: uppercase; }
.attendance-table td { color: #58635d; }
.attendance-table td strong { color: var(--ink); }
.attendance-table tbody tr:hover { background: #fbfcfb; }
.attendance-table tfoot td { border-bottom: 0; background: #f0f7f3; color: var(--green-dark); font-weight: 820; }
.table-empty { height: 125px; color: var(--muted) !important; text-align: center !important; vertical-align: middle !important; }
.print-title, .report-signatures { display: none; }
.toast { position: fixed; right: 23px; bottom: 23px; z-index: 100; padding: 11px 15px 11px 11px; display: flex; align-items: center; gap: 9px; border: 1px solid #d6e7de; border-radius: 12px; background: #fff; color: #315543; box-shadow: 0 16px 46px rgba(18,39,30,.16); animation: toast-in 180ms ease-out; }
.toast > span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-size: 10px; }
.toast strong { font-size: 11px; }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1120px) {
  .admin-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .report-toolbar { align-items: flex-start; flex-direction: column; }
  .report-actions { width: 100%; flex-wrap: wrap; }
}

@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { justify-content: space-between; }
  .mobile-brand { display: flex; }
  .mobile-brand .brand-mark { width: 30px; height: 30px; font-size: 15px; }
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-visual { display: none; }
  .login-panel { min-height: 560px; }
}

@media (max-width: 700px) {
  .app-body { padding-bottom: calc(75px + env(safe-area-inset-bottom)); }
  .topbar { height: 60px; padding: 0 15px; }
  .secure-badge, #change-password-open { display: none; }
  .topbar-actions { gap: 10px; }
  .content-wrap, .admin-content { padding: 27px 15px 34px; }
  .welcome-row, .admin-heading { align-items: stretch; flex-direction: column; }
  .welcome-row > .primary-button, .admin-heading > .primary-button { min-height: 50px; }
  h1 { font-size: 29px; }
  .summary-grid { margin-top: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .summary-card { min-height: 126px; padding: 16px 14px; }
  .summary-card:last-child { grid-column: 1 / -1; min-height: 110px; }
  .summary-card > strong { font-size: 25px; }
  .calendar-card { margin-top: 12px; }
  .calendar-toolbar { min-height: auto; padding: 15px; align-items: flex-start; flex-direction: column; }
  .calendar-actions { width: 100%; }
  .year-picker { margin-right: auto; }
  .year-picker select, .outline-button, .today-button { height: 44px; min-height: 44px; }
  .outline-button { width: 44px; }
  .weekday-row, .calendar-grid, .empty-state { display: none; }
  .mobile-agenda-list { display: block; }
  .mobile-day { border-bottom: 1px solid var(--line); background: #fff; }
  .mobile-day:last-child { border-bottom: 0; }
  .mobile-day.today { background: #f5faf7; }
  .mobile-day-heading { width: 100%; min-height: 57px; padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 11px; border: 0; background: transparent; color: var(--ink); text-align: left; }
  .mobile-date { display: flex; align-items: baseline; gap: 8px; }
  .mobile-date strong { min-width: 24px; font-size: 18px; letter-spacing: -.03em; }
  .mobile-date span { color: #69746e; font-size: 11px; font-weight: 680; text-transform: capitalize; }
  .mobile-day.today .mobile-date strong, .mobile-day.today .mobile-date span { color: var(--green-dark); }
  .mobile-add { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; background: var(--green-soft); color: var(--green); font-size: 18px; }
  .mobile-day-entries { padding: 0 11px 11px; display: grid; gap: 7px; }
  .mobile-entry { width: 100%; min-height: 59px; padding: 10px 11px; display: flex; align-items: center; justify-content: space-between; gap: 11px; border: 0; border-left: 4px solid; border-radius: 9px; color: var(--ink); text-align: left; }
  .mobile-entry > span { min-width: 0; display: grid; gap: 3px; }
  .mobile-entry strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-entry small { color: #68736d; font-size: 9px; }
  .mobile-entry b { flex: 0 0 auto; font-size: 11px; }
  .mobile-empty-day { width: calc(100% - 22px); min-height: 42px; margin: 0 11px 11px; padding: 0 11px; border: 1px dashed #d8ded9; border-radius: 9px; background: #fafbfa; color: #909994; font-size: 10px; text-align: left; }
  .mobile-bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 40; min-height: calc(66px + env(safe-area-inset-bottom)); padding: 7px 11px calc(7px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; gap: 7px; border-top: 1px solid rgba(220,226,221,.92); background: rgba(255,255,255,.94); box-shadow: 0 -10px 35px rgba(19,38,29,.08); backdrop-filter: blur(16px); }
  .mobile-bottom-nav > button { min-height: 48px; padding: 4px 7px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; border: 0; border-radius: 11px; background: transparent; color: #78827d; font-size: 9px; font-weight: 720; }
  .mobile-bottom-nav > button > span { font-size: 17px; line-height: 1; }
  .mobile-bottom-nav > button.active { color: var(--green); }
  .mobile-bottom-nav .mobile-primary-action { background: var(--green); color: #fff; box-shadow: 0 8px 19px rgba(23,107,82,.22); }
  .entry-dialog, .small-dialog { width: 100%; max-width: none; max-height: calc(100dvh - 6px); margin: auto 0 0; }
  .dialog-card { max-height: calc(100dvh - 6px); overflow-y: auto; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .dialog-header { position: sticky; top: 0; z-index: 2; padding: 18px 17px 14px; background: #fff; }
  .close-button { width: 44px; height: 44px; }
  .dialog-body { max-height: none; padding: 17px; overflow: visible; }
  .entry-form-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: 1; }
  .bulk-date-grid { grid-template-columns: 1fr; }
  .field input, .field select, .field textarea { min-height: 48px; font-size: 16px; }
  .check-field { min-height: 44px; font-size: 12px; }
  .dialog-footer { padding: 14px 17px calc(17px + env(safe-area-inset-bottom)); align-items: stretch; flex-direction: column-reverse; }
  .dialog-footer > div { display: grid; grid-template-columns: 1fr 1.25fr; }
  .dialog-footer .primary-button, .dialog-footer .cancel-button, .dialog-footer .danger-button, .dialog-footer .copy-button { min-height: 48px; }
  .toast { right: 11px; bottom: calc(78px + env(safe-area-inset-bottom)); left: 11px; }
  .admin-layout { grid-template-columns: 1fr; }
  .employee-directory { position: static; }
  .employee-list { max-height: 235px; }
  .report-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .report-actions select, .outline-action, .print-button { width: 100%; height: 44px; }
  .login-body { padding: 12px; }
  .login-shell { border-radius: 22px; }
  .login-panel { min-height: calc(100dvh - 24px); padding: 38px 24px; justify-content: flex-start; }
  .login-brand { margin-bottom: 56px; }
  .login-panel h1 { font-size: 34px; }
  .login-form .field input { font-size: 16px; }
  .setup-card { padding: 30px 23px; border-radius: 20px; }
}

@media print {
  @page { size: A4 landscape; margin: 11mm; }
  html, body { background: #fff !important; }
  .sidebar, .topbar, .admin-heading, .employee-directory, .report-toolbar, .page-alert, .toast, .mobile-bottom-nav, dialog { display: none !important; }
  #mine-view { display: none !important; }
  #admin-view { display: block !important; }
  .app-layout, .admin-layout { display: block; }
  .admin-content { width: 100%; padding: 0; }
  .admin-report { overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
  .print-title { margin-bottom: 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
  .print-title > div { display: grid; gap: 4px; }
  .print-title strong { font-size: 18pt; }
  .print-title span { color: #45514b; font-size: 9pt; }
  .table-wrap { overflow: visible; }
  .attendance-table { min-width: 0; font-size: 7.5pt; }
  .attendance-table th, .attendance-table td { padding: 7px 6px; border-color: #cfd5d0; }
  .attendance-table th { font-size: 6.5pt; }
  .attendance-table thead { display: table-header-group; }
  .attendance-table tr { break-inside: avoid; }
  .report-signatures { margin-top: 30px; display: flex; justify-content: space-between; gap: 80px; }
  .report-signatures span { min-width: 210px; padding-top: 7px; border-top: 1px solid #66716b; color: #66716b; font-size: 8pt; text-align: center; }
}

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