/*
 * Agenda Prink visual refresh.
 * This file only changes presentation. Existing behavior remains in app.js.
 */

:root {
  --red: #e4002b;
  --red-dark: #b70022;
  --black: #111214;
  --ink: #1b1c20;
  --muted: #686d76;
  --line: #e1e3e8;
  --line-strong: #cfd3da;
  --surface: #ffffff;
  --soft: #f3f4f6;
  --danger-soft: #fff0f3;
  --danger-strong-soft: #ffe0e7;
  --success-soft: #eaf7ee;
  --success: #19733a;
  --warning-soft: #fff4d9;
  --warning: #9a6000;
  --blue: #2467c7;
  --blue-soft: #edf5ff;
  --orange: #e86f16;
  --shadow: 0 1px 2px rgba(17, 18, 20, 0.04), 0 12px 32px rgba(17, 18, 20, 0.07);
  --shadow-raised: 0 4px 12px rgba(17, 18, 20, 0.08), 0 24px 54px rgba(17, 18, 20, 0.12);
}

html {
  background: #f2f3f5;
  scroll-behavior: smooth;
}

body {
  background: #f2f3f5;
  color: var(--ink);
  font-family: Inter, "SF Pro Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(228, 0, 43, 0.22);
  outline-offset: 2px;
}

/* Login */

.login-screen {
  background: #0d0e10;
  min-height: 100svh;
  overflow: hidden;
  padding: 24px;
  position: relative;
}

.login-screen::before {
  background: var(--red);
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.login-screen::after {
  border: 1px solid rgba(255, 255, 255, 0.05);
  content: "";
  height: min(58vw, 680px);
  position: absolute;
  right: -18vw;
  top: 22vh;
  transform: rotate(18deg);
  width: min(42vw, 500px);
}

.login-box {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  gap: 18px;
  max-width: 430px;
  padding: 34px;
  position: relative;
  z-index: 1;
}

.login-box::before {
  background: url("/prink-logo.png") left center / contain no-repeat;
  content: "";
  display: block;
  height: 54px;
  margin-bottom: 2px;
  width: 170px;
}

.login-box::after {
  background: var(--red);
  content: "";
  height: 4px;
  left: 34px;
  position: absolute;
  right: 34px;
  top: 0;
}

.login-box .eyebrow {
  margin-bottom: -8px;
}

.login-box h1 {
  font-size: 34px;
  line-height: 1.05;
}

.login-box label {
  font-size: 13px;
}

.login-box input,
.login-box select {
  min-height: 48px;
}

.login-box .primary-button {
  min-height: 48px;
}

/* Top navigation */

.app-shell {
  min-height: 100vh;
}

.topbar {
  background: #0d0e10;
  border-bottom: 3px solid var(--red);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
  gap: 18px;
  grid-template-columns: minmax(210px, 1fr) auto minmax(420px, 1fr);
  min-height: 72px;
  padding: 8px clamp(18px, 3vw, 34px);
}

.topbar::after {
  background: rgba(255, 255, 255, 0.08);
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  right: 0;
  top: auto;
}

.topbar-brand {
  gap: 8px;
}

.topbar-brand img {
  height: 43px;
  max-width: 142px;
}

.topbar-brand span {
  font-size: 29px;
  font-weight: 850;
}

.topbar-title {
  font-size: 25px !important;
  font-weight: 850;
  letter-spacing: 0;
}

.topbar-actions {
  flex-wrap: nowrap;
  gap: 7px;
}

.topbar-home-button {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  min-height: 36px;
  padding-inline: 14px;
}

.topbar-home-button:hover {
  background: #ff173f;
  border-color: #ff173f;
}

.status-pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.13);
  font-size: 12px;
  min-height: 34px;
  padding: 6px 11px;
}

#connectionStatus {
  gap: 7px;
}

#connectionStatus::before {
  background: #90959d;
  border-radius: 50%;
  content: "";
  height: 7px;
  width: 7px;
}

#connectionStatus.online {
  background: rgba(33, 158, 82, 0.16);
  border-color: rgba(72, 203, 121, 0.3);
  color: #b9f3ce;
}

#connectionStatus.online::before {
  background: #43cf78;
  box-shadow: 0 0 0 3px rgba(67, 207, 120, 0.12);
}

.topbar-notification-toggle {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.13);
  color: white;
  min-height: 34px;
  width: 36px;
}

.topbar-notification-toggle.active {
  background: rgba(228, 0, 43, 0.2);
  border-color: rgba(255, 80, 111, 0.45);
}

.logout-button {
  background: white;
  min-height: 36px;
  padding-inline: 14px;
}

.logout-button:hover {
  background: #f0f1f3;
}

.notification-toast {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 4px solid var(--red);
  box-shadow: var(--shadow-raised);
  top: 90px;
}

@media (min-width: 921px) {
  .app-shell {
    padding-top: 72px;
  }

  .topbar {
    min-height: 72px;
  }
}

/* Shared surfaces */

.layout {
  gap: 22px;
  grid-template-columns: minmax(420px, 1.2fr) minmax(380px, 0.88fr);
  max-width: 1480px;
  padding: 24px clamp(16px, 3vw, 36px) 44px;
}

.finance-layout {
  gap: 22px;
  grid-template-columns: minmax(330px, 0.72fr) minmax(0, 1.5fr);
  max-width: 1480px;
  padding: 24px clamp(16px, 3vw, 36px) 44px;
}

.finance-dashboard {
  gap: 22px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.task-form-panel,
.task-list-panel,
.finance-entry-panel,
.finance-dashboard .panel,
.finance-recent-panel,
.workshop-panel {
  padding: 20px;
}

.task-list-panel {
  align-self: start;
}

.panel-heading {
  align-items: center;
  margin-bottom: 18px;
}

.panel h2 {
  font-size: 22px;
  font-weight: 850;
  line-height: 1.12;
}

.eyebrow {
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 5px;
}

.panel-tools {
  gap: 7px;
}

.count-badge {
  background: var(--black);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  font-size: 13px;
  min-height: 36px;
  min-width: 40px;
  padding: 6px 11px;
}

.primary-button,
.secondary-button,
.ghost-button,
.filter,
.icon-button,
.notification-toggle,
.logout-button {
  border-radius: 6px;
  font-weight: 800;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.primary-button {
  background: var(--red);
  box-shadow: 0 5px 14px rgba(228, 0, 43, 0.17);
}

.primary-button:hover {
  background: var(--red-dark);
}

.secondary-button,
.ghost-button,
.filter,
.icon-button {
  background: #f5f6f7;
  color: var(--ink);
}

.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  background: #e9ebee;
}

.ghost-button {
  border-color: #dfe2e7;
}

.mode-button.active {
  background: var(--black);
  border-color: var(--black);
  box-shadow: 0 4px 10px rgba(17, 18, 20, 0.14);
}

/* Agenda filters */

.filters {
  background: #eff0f2;
  border-color: #e0e2e6;
  border-radius: 7px;
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  padding: 4px;
}

.filters.assignee-filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filter {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  min-height: 36px;
  padding: 7px 10px;
}

.filter:hover {
  background: rgba(255, 255, 255, 0.7);
}

.filter.active {
  background: var(--black);
  border-color: var(--black);
  box-shadow: 0 3px 9px rgba(17, 18, 20, 0.16);
  color: #fff;
}

.date-filter,
.search-filter,
.sort-filter {
  margin-bottom: 14px;
}

.task-list-panel > label {
  color: #4e535c;
}

.route-summary {
  background: #f7f8f9;
  border: 1px solid #e1e3e7;
  border-left: 4px solid var(--red);
  border-radius: 6px;
  color: #5e636c;
  margin-bottom: 16px;
  padding: 11px 12px;
}

/* Forms */

.task-form {
  gap: 15px;
}

.task-form-panel > .panel-heading,
.workshop-panel > .panel-heading {
  border-bottom: 1px solid var(--line);
  gap: 14px;
  margin: -2px 0 18px;
  min-height: 0;
  padding-bottom: 16px;
}

.task-form-panel > .panel-heading > div:first-child,
.workshop-panel > .panel-heading > div:first-child {
  min-height: 0;
}

.task-form-panel > .panel-heading .panel-tools,
.workshop-panel > .panel-heading .panel-tools {
  background: #f1f2f4;
  border: 1px solid #e0e2e6;
  border-radius: 7px;
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px;
  width: 100%;
}

.task-form-panel > .panel-heading .mode-button,
.workshop-panel > .panel-heading .mode-button {
  border: 1px solid transparent;
  overflow: hidden;
  padding-inline: 8px;
  text-overflow: ellipsis;
}

.form-section-title {
  border-top: 1px solid #e6e8eb;
  color: var(--red);
  font-size: 11px;
  margin-top: 3px;
  padding-top: 15px;
}

label {
  color: #292b30;
  font-size: 12.5px;
  font-weight: 800;
  gap: 7px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #cfd3d9;
  border-radius: 6px;
  box-shadow: inset 0 1px 1px rgba(17, 18, 20, 0.025);
  min-height: 44px;
  padding: 10px 12px;
}

input::placeholder,
textarea::placeholder {
  color: #999ea6;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b5bac2;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(228, 0, 43, 0.11);
}

textarea {
  min-height: 96px;
}

.grid {
  gap: 13px;
}

.form-actions {
  border-top: 1px solid var(--line);
  gap: 9px;
  margin-top: 3px;
  padding-top: 16px;
}

.form-actions button {
  min-height: 44px;
}

.checkbox-label {
  background: #f6f7f8;
  border-color: #dfe2e6;
  min-height: 44px;
}

.checkbox-label:has(input:checked) {
  background: #fff0f3;
  border-color: rgba(228, 0, 43, 0.32);
}

/* Task list */

.tasks {
  gap: 10px;
}

.task-section {
  gap: 9px;
}

.task-section + .task-section {
  margin-top: 18px;
}

.task-section-heading {
  border-bottom: 1px solid #e2e4e8;
  padding: 0 1px 8px;
}

.task-section-heading h3 {
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.task-section-heading span {
  background: #e8eaed;
  color: #464b53;
  min-height: 23px;
}

.task-section-list {
  gap: 10px;
}

.task-card {
  background: #fff;
  border: 1px solid #dfe2e7;
  border-left: 5px solid #b9bec6;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(17, 18, 20, 0.035);
  gap: 15px;
  padding: 14px 14px 14px 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.task-card:hover {
  box-shadow: 0 5px 18px rgba(17, 18, 20, 0.08);
}

.task-card h3 {
  font-size: 17px;
  font-weight: 850;
  line-height: 1.25;
}

.task-status-pendiente {
  background: #fff8e7;
  border-color: #f0d99d;
  border-left-color: #d79100;
}

.task-card.overdue,
.task-card.carried-over {
  background: #ffe6eb;
  border-color: #f0b5c1;
  border-left-color: var(--red);
}

.task-card.task-status-en-curso,
.task-card.task-status-en-curso.carried-over {
  background: #e5f6ea !important;
  border-color: #a8d8b7;
  border-left-color: #1d8a48 !important;
}

.task-card.task-assignee-dolores {
  background: #edf5ff;
  border-color: #b9d4f6;
  border-left-color: var(--blue);
}

.task-card.task-assignee-dolores.carried-over,
.task-card.task-assignee-dolores.overdue {
  background: #d9eaff;
  border-color: #89b6ed;
  border-left-color: #174e9f;
}

.task-card.task-assignee-dolores.task-status-en-curso,
.task-card.task-assignee-dolores.task-status-en-curso.carried-over,
.task-card.task-assignee-dolores.task-status-en-curso.overdue {
  background: #e3f5ea !important;
  border-color: #a6d7b5;
  border-left-color: #1d8a48 !important;
}

.task-title-row {
  gap: 12px;
}

.priority {
  background: var(--red);
  box-shadow: 0 3px 8px rgba(228, 0, 43, 0.18);
  font-size: 11px;
  padding: 5px 8px;
}

.task-tags {
  gap: 5px;
  margin-top: 8px;
}

.tag {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(17, 18, 20, 0.1);
  color: #535861;
  font-size: 11px;
  min-height: 23px;
  padding: 3px 8px;
}

.type-tag {
  background: #fff;
  border-color: rgba(17, 18, 20, 0.17);
  color: var(--black);
}

.time-tag {
  background: var(--black);
  border-color: var(--black);
}

.status-pendiente {
  background: #ffeab8;
  border-color: #e7c76d;
  color: #754600;
}

.status-en-curso {
  background: #cbefd6;
  border-color: #9ed0ad;
  color: #145c30;
}

.status-hecha {
  background: #dff3e5;
  border-color: #b8dfc4;
}

.carry-tag {
  background: #fff;
  border-color: rgba(228, 0, 43, 0.22);
}

.client {
  font-size: 14px;
  margin-top: 9px;
}

.address,
.meta,
.notes {
  color: #5d626b;
  line-height: 1.45;
}

.notes:not(:empty) {
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(17, 18, 20, 0.09);
  border-radius: 6px;
  padding: 9px 10px;
}

.task-comment {
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(17, 18, 20, 0.1);
}

.task-actions {
  gap: 6px;
  min-width: 106px;
}

.task-actions .icon-button {
  border-color: rgba(17, 18, 20, 0.14);
  min-height: 36px;
  padding: 7px 9px;
}

.icon-button.done {
  background: var(--black);
  border-color: var(--black);
}

.icon-button.done:hover {
  background: #2c2e33;
}

.icon-button.postpone {
  background: #fff6d7;
  border-color: #e9cf80;
  color: #704700;
}

.icon-button.comment {
  background: #edf4ff;
  border-color: #bdd3f1;
  color: #194f98;
}

.icon-button.edit {
  background: #f4f5f6;
}

.quick-status {
  border-color: #cfd3d9;
  min-height: 36px;
}

.empty {
  background: #f7f8f9;
  border-color: #d6d9df;
  color: #696e77;
}

.route-order-button {
  background: var(--black);
  border-radius: 6px;
}

.task-list-panel.route-mode .task-card {
  box-shadow: var(--shadow);
}

/* Workshop */

.workshop-history {
  border-top-color: var(--line);
}

.repair-list {
  gap: 10px;
}

.repair-card {
  border-color: #dfe2e7;
  border-left: 5px solid var(--red);
  box-shadow: 0 1px 2px rgba(17, 18, 20, 0.04);
  gap: 14px;
  padding: 14px;
}

.repair-number {
  background: var(--black);
  border-color: var(--black);
}

/* Finance entry */

.finance-day-form {
  gap: 18px;
}

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

.finance-form-section {
  border-radius: 8px;
  gap: 14px;
  padding: 16px;
}

.finance-section-income {
  background: #eef9f1;
  border-color: #b9dfc3;
  box-shadow: inset 4px 0 0 #258a4a;
}

.finance-section-expense {
  background: #fff2f4;
  border-color: #edc8cf;
  box-shadow: inset 4px 0 0 var(--red);
}

.finance-form-section h3 {
  font-size: 18px;
  font-weight: 850;
}

.finance-field-grid {
  gap: 11px;
}

.finance-field-grid input {
  background: rgba(255, 255, 255, 0.88);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

/* Finance dashboard */

.finance-metrics {
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.finance-metrics article {
  background: #f7f8f9;
  border-color: #e0e3e7;
  border-radius: 8px;
  min-height: 112px;
  padding: 14px;
  position: relative;
}

.finance-metrics article::before {
  background: #a5abb4;
  content: "";
  height: 3px;
  left: 13px;
  position: absolute;
  right: 13px;
  top: 0;
}

.finance-metrics article:nth-child(1)::before,
.finance-metrics article:nth-child(5)::before,
.finance-metrics article:nth-child(6)::before {
  background: #27864a;
}

.finance-metrics article:nth-child(2)::before {
  background: var(--orange);
}

.finance-metrics article:nth-child(3)::before {
  background: #af720e;
}

.finance-metrics article:nth-child(4)::before {
  background: var(--red);
}

.finance-metrics article:nth-child(7)::before,
.finance-metrics article:nth-child(8)::before {
  background: #3e65b7;
}

.finance-metrics span {
  color: #666b73;
  font-size: 10.5px;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.finance-metrics strong {
  font-size: clamp(21px, 1.65vw, 27px);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.finance-metrics small {
  border-top: 1px solid #e2e4e7;
  color: #777c84;
  margin-top: 10px;
  padding-top: 7px;
}

.finance-balance-visual {
  border-top-color: #e2e4e8;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
}

.balance-row {
  grid-template-columns: 132px minmax(100px, 1fr) 110px;
}

.balance-row div,
.chart-row div {
  background: #eceef1;
  height: 10px;
}

.finance-calendar {
  gap: 7px;
}

.calendar-weekday {
  color: #676c74;
}

.calendar-day {
  background: #f7f8f9;
  border-color: #e2e4e8;
  min-height: 68px;
  padding: 9px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.calendar-day:hover {
  border-color: #babfc7;
}

.calendar-day.registered {
  background: #eaf7ee;
  border-color: #b3dcc0;
}

.calendar-day.negative {
  background: #ffedf0;
  border-color: #efbec7;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px var(--black);
}

.calendar-day.selected {
  box-shadow: inset 0 0 0 2px var(--red), 0 4px 10px rgba(228, 0, 43, 0.12);
}

.finance-day-detail {
  background: #f8f9fa;
  border-color: #e0e2e6;
  padding: 14px;
}

.day-detail-grid span {
  background: #fff;
  border-color: #e0e2e6;
}

.finance-charts {
  gap: 20px;
}

.finance-chart-column {
  background: #f8f9fa;
  border: 1px solid #e3e5e8;
  border-radius: 8px;
  padding: 14px;
}

.cumulative-chart-wrap {
  margin-top: 20px;
  padding-top: 20px;
}

.cumulative-chart {
  background: #f8f9fa;
  border-color: #e1e4e8;
  padding: 14px;
}

.chart-legend {
  gap: 12px;
}

.chart-legend span {
  font-size: 10px;
}

.chart-row {
  grid-template-columns: 90px minmax(80px, 1fr) 92px;
}

.annual-row {
  border-color: #e0e3e7;
}

.annual-header {
  background: var(--black);
  border-color: var(--black);
}

.annual-total {
  background: #f1f2f4;
  border: 2px solid var(--black);
}

.finance-disclosure summary {
  background: #f3f4f6;
  border-color: #dde0e5;
  min-height: 46px;
  padding: 11px 13px;
}

.finance-disclosure summary:hover {
  background: #eaecf0;
}

.finance-record {
  border-color: #e0e3e7;
  border-left-width: 5px;
}

/* Dialogs */

.modal-backdrop {
  background: rgba(7, 8, 10, 0.68);
  backdrop-filter: blur(4px);
}

.modal-card {
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-raised);
  padding: 24px;
}

.modal-card h2 {
  font-size: 24px;
}

/* Intermediate widths */

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(180px, 1fr) auto minmax(370px, 1fr);
  }

  .topbar-brand img {
    height: 38px;
    max-width: 126px;
  }

  .topbar-brand span {
    font-size: 25px;
  }

  .layout {
    grid-template-columns: minmax(380px, 1.12fr) minmax(350px, 0.9fr);
  }

  .finance-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .layout,
  .finance-layout {
    grid-template-columns: 1fr;
    max-width: 820px;
  }

  .workshop-panel {
    grid-column: auto;
  }

  .finance-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Mobile */

@media (max-width: 620px) {
  body {
    background: #f3f4f6;
  }

  .topbar {
    align-items: center;
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.15);
    gap: 7px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 12px 9px;
  }

  .topbar-brand img {
    height: 31px;
    max-width: 103px;
  }

  .topbar-brand span {
    font-size: 21px;
  }

  .topbar-title {
    font-size: 22px !important;
    justify-self: end;
  }

  .topbar-actions {
    display: grid;
    gap: 5px;
    grid-column: 1 / -1;
    grid-template-columns: minmax(108px, 1.25fr) auto 34px minmax(96px, 1fr) auto;
    justify-content: stretch;
    width: 100%;
  }

  .topbar-home-button,
  .status-pill,
  .topbar-notification-toggle,
  .logout-button {
    font-size: 11px;
    min-height: 31px;
    padding: 5px 8px;
  }

  .topbar-notification-toggle {
    padding: 0;
    width: 34px;
  }

  .notification-toast {
    left: 10px;
    right: 10px;
    top: 104px;
  }

  .layout,
  .finance-layout {
    gap: 10px;
    padding: 10px 8px 28px;
  }

  .task-form-panel,
  .task-list-panel,
  .finance-entry-panel,
  .finance-dashboard .panel,
  .finance-recent-panel,
  .workshop-panel {
    padding: 14px;
  }

  .panel-heading {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 14px;
  }

  .panel h2 {
    font-size: 20px;
  }

  .panel-tools {
    justify-content: flex-end;
  }

  .filters {
    display: grid;
    flex-wrap: nowrap;
    gap: 2px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 3px;
  }

  .filters.assignee-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter {
    font-size: 13px;
    min-height: 35px;
    padding: 7px 4px;
  }

  .route-mode-toggle,
  .compact-toggle {
    min-height: 35px;
    padding: 7px 9px;
  }

  .count-badge {
    min-height: 35px;
    min-width: 38px;
  }

  .task-card {
    gap: 12px;
    padding: 13px;
  }

  .task-card:hover {
    box-shadow: 0 1px 2px rgba(17, 18, 20, 0.035);
  }

  .task-card h3 {
    font-size: 17px;
  }

  .task-actions {
    background: rgba(255, 255, 255, 0.66);
    border-color: rgba(17, 18, 20, 0.09);
    border-radius: 7px;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 6px;
  }

  .task-actions .icon-button,
  .quick-status {
    font-size: 13px;
    min-height: 40px;
  }

  .task-list-panel.route-mode .task-actions > * {
    min-height: 46px;
  }

  .form-actions {
    gap: 8px;
  }

  .finance-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-metrics article {
    min-height: 108px;
    padding: 13px;
  }

  .finance-metrics strong {
    font-size: clamp(19px, 6vw, 24px);
  }

  .finance-charts {
    grid-template-columns: 1fr;
  }

  .finance-chart-column {
    padding: 12px;
  }

  .finance-calendar {
    gap: 4px;
  }

  .calendar-day {
    min-height: 56px;
    padding: 6px;
  }

  .calendar-day span {
    font-size: 9px;
    margin-top: 5px;
  }

  .calendar-day em {
    font-size: 8px;
  }

  .day-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .annual-row {
    gap: 4px;
    grid-template-columns: 42px repeat(5, minmax(0, 1fr));
    padding: 8px 6px;
  }

  .annual-row span,
  .annual-row strong {
    font-size: 9px;
  }

  .chart-row {
    grid-template-columns: 62px minmax(70px, 1fr) 74px;
  }

  .chart-row span,
  .chart-row strong,
  .balance-row span,
  .balance-row strong {
    font-size: 11px;
  }

  .balance-row {
    grid-template-columns: 88px minmax(70px, 1fr) 82px;
  }

  .modal-card {
    padding: 19px;
  }
}

@media (max-width: 520px) {
  .task-form-panel > .panel-heading .panel-tools,
  .workshop-panel > .panel-heading .panel-tools {
    display: none;
  }

  .task-form-panel > .panel-heading,
  .workshop-panel > .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .floating-new-task {
    border-radius: 7px;
    box-shadow: 0 7px 18px rgba(228, 0, 43, 0.18);
    min-height: 46px;
  }

  .floating-workshop-entry {
    box-shadow: 0 7px 18px rgba(17, 18, 20, 0.15);
  }

  .floating-workshop-history {
    box-shadow: 0 7px 18px rgba(63, 63, 70, 0.15);
  }

  .finance-field-grid,
  .finance-layout.finance-limited .finance-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .topbar-brand span {
    font-size: 19px;
  }

  .topbar-title {
    font-size: 20px !important;
  }

  .topbar-actions {
    grid-template-columns: minmax(98px, 1fr) auto 32px minmax(88px, 1fr) auto;
  }

  .topbar-home-button,
  .status-pill,
  .logout-button {
    font-size: 10px;
    padding-inline: 6px;
  }

  .finance-field-grid,
  .finance-layout.finance-limited .finance-field-grid {
    grid-template-columns: 1fr;
  }
}

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