:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef3f0;
  --ink: #1d2528;
  --muted: #617074;
  --line: #dce3df;
  --teal: #11736f;
  --teal-2: #0f5d5a;
  --mint: #dff1ea;
  --brand-red: #e60012;
  --brand-red-2: #b8000d;
  --brand-gray: #5e6161;
  --amber: #b46b18;
  --amber-soft: #fff1da;
  --coral: #bf4b3b;
  --coral-soft: #ffe6e1;
  --violet: #5f5a99;
  --blue: #336b87;
  --green: #2d7a46;
  --shadow: 0 14px 34px rgba(29, 37, 40, 0.12);
  --radius: 8px;
  --sidebar: 260px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
}

.app-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(0deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.68)),
    repeating-linear-gradient(90deg, #f6f7f4 0, #f6f7f4 22px, #edf2ee 22px, #edf2ee 23px);
}

.boot-card {
  width: min(360px, calc(100vw - 32px));
  min-height: 180px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.boot-card span {
  color: var(--muted);
  font-size: 14px;
}

.boot-mark,
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  font-weight: 800;
}

.logo-mark {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.menu-toggle {
  padding: 0;
}

body[data-theme="hidro"] {
  --teal: var(--brand-red);
  --teal-2: var(--brand-red-2);
  --mint: #ffe5e7;
  --blue: var(--brand-gray);
}

body[data-theme="verde"] {
  --teal: #11736f;
  --teal-2: #0f5d5a;
  --mint: #dff1ea;
}

body[data-theme="azul"] {
  --teal: #255f85;
  --teal-2: #164462;
  --mint: #e0eef6;
}

body[data-theme="alto contraste"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #000000;
  --muted: #222222;
  --line: #111111;
  --teal: #000000;
  --teal-2: #000000;
  --mint: #f1f1f1;
}

body[data-density="compact"] .content {
  padding: 14px;
}

body[data-density="compact"] .panel,
body[data-density="compact"] .metric-card {
  padding: 12px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
  background:
    linear-gradient(0deg, rgba(246, 247, 244, 0.86), rgba(246, 247, 244, 0.86)),
    repeating-linear-gradient(135deg, #e8eee9 0, #e8eee9 1px, transparent 1px, transparent 18px);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 44px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.login-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
}

.login-copy h1 {
  max-width: 760px;
  margin: 0 0 16px;
  font-size: 44px;
  line-height: 1.04;
}

.login-copy p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.login-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 32px;
  max-width: 800px;
}

.login-strip > div,
.metric-card,
.panel,
.list-card,
.stat-row,
.doc-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.login-strip > div {
  min-height: 104px;
  padding: 18px;
}

.login-strip strong {
  display: block;
  font-size: 24px;
  margin-bottom: 4px;
}

.login-strip span {
  color: var(--muted);
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form h2 {
  margin: 0;
  font-size: 25px;
}

.login-form p {
  margin: -4px 0 4px;
  color: var(--muted);
  line-height: 1.45;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  min-height: 42px;
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfd9d4;
  border-radius: var(--radius);
  outline: none;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(17, 115, 111, 0.14);
}

.password-field {
  gap: 7px;
}

.password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.password-control input {
  min-width: 0;
}

.remember-row {
  min-height: 28px;
  align-items: center;
}

.hint {
  color: var(--muted);
  font-size: 12px;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

body.sidebar-collapsed .layout {
  grid-template-columns: 78px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 18px;
  background: #fbfcfa;
  border-right: 1px solid var(--line);
  transition: width 180ms ease, padding 180ms ease, transform 180ms ease;
}

.sidebar-tab {
  position: absolute;
  top: 84px;
  right: -17px;
  z-index: 5;
  width: 34px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--teal-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: 0 8px 18px rgba(29, 37, 40, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  flex: 0 0 auto;
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-text strong {
  font-size: 16px;
}

.brand-text span {
  color: var(--muted);
  font-size: 12px;
}

body.sidebar-collapsed .sidebar {
  gap: 16px;
  padding: 18px 12px;
}

body.sidebar-collapsed .brand {
  justify-content: center;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-footer {
  display: none;
}

body.sidebar-collapsed .nav {
  padding-right: 0;
}

body.sidebar-collapsed .nav button {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 48px;
  padding: 8px;
}

body.sidebar-collapsed .nav .badge {
  position: absolute;
  right: 3px;
  top: 3px;
  min-width: 18px;
  padding: 2px 5px;
  font-size: 10px;
}

.nav {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.nav button {
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-align: left;
}

.nav button:hover {
  background: var(--surface-2);
}

.nav button.active {
  color: var(--teal-2);
  background: var(--mint);
  border-color: #bee0d5;
  font-weight: 750;
}

.nav .ico {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(29, 37, 40, 0.06);
  font-weight: 800;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  flex: 0 0 auto;
}

.sidebar-footer .security-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  background: rgba(246, 247, 244, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.topbar small {
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.work-month {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.work-month input {
  width: 132px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 800;
}

.content {
  min-width: 0;
  padding: 24px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric-card {
  min-height: 126px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 16px;
}

.metric-card.interactive,
.clickable-row,
.clickable-stat,
.linklike {
  cursor: pointer;
}

.metric-card.interactive:hover,
.clickable-row:hover,
.clickable-stat:hover {
  border-color: #9bcfc3;
  box-shadow: 0 10px 24px rgba(24, 63, 57, 0.08);
}

.clickable-stat {
  width: 100%;
  color: inherit;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.linklike {
  padding: 0;
  color: var(--teal-2);
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
}

.linklike.strong {
  font-weight: 850;
}

.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.dashboard-title {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.dashboard-title img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
}

.dashboard-title h2 {
  margin: 0;
  font-size: 22px;
}

.dashboard-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.chart-panel .bars {
  gap: 12px;
}

.dashboard-chart-row {
  grid-template-columns: minmax(120px, 0.85fr) minmax(140px, 1fr) auto;
}

.dashboard-chart-row small {
  grid-column: 1 / -1;
}

.audit-toolbar select,
.audit-toolbar input[type="date"] {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cfd9d4;
  border-radius: var(--radius);
  background: #fff;
}

.audit-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card span,
.panel-muted,
.muted {
  color: var(--muted);
}

.metric-value {
  font-size: 30px;
  font-weight: 820;
}

.metric-chip,
.badge,
.status,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.metric-chip {
  background: var(--surface-2);
}

.badge {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}

.badge.teal,
.status.ok {
  background: var(--mint);
  color: var(--teal-2);
  border-color: #b7ded4;
}

.badge.amber,
.status.warn {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: #f1d2a9;
}

.badge.coral,
.status.danger {
  background: var(--coral-soft);
  color: var(--coral);
  border-color: #f5c4bc;
}

.badge.violet {
  background: #eceafe;
  color: var(--violet);
  border-color: #d9d5fb;
}

.badge.blue {
  background: #e4f0f5;
  color: var(--blue);
  border-color: #c9e0ea;
}

.panel {
  padding: 18px;
}

.panel-header {
  min-height: 38px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-header h2,
.section-title {
  margin: 0;
  font-size: 17px;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.search {
  min-width: 240px;
  flex: 1;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f8faf8;
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

tr.clickable:hover {
  background: #f8fbf9;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}

.avatar.alt-1 {
  background: var(--amber);
}

.avatar.alt-2 {
  background: var(--violet);
}

.avatar.alt-3 {
  background: var(--blue);
}

.person-cell strong {
  display: block;
}

.person-cell small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #cbd6d0;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 750;
}

.btn:hover {
  background: #f1f5f2;
}

.btn.primary {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.btn.primary:hover {
  background: var(--teal-2);
}

.btn.danger {
  color: var(--coral);
  border-color: #ebb9b0;
  background: var(--coral-soft);
}

.btn.ghost {
  background: transparent;
}

.btn.icon {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.segmented button {
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  color: var(--teal-2);
  background: var(--mint);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(29, 37, 40, 0.46);
}

.modal {
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal.sm {
  width: min(560px, calc(100vw - 28px));
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 19px;
}

.modal-body {
  padding: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px;
  border-top: 1px solid var(--line);
  background: #fbfcfa;
}

.empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  padding: 26px;
  color: var(--muted);
  border: 1px dashed #c8d3ce;
  border-radius: var(--radius);
  background: #fbfcfa;
  text-align: center;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.detail-panel {
  position: sticky;
  top: 92px;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-head h2 {
  margin: 0;
  font-size: 18px;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-list span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 750;
}

.stat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  margin-bottom: 10px;
  min-width: 0;
}

.stat-row strong {
  font-size: 16px;
  white-space: nowrap;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(94px, 120px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.timeline-item strong {
  display: block;
}

.timeline-item > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.timeline-item small {
  color: var(--muted);
}

.progress {
  height: 10px;
  overflow: hidden;
  background: #e3ebe6;
  border-radius: 999px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--green));
}

.bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 84px;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 12px;
  background: #e6ece8;
  border-radius: 999px;
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.bar-track.amber span {
  background: var(--amber);
}

.bar-track.coral span {
  background: var(--coral);
}

.finance-total {
  display: grid;
  gap: 10px;
  padding: 16px;
  color: #fff;
  background: #263639;
  border-radius: var(--radius);
}

.finance-total strong {
  font-size: 28px;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.doc-tile {
  min-height: 128px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.doc-tile strong {
  overflow-wrap: anywhere;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  padding: 10px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--ink);
  font-size: 13px;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: grid;
  gap: 10px;
}

.toast {
  width: min(360px, calc(100vw - 28px));
  padding: 12px 14px;
  color: #fff;
  background: #263639;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--coral);
}

.toast.ok {
  background: var(--teal);
}

.mobile-menu {
  display: none;
}

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

@media (max-width: 1120px) {
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.cols-3,
  .grid.cols-2,
  .split {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  :root {
    --sidebar: 1fr;
  }

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-copy {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    border-right: 0;
    padding: 28px;
  }

  .layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(310px, calc(100vw - 42px));
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
  }

  .topbar {
    padding: 12px;
    align-items: flex-start;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .content {
    padding: 14px;
  }

  .grid.cols-4,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 10px;
  }
}

@media (max-width: 760px) {
  body {
    min-width: 0;
  }

  .topbar {
    position: sticky;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
  }

  .topbar > div:not(.top-actions) {
    min-width: 0;
  }

  .top-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: stretch;
  }

  .top-actions .badge,
  .top-actions .btn {
    min-height: 38px;
  }

  .work-month {
    width: 100%;
    justify-content: space-between;
  }

  .work-month input {
    width: 150px;
    font-size: 16px;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar input,
  .toolbar select,
  .toolbar .btn,
  .search {
    width: 100%;
    min-width: 0;
  }

  .metric-card {
    min-height: 104px;
  }

  .table-wrap {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 760px;
  }

  th,
  td {
    padding: 10px;
  }

  .person-cell {
    min-width: 240px;
  }

  .sidebar {
    overflow: hidden;
  }

  .nav {
    overflow-y: auto;
    max-height: calc(100vh - 150px);
  }

  .sidebar-footer {
    display: none;
  }

  .modal {
    width: min(100%, calc(100vw - 18px));
    max-height: calc(100vh - 18px);
  }

  .modal-body {
    max-height: calc(100vh - 150px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal-actions .btn {
    width: 100%;
    min-height: 44px;
  }
}
