@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  color-scheme: light;
  --layout-max: 1780px;
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-soft-bg: rgba(255, 255, 255, 0.6);
  --text: #1e293b;
  --muted: #64748b;
  --line: #dbe2ea;
  --line-strong: #c9d4e2;
  --accent: #0f766e;
  --accent-strong: #0d9488;
  --danger: #be123c;
  --body-gradient-a: rgba(20, 184, 166, 0.2);
  --body-gradient-b: rgba(251, 146, 60, 0.16);
  --body-gradient-c: rgba(255, 255, 255, 0.9);
  --body-gradient-d: rgba(248, 250, 252, 0.95);
  --glass-bg-a: rgba(255, 255, 255, 0.9);
  --glass-bg-b: rgba(255, 255, 255, 0.74);
  --glass-border: rgba(255, 255, 255, 0.52);
  --glass-shadow: rgba(15, 23, 42, 0.55);
  --surface-contrast: #f8fafc;
  --table-head-bg: #f8fafc;
  --table-hover: #f8fafc;
  --table-line: #e2e8f0;
  --field-bg: #ffffff;
  --field-focus: #2dd4bf;
}

.dark {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: #111c31;
  --panel-soft-bg: rgba(30, 41, 59, 0.55);
  --text: #e2e8f0;
  --muted: #9fb0c8;
  --line: #314158;
  --line-strong: #42536f;
  --accent: #14b8a6;
  --accent-strong: #2dd4bf;
  --danger: #fb7185;
  --body-gradient-a: rgba(20, 184, 166, 0.22);
  --body-gradient-b: rgba(249, 115, 22, 0.16);
  --body-gradient-c: rgba(8, 14, 27, 0.95);
  --body-gradient-d: rgba(15, 23, 42, 0.98);
  --glass-bg-a: rgba(23, 34, 53, 0.84);
  --glass-bg-b: rgba(15, 23, 42, 0.8);
  --glass-border: rgba(88, 117, 155, 0.32);
  --glass-shadow: rgba(0, 0, 0, 0.72);
  --surface-contrast: #1e293b;
  --table-head-bg: #162235;
  --table-hover: #1a273d;
  --table-line: #2a3a51;
  --field-bg: #132036;
  --field-focus: #14b8a6;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 0 0, var(--body-gradient-a), transparent 36%),
    radial-gradient(circle at 100% 20%, var(--body-gradient-b), transparent 42%),
    linear-gradient(180deg, var(--body-gradient-c), var(--body-gradient-d));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

.app-shell {
  position: relative;
  overflow: hidden;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: -28vh -16vw auto auto;
  width: 44vw;
  height: 44vw;
  max-width: 35rem;
  max-height: 35rem;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.2) 0%, rgba(13, 148, 136, 0) 72%);
  animation: drift 14s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

.app-shell::after {
  content: "";
  position: fixed;
  inset: auto auto -26vh -15vw;
  width: 48vw;
  height: 48vw;
  max-width: 40rem;
  max-height: 40rem;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(251, 146, 60, 0.2) 0%, rgba(251, 146, 60, 0) 74%);
  animation: drift 18s ease-in-out infinite reverse;
  z-index: 0;
  pointer-events: none;
}

.shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.shell .page {
  flex: 1 0 auto;
}

.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 0;
}

.topbar {
  width: min(var(--layout-max), calc(100vw - 24px));
  margin: 0 auto;
  border-radius: 24px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.glass-card {
  background: linear-gradient(160deg, var(--glass-bg-a), var(--glass-bg-b));
  border: 1px solid var(--glass-border);
  box-shadow:
    0 24px 46px -30px var(--glass-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 1 auto;
  min-width: 0;
}

.brand-logo {
  display: block;
  height: auto;
}

.topbar-logo {
  width: min(252px, 46vw);
}

.badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #0f766e, #0ea5a8, #f59e0b);
  box-shadow: 0 14px 24px -14px rgba(13, 148, 136, 0.85);
}

.brand-copy {
  display: grid;
  gap: 2px;
  max-width: 21rem;
}

.brand-title {
  font-size: 18px;
  line-height: 1.15;
  font-weight: 700;
}

.brand-sub {
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

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

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.topnav-secondary {
  display: flex;
  justify-content: flex-end;
  width: auto;
  flex: 0 0 auto;
}

.btn {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--field-bg) 92%, rgba(255, 255, 255, 0.06)), color-mix(in srgb, var(--field-bg) 88%, rgba(15, 23, 42, 0.05)));
  color: var(--text);
  border-radius: 14px;
  padding: 11px 16px;
  min-height: 48px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 24px -22px rgba(15, 23, 42, 0.55);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:hover {
  border-color: var(--line-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 30px -22px rgba(15, 23, 42, 0.65);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: default;
  opacity: 0.62;
  box-shadow: none;
  transform: none;
  filter: none;
}

.nav-btn.active,
.btn.primary {
  border-color: transparent;
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #14b8a6 55%, #0ea5a8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 20px 30px -20px rgba(13, 148, 136, 0.95);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 138px;
  padding-inline: 18px;
  border-color: color-mix(in srgb, var(--line) 92%, rgba(20, 184, 166, 0.18));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--field-bg) 92%, rgba(255, 255, 255, 0.08)), color-mix(in srgb, var(--field-bg) 86%, rgba(15, 23, 42, 0.06)));
}

.btn-icon {
  width: 17px;
  height: 17px;
  display: inline-flex;
  color: var(--muted);
  flex-shrink: 0;
}

.btn-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.nav-btn.active .btn-icon {
  color: #ffffff;
}

.btn.primary:hover {
  filter: brightness(0.98);
}

.logout-btn {
  padding-inline: 18px;
  border-color: color-mix(in srgb, var(--line) 90%, rgba(148, 163, 184, 0.2));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-contrast) 86%, rgba(255, 255, 255, 0.06)), color-mix(in srgb, var(--surface-contrast) 78%, rgba(15, 23, 42, 0.08)));
}

.theme-icon-btn {
  width: 48px;
  min-width: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-icon-btn .btn-icon {
  width: 19px;
  height: 19px;
  color: var(--text);
}

.theme-icon-btn:hover .btn-icon {
  color: var(--accent);
}

.mobile-section-nav {
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.mobile-section-nav::-webkit-scrollbar {
  display: none;
}

.mobile-section-btn {
  flex: 0 0 auto;
  min-height: 40px;
  white-space: nowrap;
  background: color-mix(in srgb, var(--field-bg) 88%, transparent);
}

.mobile-section-btn.active {
  border-color: transparent;
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #14b8a6 55%, #0ea5a8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 28px -20px rgba(13, 148, 136, 0.95);
}

.mobile-switch-section {
  min-width: 0;
}

.btn.danger {
  color: var(--danger);
  background: linear-gradient(180deg, #fff1f2, #ffe4e6);
  border-color: #fda4af;
}

.page {
  width: min(var(--layout-max), calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px calc(20px + env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px))
    calc(20px + env(safe-area-inset-left, 0px));
  position: relative;
  z-index: 1;
}

.app-footer {
  width: min(var(--layout-max), calc(100vw - 24px));
  margin: 0 auto;
  padding: 0 calc(20px + env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px))
    calc(20px + env(safe-area-inset-left, 0px));
  position: relative;
  z-index: 1;
}

.app-footer-inner {
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.footer-powered {
  font-weight: 700;
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.footer-links a {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.app-footer-compact {
  width: min(520px, 100%);
  padding: 0;
}

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

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

.grid > *,
.grid.two > *,
.stats > *,
.summary-grid > *,
.report-filters > *,
.row > *,
.hero-head > *,
.section-head > *,
.topbar > * {
  min-width: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.panel-soft {
  border-style: dashed;
  background: var(--panel-soft-bg);
}

.hero-ribbon {
  border-radius: 24px;
  padding: 20px 22px;
  color: #ffffff;
  background: linear-gradient(115deg, rgba(15, 118, 110, 0.95), rgba(13, 148, 136, 0.88), rgba(251, 146, 60, 0.88));
  box-shadow: 0 28px 45px -28px rgba(15, 23, 42, 0.55);
}

.hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero-subline {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.94);
}

.hero-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-chip {
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.18);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat {
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(203, 213, 225, 0.6);
}

.stat .value {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 700;
}

.timer-panel {
  display: grid;
  gap: 12px;
}

.timer-live-wrap {
  display: grid;
  gap: 8px;
}

.timer-status {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--muted);
}

.timer-clock {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 40px;
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
}

.timer-meta {
  font-size: 14px;
}

.timer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.timer-start-wrap {
  display: grid;
  gap: 10px;
}

.welcome-actions-grid {
  align-items: stretch;
}

.action-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.action-btn {
  width: 100%;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px))
    calc(16px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dark .modal-overlay {
  background: rgba(2, 6, 23, 0.64);
}

.modal-card {
  width: min(560px, 100%);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.modal-head {
  display: grid;
  gap: 6px;
}

.modal-head h3 {
  font-size: 22px;
}

.modal-form {
  display: grid;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.report-filters {
  display: grid;
  gap: 12px;
  grid-template-columns:
    minmax(200px, 1.1fr)
    minmax(120px, 0.72fr)
    repeat(2, minmax(140px, 0.88fr))
    minmax(320px, 1.25fr);
  align-items: end;
}

.report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: center;
}

.report-actions .btn {
  flex: 1 1 104px;
  min-width: 104px;
  max-width: 172px;
}

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-card {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.summary-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.summary-hours {
  margin-top: 8px;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.invoice-kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.materials-list {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.materials-list h3 {
  font-size: 15px;
  margin-bottom: 7px;
}

.materials-list ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

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

form {
  display: grid;
  gap: 10px;
}

label {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  min-height: 44px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  background: var(--field-bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--field-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--field-focus) 24%, transparent);
}

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

select {
  text-overflow: ellipsis;
}

.row {
  display: flex;
  gap: 10px;
}

.row > * {
  flex: 1;
  min-width: 0;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--table-line);
  border-radius: 14px;
}

.table-actions {
  display: grid;
  gap: 8px;
  min-width: 164px;
}

.table-actions .btn {
  display: inline-flex;
  align-items: center;
  width: 100%;
  justify-content: center;
}

.billing-btn {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  color: color-mix(in srgb, var(--accent-strong) 78%, white);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 88%, rgba(20, 184, 166, 0.18)), color-mix(in srgb, var(--field-bg) 82%, rgba(15, 118, 110, 0.14)));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 24px -22px rgba(20, 184, 166, 0.72);
  white-space: nowrap;
}

.billing-btn:hover {
  border-color: color-mix(in srgb, var(--accent-strong) 66%, white);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 16px 28px -20px rgba(20, 184, 166, 0.78);
}

.billing-btn.is-complete {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  color: color-mix(in srgb, var(--text) 72%, var(--accent-strong));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--field-bg) 92%, rgba(20, 184, 166, 0.08)), color-mix(in srgb, var(--field-bg) 88%, rgba(15, 118, 110, 0.06)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.billing-btn.is-complete:disabled {
  opacity: 0.92;
  color: color-mix(in srgb, var(--text) 78%, var(--accent-strong));
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--table-line);
  padding: 10px 12px;
  font-size: 14px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  background: var(--table-head-bg);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

tbody tr:hover {
  background: var(--table-hover);
}

.today-entries-table {
  min-width: 980px;
}

.weekly-summary-table {
  min-width: 560px;
}

.admin-users-table {
  min-width: 1120px;
  table-layout: fixed;
}

.admin-customers-table {
  min-width: 860px;
  table-layout: fixed;
}

.admin-trash-table {
  min-width: 1260px;
  table-layout: fixed;
}

.report-entries-table {
  min-width: 1560px;
  table-layout: fixed;
}

.report-entries-table th:nth-child(1),
.report-entries-table td:nth-child(1) {
  width: 8.5rem;
}

.report-entries-table th:nth-child(2),
.report-entries-table td:nth-child(2) {
  width: 5.5rem;
}

.report-entries-table th:nth-child(3),
.report-entries-table td:nth-child(3) {
  width: 12rem;
}

.report-entries-table th:nth-child(4),
.report-entries-table td:nth-child(4) {
  width: 10.5rem;
}

.report-entries-table th:nth-child(5),
.report-entries-table td:nth-child(5) {
  width: 18rem;
}

.report-entries-table th:nth-child(6),
.report-entries-table td:nth-child(6) {
  width: 14rem;
}

.report-entries-table th:nth-child(7),
.report-entries-table td:nth-child(7) {
  width: 5rem;
}

.report-entries-table th:nth-child(8),
.report-entries-table td:nth-child(8) {
  width: 4.5rem;
}

.report-entries-table th:nth-child(9),
.report-entries-table td:nth-child(9) {
  width: 8rem;
}

.report-entries-table th:nth-child(10),
.report-entries-table td:nth-child(10) {
  width: 12rem;
}

.report-entries-table td:last-child {
  padding-right: 16px;
}

.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(20px + env(safe-area-inset-top, 0px)) calc(20px + env(safe-area-inset-right, 0px))
    calc(20px + env(safe-area-inset-bottom, 0px)) calc(20px + env(safe-area-inset-left, 0px));
}

.login-shell-content {
  width: min(700px, 100%);
  display: grid;
  gap: 12px;
}

.login-card {
  width: min(520px, 100%);
  margin: 0 auto;
  border-radius: 20px;
  padding: 20px;
  display: grid;
  gap: 14px;
}

.login-brand {
  display: grid;
  gap: 8px;
}

.login-logo {
  width: min(320px, 100%);
}

.login-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.alert {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #9f1239;
  padding: 11px 12px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 500;
}

.ok {
  border: 1px solid #86efac;
  background: #f0fdf4;
  color: #166534;
  padding: 11px 12px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 500;
}

.dark .alert {
  border-color: rgba(251, 113, 133, 0.44);
  background: rgba(127, 29, 29, 0.36);
  color: #fecdd3;
}

.dark .ok {
  border-color: rgba(74, 222, 128, 0.36);
  background: rgba(20, 83, 45, 0.42);
  color: #bbf7d0;
}

.dark .btn.danger {
  color: #fecdd3;
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.42), rgba(136, 19, 55, 0.34));
  border-color: rgba(251, 113, 133, 0.34);
}

.page-enter {
  animation: reveal 380ms ease-out;
}

@keyframes reveal {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -15px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-enter,
  .app-shell::before,
  .app-shell::after {
    animation: none;
  }

  .btn {
    transition: none;
  }
}

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

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

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

  .page {
    padding-top: 16px;
  }
}

@media (max-width: 920px) {
  .grid.two {
    grid-template-columns: 1fr;
  }

  .invoice-kpis {
    grid-template-columns: 1fr;
  }

  .topbar-wrap {
    padding-top: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

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

  .topbar-actions {
    display: grid;
    width: 100%;
    margin-left: 0;
    justify-items: stretch;
    gap: 10px;
    flex: initial;
  }

  .topbar-logo {
    width: min(210px, 62vw);
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .topnav::-webkit-scrollbar {
    display: none;
  }

  .topnav .btn {
    flex: 0 0 auto;
    min-width: 132px;
  }

  .topnav .theme-icon-btn {
    min-width: 48px;
    flex-basis: 48px;
  }

  .topnav-secondary {
    justify-content: flex-start;
  }

  .hero-head {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    background-attachment: scroll;
  }

  .stats {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .stats::-webkit-scrollbar {
    display: none;
  }

  .stats .stat {
    flex: 0 0 min(220px, 80vw);
  }

  .summary-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .summary-grid::-webkit-scrollbar {
    display: none;
  }

  .summary-grid > * {
    flex: 0 0 min(280px, 88vw);
  }

  .report-filters {
    grid-template-columns: 1fr;
  }

  .row {
    flex-direction: column;
  }

  .topnav {
    overflow-x: visible;
    flex-wrap: wrap;
    padding-bottom: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .topnav .nav-btn {
    flex: 1 1 calc(50% - 5px);
    width: auto;
    min-width: min(150px, 48%);
  }

  .topnav .theme-icon-btn {
    margin-left: 0;
    flex: 0 0 48px;
    width: 48px;
    min-width: 48px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .topnav-secondary {
    width: 100%;
  }

  .modal-overlay {
    align-items: flex-start;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .modal-card {
    width: 100%;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    border-radius: 16px;
  }

  .topnav-secondary .logout-btn {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .mobile-section-nav {
    display: flex;
  }

  .mobile-switch-section {
    display: none;
  }

  .mobile-switch-section.is-active {
    display: block;
  }

  .report-actions .btn {
    flex: 1 1 calc(50% - 4px);
  }

  .report-actions .btn.primary {
    flex-basis: 100%;
  }

  .hero-ribbon {
    padding: 16px;
  }

  .topbar-logo {
    width: min(208px, 74vw);
  }

  .brand-copy {
    display: none;
  }

  table {
    min-width: 420px;
  }

  th,
  td {
    padding: 9px 10px;
  }

  .login-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-head .theme-icon-btn {
    min-width: 42px;
  }

  .app-footer-compact {
    width: 100%;
  }

  .modal-card {
    padding: 14px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .page {
    padding-top: 14px;
  }

  .timer-clock {
    font-size: 32px;
  }
}
