:root {
  --background: 210 40% 98%;
  --foreground: 222.2 47.4% 11.2%;
  --card: 0 0% 100%;
  --primary: 239 70% 50%;
  --primary-foreground: 0 0% 100%;
  --primary-soft: 226 100% 97%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 226 100% 97%;
  --accent-foreground: 243 75% 59%;
  --destructive: 0 72% 42%;
  --success: 160 75% 28%;
  --warning: 32 90% 30%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 239 70% 50%;

  --radius: 0.5rem;
  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui,
          -apple-system, "Helvetica Neue", Arial, sans-serif;

  --shadow-sm: 0 1px 2px 0 hsl(222 47% 11% / .06);
  --shadow: 0 1px 3px 0 hsl(222 47% 11% / .08), 0 1px 2px -1px hsl(222 47% 11% / .06);
  --shadow-md: 0 8px 24px -6px hsl(222 47% 11% / .14);

  --gap: 16px;
  --page: 1440px;
}

.dark {
  --background: 229 47% 8%;
  --foreground: 210 40% 96%;
  --card: 222 40% 12%;
  --primary: 234 89% 74%;
  --primary-foreground: 229 47% 10%;
  --primary-soft: 232 40% 20%;
  --muted: 217.2 32.6% 18%;
  --muted-foreground: 215 20.2% 68%;
  --accent: 232 40% 22%;
  --accent-foreground: 234 89% 80%;
  --destructive: 0 72% 61%;
  --success: 160 70% 48%;
  --warning: 38 92% 58%;
  --border: 217.2 32.6% 22%;
  --input: 217.2 32.6% 24%;
  --ring: 234 89% 74%;
  --shadow-md: 0 8px 24px -6px hsl(229 47% 3% / .5);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -.005em;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:hover { color: hsl(var(--accent-foreground)); }

main {
  max-width: var(--page);
  margin: 0 auto;
  padding: 24px 32px 64px;
}
main.wide-main { max-width: none; padding-left: 16px; padding-right: 16px; }
main.centered {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}

:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
  border-radius: calc(var(--radius) - 2px);
}

svg { width: 16px; height: 16px; flex: none; }

.top {
  display: flex; align-items: center; gap: 8px 24px; flex-wrap: wrap;
  padding: 10px 32px;
  background: hsl(var(--card));
  border-bottom: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-sm);
}

.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 650; text-decoration: none; letter-spacing: -.02em;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(140deg, hsl(var(--primary)), hsl(var(--primary) / .6));
}
.brand-mark.big { width: 40px; height: 40px; border-radius: 11px; }

.mainnav { display: flex; gap: 2px; flex-wrap: wrap; margin-right: auto; }
.mainnav a {
  display: inline-flex; align-items: center; min-height: 40px;
  padding: 6px 12px; border-radius: var(--radius);
  text-decoration: none; color: hsl(var(--muted-foreground));
  font-weight: 500; white-space: nowrap;
}
.mainnav a:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.mainnav a.on { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }

.topright { display: flex; align-items: center; gap: 4px; }
.who {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 4px 10px; border-radius: var(--radius); text-decoration: none;
}
.who:hover { background: hsl(var(--muted)); }
.who-name { font-weight: 500; }
.inline-form { display: inline; }

h1 { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 17px; font-weight: 620; letter-spacing: -.01em; margin: 32px 0 12px; }
p  { margin: 4px 0; }

.muted { color: hsl(var(--muted-foreground)); font-size: 14px; }
.muted a { color: hsl(var(--accent-foreground)); }
.hint-line { margin-top: 12px; max-width: 70ch; }
.quiet-link { text-decoration: none; }
.quiet-link:hover { text-decoration: underline; }
.mt { margin-top: 12px; }

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--gap); flex-wrap: wrap; margin-bottom: 20px;
}
.page-header.sub { margin: 20px 0 12px; align-items: center; }
.page-header.sub h2 { margin: 0; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius);
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font: inherit; font-size: 14px; font-weight: 500; line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, opacity .12s ease;
}
button:hover, .btn:hover { background: hsl(var(--primary) / .9); color: hsl(var(--primary-foreground)); }
button:disabled { opacity: .5; cursor: not-allowed; }
body.save-in-progress { cursor: progress; }
body.save-in-progress a,
body.save-in-progress button,
body.save-in-progress input,
body.save-in-progress select,
body.save-in-progress textarea { pointer-events: none; }

.btn-outline {
  background: hsl(var(--card)); color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.btn-outline:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }

.btn-ghost { background: transparent; color: hsl(var(--muted-foreground)); }
.btn-ghost:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }

.btn-icon { width: 40px; padding: 0; font-size: 16px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.wide { width: 100%; }

.btn-link {
  min-height: 28px; padding: 2px 4px; background: none; border: none;
  color: hsl(var(--accent-foreground)); font-size: 13px; font-weight: 500;
  text-decoration: none; cursor: pointer;
}
.btn-link:hover { background: none; color: hsl(var(--accent-foreground)); text-decoration: underline; }

.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field { margin-top: 14px; }
.row .field + .field, .bar .field + .field, .shift-amounts .field + .field { margin-top: 0; }

label {
  font-size: 13px; font-weight: 500; letter-spacing: -.005em;
  color: hsl(var(--foreground));
}
label.spacer { visibility: hidden; }

input, select, textarea {
  height: 40px; padding: 0 12px; width: 100%;
  background: hsl(var(--card)); color: hsl(var(--foreground));
  border: 1px solid hsl(var(--input)); border-radius: var(--radius);
  font: inherit; font-size: 14px;
}
input:hover, select:hover { border-color: hsl(var(--primary) / .5); }
input::placeholder { color: hsl(var(--muted-foreground) / .8); }
input[type="month"], input[type="date"] { min-width: 150px; }
input[type="number"] { -moz-appearance: textfield; }

.hint { font-size: 12px; color: hsl(var(--muted-foreground)); margin: 0; min-height: 1em; }
.hint.warn { color: hsl(var(--warning)); }

.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.row > .field { flex: 1 1 160px; }
.row > .field.grow  { flex: 2 1 200px; }
.row > .field.grow2 { flex: 3 1 260px; }

.bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start;
  margin: 16px 0;
}
.bar .field { flex: 0 1 auto; }
.bar .field.grow { flex: 1 1 240px; max-width: 420px; }

.month-nav {
  display: inline-flex; align-items: center; gap: 6px;
  flex: none; flex-wrap: nowrap; white-space: nowrap;
}
.month-nav > * { flex: none; }
.month-form { display: inline-flex; flex: none; margin: 0; }
.month-form input[type="month"] { width: 150px; flex: none; }
.month-selects { display: inline-flex; gap: 6px; }
.month-selects select:first-child { min-width: 132px; }
.month-selects select:last-child { width: 92px; }
.month-title {
  min-width: 116px; text-align: center; font-size: 16px; font-weight: 600;
  letter-spacing: -.01em; color: hsl(var(--foreground)); text-decoration: none;
}
a.month-title:hover { color: hsl(var(--accent-foreground)); text-decoration: underline; }

.search { position: relative; }
.search svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: hsl(var(--muted-foreground)); pointer-events: none;
}
.search input { padding-left: 34px; }

.date-input { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

.inline-edit { display: flex; gap: 6px; align-items: center; }
.inline-edit input { min-width: 120px; }
.inline-edit select { min-width: 140px; }

.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--gap);
}
.card.narrow { max-width: 480px; }
.card > strong { display: block; font-weight: 620; letter-spacing: -.01em; }
.card hr { border: none; border-top: 1px solid hsl(var(--border)); margin: 18px 0; }

.accent-card { border-color: hsl(var(--primary) / .35); background: hsl(var(--accent) / .55); }

.empty { text-align: center; color: hsl(var(--muted-foreground)); padding: 32px 20px; }
.empty .btn { margin-top: 12px; }

.note {
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: var(--gap);
  font-size: 14px; border: 1px solid;
}
.note-warning {
  border-color: hsl(var(--warning) / .4);
  background: hsl(var(--warning) / .12);
}

.flash {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--gap);
}
.flash-item {
  padding: 10px 16px; border-radius: var(--radius); font-size: 14px;
  background: hsl(var(--accent)); color: hsl(var(--accent-foreground));
  border: 1px solid hsl(var(--primary) / .25);
}

.totals {
  display: grid; gap: 12px; margin-bottom: 20px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.total-item {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-left: 3px solid hsl(var(--muted-foreground) / .4);
  border-radius: calc(var(--radius) + 2px); padding: 12px 16px;
}
.total-item .k { font-size: 13px; color: hsl(var(--muted-foreground)); }
.total-item .v { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.total-link {
  font-size: 12px; color: hsl(var(--muted-foreground));
  text-decoration: none;
}
.total-link:hover { color: hsl(var(--accent-foreground)); }
.tone-indigo  { border-left-color: hsl(var(--primary)); }
.tone-emerald { border-left-color: hsl(var(--success)); }
.tone-amber   { border-left-color: hsl(var(--warning)); }
.tone-slate   { border-left-color: hsl(var(--muted-foreground)); }

.tabs {
  display: inline-flex; flex-wrap: wrap; gap: 2px; margin-bottom: 16px;
  padding: 3px; border-radius: var(--radius); background: hsl(var(--muted));
}
.tab {
  padding: 5px 14px; border-radius: calc(var(--radius) - 2px);
  font-size: 14px; font-weight: 500; text-decoration: none;
  color: hsl(var(--muted-foreground)); white-space: nowrap;
}
.tab:hover { color: hsl(var(--foreground)); }
.tab.on {
  background: hsl(var(--card)); color: hsl(var(--foreground));
  box-shadow: var(--shadow-sm);
}
.main-tabs { margin-bottom: 20px; }

.scroll {
  overflow-x: auto; overflow-y: visible;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  background: hsl(var(--card));
  -webkit-overflow-scrolling: touch;
}
.grid-scroll { max-height: calc(100vh - 300px); overflow-y: auto; }
.grid-top-scroll {
  overflow-x: auto; overflow-y: hidden; height: 15px; margin: 0 0 4px;
  border: 1px solid hsl(var(--border)); border-radius: 6px;
  background: hsl(var(--card));
}
.grid-top-scroll > div { height: 1px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: hsl(var(--card));
  text-align: left; font-weight: 550; font-size: 12.5px;
  letter-spacing: .01em; color: hsl(var(--muted-foreground));
  padding: 10px 12px; white-space: nowrap;
  border-bottom: 1px solid hsl(var(--border));
}
tbody td { padding: 9px 12px; border-bottom: 1px solid hsl(var(--border) / .7); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: hsl(var(--muted) / .5); }
tfoot td {
  padding: 10px 12px; font-weight: 600;
  border-top: 1px solid hsl(var(--border)); background: hsl(var(--muted) / .4);
}

/* Единое выравнивание: первый столбец влево, последний вправо, остальные по центру. */
table tr > :first-child { text-align: left; }
table tr > :not(:first-child):not(:last-child) { text-align: center; }
table tr > :last-child { text-align: right; }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.act { width: 1%; white-space: nowrap; }
.pos  { color: hsl(var(--foreground)); font-weight: 600; }
.neg  { color: hsl(var(--success)); font-weight: 600; }
.zero { color: hsl(var(--muted-foreground)); }
.removed { color: hsl(var(--muted-foreground)); background: hsl(var(--muted) / .35); }
.removed td:first-child { text-decoration: line-through; }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 550; white-space: nowrap;
  border: 1px solid transparent;
}
.badge-indigo  { background: hsl(var(--primary) / .14);  color: hsl(var(--accent-foreground)); border-color: hsl(var(--primary) / .25); }
.badge-emerald { background: hsl(var(--success) / .14);  color: hsl(var(--success));           border-color: hsl(var(--success) / .3); }
.badge-amber   { background: hsl(var(--warning) / .16);  color: hsl(var(--warning));            border-color: hsl(var(--warning) / .35); }
.badge-rose    { background: hsl(var(--destructive) / .13); color: hsl(var(--destructive));    border-color: hsl(var(--destructive) / .3); }
.badge-slate   { background: hsl(var(--muted));          color: hsl(var(--muted-foreground));  border-color: hsl(var(--border)); }
.dark .badge-amber { color: hsl(38 92% 68%); }

.grid { font-size: 13px; }
.grid th.name, .grid td.name {
  position: sticky; left: 0; z-index: 1;
  background: hsl(var(--card));
  min-width: 160px; max-width: 210px;
  border-right: 1px solid hsl(var(--border));
}
.grid thead th.name { z-index: 3; }
.grid td.name a { text-decoration: none; font-weight: 500; }
.grid td.name a:hover { text-decoration: underline; }
.cat-mark {
  display: block; font-size: 11px; color: hsl(var(--muted-foreground)); line-height: 1.3;
}

.grid th.day {
  min-width: 34px; padding: 6px 2px; text-align: center;
}
.grid th.day .dnum { display: block; font-weight: 600; color: hsl(var(--foreground)); }
.grid th.day .dow  { display: block; font-size: 10.5px; text-transform: lowercase; }

.grid td.day { padding: 0; text-align: center; }
.grid td.day a {
  display: block; padding: 8px 2px; min-height: 34px; font-size: 11.5px;
  text-decoration: none; font-variant-numeric: tabular-nums;
  color: hsl(var(--muted-foreground));
}
.grid td.day a:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.grid td.filled a { color: hsl(var(--foreground)); font-weight: 550; }
.grid td.amount-low a  { background: hsl(48 96% 82%); color: hsl(38 75% 25%); }
.grid td.amount-mid a  { background: hsl(28 94% 78%); color: hsl(22 78% 28%); }
.grid td.amount-high a { background: hsl(0 88% 80%); color: hsl(0 72% 32%); }
.dark .grid td.amount-low a  { background: hsl(48 65% 27%); color: hsl(48 90% 88%); }
.dark .grid td.amount-mid a  { background: hsl(28 68% 29%); color: hsl(28 92% 88%); }
.dark .grid td.amount-high a { background: hsl(0 62% 30%); color: hsl(0 90% 90%); }
.grid .we { background: hsl(var(--muted) / .55); }
.grid .now { box-shadow: inset 0 0 0 1px hsl(var(--primary) / .45); }
.grid th.now .dnum { color: hsl(var(--accent-foreground)); }
.grid .total-col {
  position: sticky; right: 0; z-index: 1;
  background: hsl(var(--card)); font-weight: 600;
  border-left: 1px solid hsl(var(--border)); min-width: 78px;
}
.grid thead .total-col { z-index: 3; }
.grid tfoot td {
  position: sticky; bottom: 0; z-index: 2;
  background: hsl(var(--muted)); white-space: nowrap;
  border-top: 2px solid hsl(var(--border));
  box-shadow: 0 -2px 5px hsl(var(--foreground) / .06);
}
.grid tfoot td.name, .grid tfoot td.total-col {
  background: hsl(var(--muted)); z-index: 3;
}

.field.amount { max-width: 260px; }
.shift-amounts { display: flex; flex-wrap: wrap; gap: 12px; }
.shift-amounts .field { flex: 1 1 210px; max-width: 260px; }
.rows { display: flex; flex-direction: column; gap: 8px; }
.project-row {
  display: grid; gap: 8px; align-items: center;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.2fr) 132px 132px 36px;
}
.project-combobox { position: relative; min-width: 0; }
.project-combobox:focus-within { z-index: 5; }
.project-suggestions {
  position: absolute; z-index: 10; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 320px; max-height: min(320px, 45vh);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 4px; background: hsl(var(--card));
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.project-suggestions[hidden] { display: none; }
.project-suggestion {
  display: block; width: 100%; min-height: 42px; padding: 9px 10px;
  border: 0; border-radius: calc(var(--radius) - 2px);
  background: transparent; color: hsl(var(--foreground));
  font-weight: 400; line-height: 1.35; text-align: left;
}
.project-suggestion:hover,
.project-suggestion[aria-selected="true"] {
  background: hsl(var(--accent)); color: hsl(var(--accent-foreground));
}
.project-suggestion-empty {
  padding: 10px; color: hsl(var(--muted-foreground));
  font-size: 13px; line-height: 1.4;
}
.event-picker { display: flex; gap: 6px; min-width: 0; }
.event-picker select { min-width: 0; flex: 1 1 auto; }
.event-picker .event-target-year { width: 96px; flex: none; }
.event-picker .event-target-year[hidden] { display: none; }
.add-row { align-self: flex-start; margin-top: 4px; }

.summary {
  margin-top: 16px; padding: 12px 16px; border-radius: var(--radius);
  background: hsl(var(--muted)); color: hsl(var(--muted-foreground));
  font-size: 14px; font-variant-numeric: tabular-nums;
}
.summary.ready {
  background: hsl(var(--primary) / .12); color: hsl(var(--accent-foreground));
  font-weight: 550;
}

.history { margin-top: 24px; }
.history summary {
  cursor: pointer; font-size: 14px; font-weight: 500;
  color: hsl(var(--muted-foreground)); padding: 6px 0;
}
.history summary:hover { color: hsl(var(--foreground)); }
.history-version {
  margin-top: 12px; padding: 14px 16px; border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px); background: hsl(var(--card));
}
.history-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.history-changes { margin: 8px 0 0; padding-left: 20px; font-size: 14px; }
.history-changes li + li { margin-top: 3px; }
.project-name-form { min-width: 240px; }
.project-name-view { font-weight: 500; }
.project-name-input { flex: 1 1 180px; }
.project-name-form .btn-icon { width: 40px; height: 40px; }
.project-title-form h1 { margin: 0; }
.project-title-form .project-name-input { min-width: 280px; font-size: 20px; font-weight: 650; }
.project-create {
  padding: 14px 16px; border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px); background: hsl(var(--card));
}
.section-block { margin-top: 28px; }
.section-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.section-head p { margin: 4px 0 0; }
.exhibition-edit { margin-top: 16px; padding-top: 16px; border-top: 1px solid hsl(var(--border)); }
.event-management { margin-top: 12px; }
.mt0 { margin-top: 0; }
.employee-summary-grid {
  display: grid; gap: 12px 24px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.employee-comment { min-width: min(100%, 280px); }
.employee-comment-controls { display: flex; gap: 8px; margin-top: 6px; }
.employee-comment-controls input { min-width: 160px; }
details.card > summary { cursor: pointer; list-style-position: outside; }
td details pre {
  max-width: 520px; max-height: 280px; overflow: auto; white-space: pre-wrap;
  text-align: left; font-size: 12px;
}

.auth-card {
  width: 100%; max-width: 380px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: 14px; padding: 32px; box-shadow: var(--shadow-md);
}
.signed-out main.centered > .flash {
  position: fixed; z-index: 20; top: 24px; left: 50%;
  width: min(380px, calc(100% - 48px)); margin: 0;
  transform: translateX(-50%);
}
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head .brand-mark { display: inline-block; margin-bottom: 12px; }
.auth-head h1 { font-size: 20px; }
.auth-card button { margin-top: 20px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 12.5px; }

.roles-legend {
  display: grid; gap: 6px; margin: 0 0 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.role-item { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }

.error-card { max-width: 520px; margin: 48px auto; }
.error-code {
  font-size: 40px; font-weight: 700; letter-spacing: -.03em;
  color: hsl(var(--muted-foreground) / .4); line-height: 1;
}

@media (max-width: 900px) {
  main { padding: 20px 16px 56px; }
  .top { padding: 10px 16px; gap: 8px 12px; }
  .mainnav { order: 3; width: 100%; margin-right: 0; }
  .mainnav a { min-height: 44px; padding: 6px 10px; font-size: 14px; }
  .topright { margin-left: auto; }
  .who-name { display: none; }
  h1 { font-size: 21px; }
  .totals { grid-template-columns: 1fr 1fr; }
  .grid-scroll { max-height: none; }
}

@media (max-width: 620px) {
  button, .btn, input, select { min-height: 44px; }
  .btn-icon { width: 44px; }
  .btn-link, .btn-sm { min-height: 44px; }
  .who { min-height: 44px; }
  .project-name-form .btn-icon { width: 44px; height: 44px; }
  .month-nav { max-width: 100%; overflow-x: auto; padding: 2px; }
  .grid td.day a { min-height: 44px; padding-top: 12px; }
  .totals { grid-template-columns: 1fr; }
  .page-header { align-items: flex-start; }
  .field.amount { max-width: none; }
  .project-row {
    grid-template-columns: 1fr 1fr 36px;
    padding: 10px; border: 1px solid hsl(var(--border));
    border-radius: var(--radius); background: hsl(var(--background));
  }
  .project-row .project-combobox { grid-column: 1 / -1; }
  .project-row .event-picker { grid-column: 1 / -1; }
  .row > .field, .row > .field.grow, .row > .field.grow2 { flex: 1 1 100%; }
  .bar .field, .bar .field.grow { flex: 1 1 100%; max-width: none; }
  .card { padding: 16px; }
  .auth-card { padding: 24px; }
  .grid th.name, .grid td.name { min-width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .top, .tabs, .actions-row, .act, .flash, .bar { display: none; }
  .scroll { overflow: visible; border: none; }
  body { background: #fff; }
}
