:root {
  color-scheme: light;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --accent: #c2410c;
  --accent-soft: #fff7ed;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-subtle: #fafafa;
  --control: #ffffff;
  --sidebar: #262626;
  --sidebar-soft: #33302d;
  --sidebar-line: rgba(255, 255, 255, .1);
  --text: #171717;
  --muted: #6b7280;
  --line: #dedede;
  --soft: #ecfdf5;
  --table-head: #f8f8f7;
  --hover: #fafafa;
  --login-bg: #efefec;
  --mobile-nav: rgba(255, 255, 255, .97);
  --danger: #b91c1c;
  --warning: #b45309;
  --success: #047857;
  --shadow: 0 18px 48px rgba(23, 23, 23, .08);
  --shadow-soft: 0 10px 24px rgba(23, 23, 23, .06);
  font-family: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --brand-strong: #22d3ee;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, .13);
  --bg: #0b0f14;
  --panel: #151a21;
  --panel-subtle: #1b222b;
  --control: #0f141b;
  --sidebar: #05070a;
  --sidebar-soft: #111827;
  --sidebar-line: rgba(255, 255, 255, .1);
  --text: #f3f4f6;
  --muted: #a3aab7;
  --line: #2a3442;
  --soft: rgba(34, 211, 238, .14);
  --table-head: #101822;
  --hover: #1d2631;
  --login-bg: #070a0f;
  --mobile-nav: rgba(15, 20, 27, .97);
  --shadow: 0 18px 48px rgba(0, 0, 0, .32);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, .24);
}

body[data-theme="navy"] {
  color-scheme: dark;
  --brand-strong: #38bdf8;
  --accent: #22d3ee;
  --accent-soft: rgba(34, 211, 238, .13);
  --bg: #091321;
  --panel: #101d2d;
  --panel-subtle: #142438;
  --control: #0c1726;
  --sidebar: #06101d;
  --sidebar-soft: #0d2136;
  --sidebar-line: rgba(255, 255, 255, .12);
  --text: #f8fafc;
  --muted: #a8b8ca;
  --line: #263b55;
  --soft: rgba(56, 189, 248, .13);
  --table-head: #0d1c30;
  --hover: #172b44;
  --login-bg: #050d18;
  --mobile-nav: rgba(12, 23, 38, .97);
  --shadow: 0 18px 48px rgba(0, 0, 0, .3);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, .22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 16px;
  background: var(--sidebar);
  color: #f5f5f4;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 6px 8px 18px;
  border-bottom: 1px solid var(--sidebar-line);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  overflow-wrap: anywhere;
  font-size: .98rem;
  letter-spacing: 0;
}

.brand small {
  color: #c7c2bb;
  font-size: .82rem;
}

.brand-mark {
  display: inline-grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 760;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
}

.nav-list {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #dedbd6;
  font-size: .94rem;
  font-weight: 620;
}

.nav-icon {
  display: inline-grid;
  flex: 0 0 24px;
  width: 24px;
  margin-right: 8px;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
}

.nav-item.active,
.nav-item:hover {
  border-color: rgba(255, 255, 255, .12);
  background: var(--sidebar-soft);
  color: #ffffff;
}

.nav-item.active::before,
.nav-item:hover::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 22px;
  border-radius: 999px;
  background: var(--brand);
}

.nav-item.disabled {
  color: #8c8780;
}

.main-area {
  min-width: 0;
  padding: 26px;
  padding-bottom: 92px;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .86rem;
  font-weight: 650;
}

.app-footer img {
  display: block;
  width: 124px;
  max-width: 38vw;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  object-position: center;
  background: #06101d;
}

.auth-footer {
  width: min(100%, 440px);
  margin: 16px auto 0;
  padding-top: 14px;
}

.setup-body .auth-footer {
  width: min(100%, 1180px);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.topbar h1,
.hero-panel h2,
.login-card h1 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.55rem, 2vw, 2.15rem);
  font-weight: 760;
  line-height: 1.12;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.mobile-menu-toggle,
.mobile-menu,
.mobile-menu-backdrop {
  display: none;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: .74rem;
  font-weight: 720;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.status-pill,
.user-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: .88rem;
  font-weight: 560;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--success);
}

.status-pill.offline::before {
  background: var(--danger);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: .94rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(23, 23, 23, .04);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.button.primary {
  border-color: var(--brand-strong);
  background: var(--brand);
  color: #ffffff;
}

.button.success {
  border-color: var(--success);
  background: var(--success);
  color: #ffffff;
}

.button.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.table-actions form {
  margin: 0;
}

.icon-danger {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(185, 28, 28, .55);
  border-radius: 8px;
  background: rgba(185, 28, 28, .12);
  color: var(--danger);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 800;
  line-height: 1;
}

.icon-danger:hover {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

.button.ghost:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.button.full {
  width: 100%;
}

.hero-panel,
.content-panel,
.login-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding: 24px;
  border-top: 4px solid var(--brand);
}

.hero-panel p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.62;
}

.hero-panel h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 720;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 10px;
}

.metric-grid,
.module-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.module-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card,
.module-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(23, 23, 23, .03);
}

.metric-card {
  border-left: 4px solid var(--brand);
}

.module-card {
  display: grid;
  gap: 8px;
}

.metric-card span,
.module-card p,
.muted {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 1.2rem;
}

.module-card h3 {
  margin: 0;
  font-weight: 690;
}

.module-card p {
  min-height: 42px;
  margin: 0;
  line-height: 1.5;
}

.tag.ready {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #065f46;
}

.tag.pending {
  border-color: #fed7aa;
  background: var(--accent-soft);
  color: var(--warning);
}

.semaphore {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  min-width: 112px;
  justify-content: center;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-size: .9rem;
  font-weight: 800;
  white-space: nowrap;
}

.semaphore::before {
  content: "";
  width: 14px;
  height: 14px;
  box-shadow: 0 0 0 3px rgba(4, 120, 87, .14);
  border-radius: 999px;
  background: var(--success);
}

.semaphore.green {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #065f46;
}

.semaphore.yellow {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.semaphore.yellow::before {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .16);
}

.semaphore.red {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.semaphore.red::before {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, .14);
}

.semaphore.closed {
  border-color: #d4d4d4;
  background: #f5f5f4;
  color: #57534e;
}

.semaphore.closed::before {
  background: #78716c;
  box-shadow: none;
}

.repair-row.due-green td:first-child {
  box-shadow: inset 5px 0 0 var(--success);
}

.repair-row.due-yellow td:first-child {
  box-shadow: inset 5px 0 0 #f59e0b;
}

.repair-row.due-red td:first-child {
  box-shadow: inset 5px 0 0 var(--danger);
}

.repair-row.due-closed td:first-child {
  box-shadow: inset 5px 0 0 #78716c;
}

.content-panel {
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-section-heading {
  margin: 32px 0 18px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.settings-section-heading h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.settings-section-heading p {
  margin: 0;
  color: var(--muted);
}

.pdf-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pdf-preview-actions .button span {
  font-size: 18px;
  line-height: 1;
}

.field,
.form-stack label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: .92rem;
  font-weight: 620;
  line-height: 1.25;
}

.field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-heading label {
  color: inherit;
  font: inherit;
}

.field-add-link {
  color: var(--brand);
  font-size: .84rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.field-add-link:hover {
  text-decoration: underline;
}

.popup-result {
  display: grid;
  justify-items: start;
  gap: 16px;
}

.field input,
.field select,
.field textarea,
.form-stack input,
.search-row input,
.search-row select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--text);
  font-size: .96rem;
  font-weight: 450;
  line-height: 1.35;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.form-stack input:focus,
.search-row input:focus,
.search-row select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .14);
}

.scan-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.scan-button {
  min-height: 42px;
}

.scanner-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 23, 23, .72);
}

.scanner-modal[hidden] {
  display: none;
}

.scanner-panel {
  display: grid;
  gap: 12px;
  width: min(100%, 540px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.scanner-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171717;
  object-fit: cover;
}

.field input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
}

.checkbox-field {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
}

.field-error,
.message.error {
  color: var(--danger);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  padding: 11px 13px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
  color: #075985;
  font-weight: 560;
}

.void-notice {
  display: grid;
  gap: 4px;
  margin: 0 0 16px;
  padding: 13px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #7f1d1d;
}

.void-notice.neutral {
  border-color: var(--line);
  background: var(--panel-subtle);
  color: var(--text);
}

.void-notice.neutral span {
  color: var(--muted);
}

.setup-body {
  min-height: 100vh;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 24px;
  background: var(--login-bg);
}

.setup-shell {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  gap: 18px;
  width: min(100%, 1180px);
  margin: 0 auto;
}

.setup-brand-panel {
  position: sticky;
  top: 24px;
  display: grid;
  align-content: center;
  gap: 22px;
  min-height: calc(100vh - 48px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #06101d;
  color: #f8fafc;
  box-shadow: var(--shadow);
}

.setup-brand-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.02;
}

.setup-brand-panel p:not(.eyebrow) {
  max-width: 460px;
  margin: 10px 0 0;
  color: #d6e4f0;
  font-size: 1.05rem;
}

.setup-logo {
  display: block;
  width: min(100%, 520px);
  border-radius: 8px;
}

.setup-form-panel {
  align-self: start;
}

.login-body {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0;
  overflow-x: hidden;
  background-color: #050b14;
  background-image:
    linear-gradient(rgba(56, 189, 248, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, .055) 1px, transparent 1px);
  background-size: 96px 96px;
  color: #f8fafc;
}

.login-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 8px max(24px, calc((100vw - 1500px) / 2 + 24px));
  border-bottom: 1px solid rgba(148, 163, 184, .18);
  color: #b8c9dc;
  font-size: .92rem;
  font-weight: 520;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, .62fr);
  align-items: center;
  gap: 56px;
  width: min(100%, 1500px);
  min-height: 0;
  margin: 0 auto;
  padding: 44px 48px;
}

.login-hero {
  display: grid;
  gap: 28px;
  max-width: 760px;
}

.login-logo {
  width: min(100%, 330px);
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .26);
}

.login-hero h1 {
  max-width: 740px;
  margin: 0;
  color: #f8fafc;
  font-size: 4.35rem;
  font-weight: 820;
  line-height: .98;
  letter-spacing: 0;
}

.login-hero h1::after {
  content: " online";
  display: block;
  color: #22d3ee;
}

.login-hero p:not(.eyebrow) {
  max-width: 690px;
  margin: 18px 0 0;
  color: #c9d8e8;
  font-size: 1.18rem;
  line-height: 1.65;
}

.login-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
}

.login-signal-grid span {
  min-height: 72px;
  padding: 16px;
  border: 1px solid rgba(56, 189, 248, .22);
  border-radius: 8px;
  background: rgba(7, 17, 30, .78);
  color: #d8e7f6;
  font-size: .9rem;
  font-weight: 760;
}

.login-access {
  justify-self: end;
  width: min(100%, 430px);
}

.login-card {
  position: relative;
  padding: 32px;
  border: 1px solid rgba(56, 189, 248, .24);
  border-top: 4px solid #22d3ee;
  background: rgba(12, 25, 42, .92);
  box-shadow: 0 24px 90px rgba(0, 0, 0, .42);
  backdrop-filter: blur(14px);
}

.login-client {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.login-client strong,
.login-client small {
  display: block;
}

.login-client strong {
  color: #ffffff;
  font-size: 1rem;
}

.login-client small {
  color: #b8c9dc;
  font-size: .84rem;
}

.login-card h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.85rem;
  font-weight: 760;
  letter-spacing: 0;
}

.login-card .field,
.login-card .form-stack label {
  color: #ffffff;
}

.login-card input {
  border-color: rgba(148, 163, 184, .25);
  background: #07111e;
  color: #ffffff;
}

.login-card input:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .18);
}

.login-card .button.primary {
  border-color: #22d3ee;
  background: #1184e8;
  box-shadow: 0 12px 28px rgba(17, 132, 232, .28);
}

.login-card .button.primary:hover {
  background: #22d3ee;
  color: #02101b;
}

.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.bottom-nav {
  display: none;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-header h2 {
  margin: 0 0 4px;
  font-size: 1.08rem;
  font-weight: 700;
}

.search-row {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 8px;
}

.search-row input {
  min-width: min(100%, 300px);
  flex: 1;
}

.responsive-table {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.table-secondary {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .86rem;
}

.responsive-table table {
  width: 100%;
  border-collapse: collapse;
}

.responsive-table th,
.responsive-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #ececec;
  text-align: left;
  vertical-align: top;
}

.responsive-table th {
  background: var(--table-head);
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.responsive-table tr:hover td {
  background: var(--hover);
}


.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.product-thumb {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel-subtle);
}

.product-thumb.empty {
  display: inline-grid;
  place-items: center;
  color: var(--brand-strong);
  font-weight: 700;

.product-thumb-shell {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}

.product-thumb-shell .product-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.product-thumb-shell img.product-thumb {
  z-index: 1;
}

.product-thumb-shell .product-thumb.empty {
  z-index: 0;
}
}
.responsive-table td span {
  display: block;
  color: var(--muted);
  font-size: .9rem;
}

.list-stack {
  display: grid;
  gap: 10px;
}

.list-item {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.list-item span {
  color: var(--muted);
}

.entry-lines {
  margin-top: 22px;
}

.inline-add-row {
  margin-top: 12px;
  min-width: 190px;
}

.section-header.compact {
  margin-bottom: 10px;
}

.entry-line-grid,
.sale-line-grid,
.payment-line-grid {
  display: grid;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.entry-line-grid {
  grid-template-columns: minmax(220px, 1.5fr) minmax(180px, 1.2fr) minmax(110px, .7fr) minmax(120px, .8fr) minmax(100px, .6fr);
}

.sale-line-grid {
  grid-template-columns: minmax(220px, 1.35fr) minmax(180px, 1fr) minmax(100px, .55fr) minmax(130px, .65fr) minmax(130px, .65fr) 42px;
}

.sale-line-remove,
.formset-line-remove {
  width: 42px;
  height: 42px;
  align-self: start;
}

.payment-line-grid {
  grid-template-columns: minmax(200px, 1fr) minmax(140px, .7fr) minmax(180px, 1fr) 42px;
}

.entry-line-head,
.sale-line-head {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.compact-field span,
.check-field span {
  display: none;
}

.compact-field.variant-not-applicable select {
  display: none;
}

.compact-field.variant-not-applicable::after {
  content: "No aplica";
  display: flex;
  box-sizing: border-box;
  height: 42px;
  min-height: 42px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
}

.line-error {
  grid-column: 1 / -1;
}

.readonly-field {
  display: grid;
  gap: 7px;
  min-height: 42px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-subtle);
}

.readonly-field span {
  display: none;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 640;
}

.readonly-field strong {
  font-size: .96rem;
  font-weight: 700;
  text-align: right;
}

.sale-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.repair-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.repair-summary .metric-card strong {
  display: flex;
  align-items: center;
  min-height: 34px;
}

.history-title {
  margin-top: 22px;
}

.repair-device-image {
  display: block;
  width: min(100%, 520px);
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: var(--panel-subtle);
}

.repair-workspace {
  border-left: 6px solid #78716c;
}

.repair-workspace.due-green {
  border-left-color: var(--success);
}

.repair-workspace.due-yellow {
  border-left-color: #f59e0b;
}

.repair-workspace.due-red {
  border-left-color: var(--danger);
}

.repair-heading h2 {
  margin: 4px 0;
}

.repair-heading h2 a {
  color: var(--text);
  text-decoration: none;
}

.repair-heading h2 a:hover {
  color: var(--brand-strong);
}

.repair-current-state {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.repair-state-label {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-subtle);
  font-weight: 800;
}

.repair-primary-actions,
.repair-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.repair-primary-actions {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.repair-primary-actions form {
  margin: 0;
}

.repair-secondary-actions {
  padding: 12px 0;
  font-size: .9rem;
  font-weight: 700;
}

.repair-secondary-actions a {
  color: var(--muted);
}

.repair-key-facts,
.repair-budget-breakdown {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  padding-top: 16px;
}

.repair-key-facts div,
.repair-budget-breakdown div {
  min-width: 0;
}

.repair-key-facts span,
.repair-budget-breakdown span,
.technical-result span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.repair-key-facts strong,
.repair-budget-breakdown strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.repair-detail-section {
  scroll-margin-top: 90px;
}

.repair-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.repair-info-section + .repair-info-section {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.repair-info-section h3 {
  margin-top: 0;
}

.repair-data-list {
  margin: 0 0 18px;
}

.repair-data-list div {
  display: grid;
  grid-template-columns: minmax(130px, .45fr) minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.repair-data-list dt {
  color: var(--muted);
  font-weight: 700;
}

.repair-data-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.technical-result > div {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.technical-result p {
  margin: 6px 0 0;
  line-height: 1.55;
}

.technical-result .internal-note {
  padding: 12px;
  border: 1px solid #fde68a;
  border-radius: 7px;
  background: #fffbeb;
  color: #78350f;
}

.repair-financial-summary {
  margin-top: 0;
}

.repair-budget-breakdown {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.repair-budget-notes p:last-child {
  margin-bottom: 0;
}

.repair-timeline {
  position: relative;
  margin-left: 8px;
}

.repair-timeline::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 7px;
  width: 2px;
  background: var(--line);
}

.repair-timeline article {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 20px;
}

.timeline-dot {
  z-index: 1;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 3px solid var(--panel);
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.repair-timeline time {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .82rem;
}

.repair-timeline p {
  margin: 7px 0 0;
}

.sale-summary div,
.method-total-grid div {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.sale-summary span,
.method-total-grid span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.sale-summary strong,
.method-total-grid strong {
  font-size: 1.28rem;
  text-align: right;
}

.method-total-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.sale-summary strong.balanced {
  color: var(--success);
}

.sale-summary strong.pending {
  color: var(--danger);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.movement-filters {
  grid-template-columns: minmax(230px, 2fr) repeat(3, minmax(150px, 1fr)) repeat(2, minmax(140px, .8fr)) auto auto;
}

.date-filter {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}

.date-filter input {
  min-width: 0;
}

.movement-summary {
  margin: 18px 0;
}

.amount-income {
  color: var(--success);
}

.amount-outflow {
  color: var(--danger);
}

.movement-kind {
  display: inline-flex;
  min-width: 68px;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: .76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.movement-kind.income {
  color: var(--success);
}

.movement-kind.outflow {
  color: var(--danger);
}

.movement-table td small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.cash-live-summary {
  margin-bottom: 22px;
}

.cash-origin-table {
  margin-bottom: 22px;
}

.cash-difference-alert {
  border-color: #fecaca !important;
  background: #fef2f2 !important;
}

.cash-difference-alert strong {
  color: var(--danger);
}

.cash-closing-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 4px solid #f59e0b;
  background: var(--panel-subtle);
}

.cash-closing-note p {
  margin: 6px 0 0;
}

.movement-amount {
  white-space: nowrap;
  font-weight: 750;
}

.task-table td > span:not(.task-priority):not(.task-status) {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.task-overdue td:first-child {
  box-shadow: inset 5px 0 0 var(--danger);
}

.task-priority,
.task-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 750;
}

.task-priority.high,
.task-priority.urgent {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.task-priority.low {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.task-status.pending {
  border-color: #d4d4d4;
  background: #f5f5f4;
  color: #57534e;
}

.task-status.in_progress {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.task-status.blocked {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.task-status.done {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #065f46;
}

.debt-overdue td:first-child {
  box-shadow: inset 5px 0 0 var(--danger);
}

.debt-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 750;
}

.debt-status.open {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.debt-status.paid {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #065f46;
}

.debt-status.cancelled {
  border-color: #d4d4d4;
  background: #f5f5f4;
  color: #57534e;
}

.debt-table .field-error,
.debt-summary .field-error {
  display: block;
  margin-top: 5px;
}

.debt-cancel-form {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.customer-contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.customer-contact-grid div {
  min-width: 0;
}

.customer-contact-grid span,
.customer-notes p {
  color: var(--muted);
}

.customer-contact-grid strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.customer-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.customer-metrics {
  margin-top: 22px;
}

.customer-metrics small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.customer-notes {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.customer-notes p {
  margin-bottom: 0;
}

.customer-section-nav {
  position: sticky;
  top: 10px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
}

.customer-section-nav a {
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.customer-section-nav a:hover {
  background: var(--accent-soft);
}

.customer-history {
  scroll-margin-top: 90px;
}

.communication-status {
  font-weight: 750;
}

.communication-status.sent {
  color: var(--success);
}

.communication-status.failed {
  color: var(--danger);
}

.task-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr);
  gap: 22px;
}

.task-description {
  min-height: 180px;
  padding-right: 22px;
  border-right: 1px solid var(--line);
}

.task-description h2,
.task-description p {
  margin-top: 0;
}

.task-controls {
  display: grid;
  gap: 16px;
  align-content: start;
}

.task-controls > div {
  display: grid;
  gap: 6px;
}

.task-controls > div > span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.task-controls form {
  display: grid;
  gap: 10px;
}

.task-conversation {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.task-comments {
  display: grid;
  gap: 10px;
}

.task-comment {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.task-comment.system {
  background: var(--panel-subtle);
}

.task-comment > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.task-comment time {
  color: var(--muted);
  font-size: .8rem;
}

.task-comment p {
  margin: 8px 0 0;
}

.task-comment-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.task-comment-form .button {
  justify-self: start;
}

.user-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 750;
}

.user-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.user-state.active {
  color: var(--success);
}

.user-state.inactive {
  color: var(--danger);
}

.user-access-control {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 4px 12px;
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
}

.user-access-control > input {
  width: 22px;
  min-height: 22px;
  margin: 0;
}

.user-access-control > label {
  display: grid;
  gap: 3px;
  cursor: pointer;
}

.user-access-control > label span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 450;
}

.user-access-control > .field-error {
  grid-column: 1 / -1;
}

@media (max-width: 1180px) {
  .movement-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .task-detail-grid {
    grid-template-columns: 1fr;
  }

  .task-description {
    min-height: 0;
    padding-right: 0;
    padding-bottom: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

.form-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 12px;
}

.receipt-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.receipt-meta.repair-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.receipt-meta div,
.receipt-total {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.receipt-meta span {
  color: var(--muted);
}

.receipt-total {
  justify-content: end;
  margin: 16px 0;
  text-align: right;
}

.receipt-total strong {
  font-size: 1.6rem;
}

.signature-row {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  max-width: 360px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

.signature-row strong {
  display: block;
  min-height: 44px;
  border-bottom: 1px solid var(--text);
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 238px 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .repair-key-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .login-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 34px 24px;
  }

  .login-access {
    justify-self: stretch;
    width: min(100%, 520px);
  }

  .login-hero h1 {
    font-size: 3.15rem;
  }
}

@media (max-width: 900px) {
  .setup-shell {
    grid-template-columns: 1fr;
  }

  .setup-brand-panel {
    position: static;
    min-height: auto;
  }

  .entry-line-head,
  .sale-line-head {
    display: none;
  }

  .entry-line-grid,
  .sale-line-grid,
  .payment-line-grid,
  .sale-summary,
  .repair-summary,
  .method-total-grid,
  .receipt-meta,
  .receipt-meta.repair-meta {
    grid-template-columns: 1fr;
  }

  .compact-field span,
  .check-field span,
  .readonly-field span {
    display: inline;
  }

  .readonly-field strong {
    text-align: left;
  }

  .sale-line-remove,
  .formset-line-remove {
    justify-self: end;
  }
}

@media (max-width: 760px) {
  .login-topline {
    display: none;
  }

  .login-shell {
    align-content: start;
    padding: 18px;
  }

  .login-logo {
    width: 230px;
    height: 66px;
  }

  .login-hero {
    gap: 16px;
  }

  .login-hero h1 {
    font-size: 2.28rem;
  }

  .login-hero p:not(.eyebrow) {
    margin-top: 12px;
    font-size: 1rem;
  }

  .login-signal-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .login-signal-grid span {
    min-height: auto;
    padding: 11px 12px;
  }

  .login-card {
    padding: 22px;
  }

  .setup-body {
    padding: 14px;
  }

  .setup-brand-panel,
  .setup-form-panel {
    padding: 18px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main-area {
    padding: 14px;
    padding-bottom: 88px;
  }

  .topbar,
  .hero-panel {
    display: grid;
  }

  .topbar-actions,
  .hero-actions,
  .action-row {
    justify-content: flex-start;
  }

  .metric-grid,
  .module-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .customer-contact-grid {
    grid-template-columns: 1fr;
  }

  .customer-section-nav {
    top: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .customer-section-nav a {
    white-space: nowrap;
  }

  .repair-current-state {
    justify-content: flex-start;
  }

  .repair-key-facts,
  .repair-budget-breakdown,
  .repair-overview-grid {
    grid-template-columns: 1fr;
  }

  .repair-info-section + .repair-info-section {
    padding-top: 20px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .repair-data-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .module-card p {
    min-height: 0;
  }

  .bottom-nav {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 20;
    display: flex;
    gap: 4px;
    padding: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--mobile-nav);
    box-shadow: 0 12px 30px rgba(23, 23, 23, .2);
    scroll-padding-inline: 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .bottom-nav::-webkit-scrollbar {
    display: none;
  }

  .bottom-nav a,
  .bottom-nav span {
    display: grid;
    flex: 0 0 auto;
    min-width: 72px;
    min-height: 48px;
    padding: 0 10px;
    place-items: center;
    border-radius: 8px;
    color: var(--text);
    font-size: .82rem;
    font-weight: 640;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .bottom-nav a:hover {
    background: var(--soft);
    color: var(--brand-strong);
  }

  .responsive-table {
    overflow-x: visible;
    border: 0;
    background: transparent;
  }

  .responsive-table table,
  .responsive-table thead,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table th,
  .responsive-table td {
    display: block;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tr {
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 1px 0 rgba(23, 23, 23, .03);
  }

  .responsive-table td {
    display: grid;
    grid-template-columns: minmax(96px, 35%) 1fr;
    gap: 10px;
    padding: 8px 0;
    border: 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 640;
  }
}

@media (max-width: 420px) {
  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .status-pill,
  .topbar-actions .user-pill,
  .topbar-actions .button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 760px) {
  body.mobile-menu-open {
    overflow: hidden;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 16px;
  }

  .topbar-heading {
    align-items: center;
  }

  .topbar h1 {
    font-size: 1.55rem;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 54px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: .72rem;
    font-weight: 700;
  }

  .mobile-menu-toggle span {
    display: block;
  }

  .mobile-menu-toggle span:first-child {
    font-size: 1.15rem;
    line-height: 1;
  }

  .topbar-session {
    display: none;
  }

  .status-pill {
    min-height: 30px;
    padding: 4px 9px;
    font-size: .78rem;
  }

  .content-panel {
    padding: 16px;
  }

  .section-header {
    align-items: stretch;
  }

  .section-header > .button,
  .section-header > .action-row,
  .section-header > .action-row .button {
    width: 100%;
  }

  .search-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .search-row input,
  .search-row select,
  .search-row .button {
    width: 100%;
    min-width: 0;
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    overflow: hidden;
  }

  .bottom-nav a,
  .bottom-nav button {
    display: grid;
    min-width: 0;
    min-height: 48px;
    padding: 0 6px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 640;
    white-space: nowrap;
  }

  .bottom-nav a:hover,
  .bottom-nav button:hover {
    background: var(--soft);
    color: var(--brand-strong);
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    background: rgba(3, 7, 18, .62);
    backdrop-filter: blur(2px);
  }

  .mobile-menu-backdrop[hidden] {
    display: none;
  }

  .mobile-menu {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 60;
    display: flex;
    width: min(88vw, 360px);
    flex-direction: column;
    border-left: 1px solid var(--line);
    background: var(--panel);
    box-shadow: -18px 0 44px rgba(3, 7, 18, .25);
    transform: translateX(105%);
    transition: transform .2s ease;
    visibility: hidden;
  }

  .mobile-menu.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-menu-header strong {
    display: block;
    font-size: 1.2rem;
  }

  .mobile-menu-close {
    display: inline-grid;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-subtle);
    color: var(--text);
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
  }

  .mobile-menu-nav {
    display: grid;
    gap: 4px;
    padding: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-menu-nav a {
    display: flex;
    min-height: 46px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    font-weight: 650;
  }

  .mobile-menu-nav a:hover {
    background: var(--soft);
    color: var(--brand-strong);
  }

  .mobile-menu-session {
    display: grid;
    gap: 10px;
    margin-top: auto;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--panel-subtle);
  }

  .mobile-menu-session span {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 650;
  }

  .responsive-table td[data-label="Accion"] {
    display: block;
    padding-top: 10px;
  }

  .responsive-table td[data-label="Accion"]::before {
    display: none;
  }

  .responsive-table td[data-label="Accion"] .button,
  .responsive-table td[data-label="Accion"] .table-actions {
    width: 100%;
  }

  .responsive-table td[data-label="Accion"] .table-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }

  .responsive-table td[colspan] {
    display: block;
    color: var(--muted);
    text-align: center;
  }

  .responsive-table td[colspan]::before {
    display: none;
  }
}

@media (max-width: 420px) {
  .topbar-actions .status-pill,
  .topbar-actions .user-pill,
  .topbar-actions .button {
    width: 100%;
    justify-content: center;
  }

  .responsive-table td {
    grid-template-columns: minmax(84px, 32%) 1fr;
    gap: 8px;
  }
}

@media print {
  .sidebar,
  .topbar,
  .bottom-nav,
  .no-print {
    display: none !important;
  }

  .app-shell,
  .main-area {
    display: block;
    padding: 0;
  }

  .content-panel {
    border: 0;
    box-shadow: none;
  }
}
.dashboard-hero {
  align-items: flex-start;
}

.dashboard-metrics {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.metric-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}

.metric-card.sensitive {
  border-left-color: var(--accent);
}

.metric-card.warning {
  border-left-color: var(--warning);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 16px;
  margin-top: 16px;
}

.dashboard-panel {
  min-width: 0;
}

.dashboard-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.dashboard-stat-row div,
.mini-list div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-subtle);
}

.dashboard-stat-row span,
.mini-list span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 720;
  text-transform: uppercase;
}

.dashboard-stat-row strong,
.mini-list strong {
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.mini-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.compact-list .list-item {
  padding: 12px;
}

.alert-item {
  border-color: color-mix(in srgb, var(--warning) 38%, var(--line));
}

@media (max-width: 980px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
/* Login visual refresh */
.login-hero h1 {
  max-width: 760px;
  font-size: clamp(3rem, 5.4vw, 5.4rem);
}

.login-hero h1::after {
  content: none;
}

.login-hero h1 span {
  display: block;
  color: #22d3ee;
  font-size: .68em;
  font-weight: 820;
}

.login-hero p:not(.eyebrow) {
  max-width: 640px;
}

.login-signal-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 720px;
  perspective: 1000px;
}

.login-signal-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  min-height: 116px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, .28);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(14, 31, 52, .92), rgba(5, 13, 24, .84)),
    radial-gradient(circle at 20% 15%, rgba(34, 211, 238, .18), transparent 34%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .24);
  animation: signalCardFloat 6.5s ease-in-out infinite;
}

.login-signal-card:nth-child(2) {
  animation-delay: .9s;
}

.login-signal-card:nth-child(3) {
  animation-delay: 1.8s;
}

.login-signal-card::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -65%;
  z-index: -1;
  width: 58%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .18), transparent);
  animation: signalSweep 4.8s ease-in-out infinite;
}

.login-signal-card:nth-child(2)::after {
  animation-delay: .7s;
}

.login-signal-card:nth-child(3)::after {
  animation-delay: 1.4s;
}

.login-signal-card h2 {
  margin: 0 0 4px;
  color: #f8fafc;
  font-size: .98rem;
  font-weight: 800;
}

.login-signal-card p {
  margin: 0;
  color: #a9c5dc;
  font-size: .82rem;
  line-height: 1.45;
}

.signal-icon {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(34, 211, 238, .3);
  border-radius: 8px;
  background: rgba(34, 211, 238, .1);
}

.signal-icon::before,
.signal-icon::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.login-signal-card.network .signal-icon::before {
  width: 26px;
  height: 26px;
  border: 2px solid #22d3ee;
}

.login-signal-card.network .signal-icon::after {
  width: 7px;
  height: 7px;
  background: #22d3ee;
  box-shadow: -16px 10px 0 #22d3ee, 16px 10px 0 #22d3ee;
}

.login-signal-card.server .signal-icon::before {
  width: 26px;
  height: 7px;
  border: 2px solid #22d3ee;
  box-shadow: 0 11px 0 -2px #22d3ee, 0 -11px 0 -2px #22d3ee;
}

.login-signal-card.server .signal-icon::after {
  right: 10px;
  width: 5px;
  height: 5px;
  background: #22d3ee;
  box-shadow: 0 11px 0 #22d3ee, 0 -11px 0 #22d3ee;
}

.login-signal-card.support .signal-icon::before {
  width: 27px;
  height: 20px;
  border: 2px solid #22d3ee;
}

.login-signal-card.support .signal-icon::after {
  right: 9px;
  bottom: 9px;
  width: 10px;
  height: 10px;
  border-right: 2px solid #22d3ee;
  border-bottom: 2px solid #22d3ee;
  border-radius: 0;
  transform: rotate(45deg);
}

@keyframes signalCardFloat {
  0%, 100% {
    transform: translateY(0) rotateX(0deg);
    border-color: rgba(34, 211, 238, .24);
  }
  45% {
    transform: translateY(-8px) rotateX(2deg);
    border-color: rgba(34, 211, 238, .52);
  }
}

@keyframes signalSweep {
  0%, 20% {
    left: -70%;
    opacity: 0;
  }
  45% {
    opacity: 1;
  }
  78%, 100% {
    left: 120%;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-signal-card,
  .login-signal-card::after {
    animation: none;
  }
}

@media (max-width: 760px) {
  .login-hero h1 {
    font-size: 2.45rem;
  }

  .login-signal-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    max-width: none;
  }

  .login-signal-card {
    min-height: auto;
    padding: 14px;
    animation: none;
  }

  .login-signal-card::after {
    animation: none;
  }

  .field-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .field-add-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
    color: var(--brand-strong);
  }
}

/* Employee dashboard */
.employee-hero {
  border-top-color: var(--accent);
}

.employee-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0 18px;
}

.employee-action-card {
  display: grid;
  gap: 7px;
  min-height: 96px;
  padding: 16px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel) 92%, var(--brand) 8%), var(--panel));
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.employee-action-card:hover,
.employee-action-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 65%, var(--line));
  box-shadow: var(--shadow-soft);
}

.employee-action-card span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 760;
  text-transform: uppercase;
}

.employee-action-card strong {
  align-self: end;
  font-size: 1.02rem;
  line-height: 1.25;
}

.employee-action-card.primary-action {
  border-color: color-mix(in srgb, var(--brand) 72%, var(--line));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--soft) 86%, var(--brand) 14%), var(--soft));
}

.employee-metrics .metric-card {
  border-left-color: var(--brand-strong);
}

.employee-dashboard-grid {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
}

@media (max-width: 980px) {
  .employee-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.printing-panel + .printing-panel {
  margin-top: 16px;
}

.printing-panel .responsive-table td:nth-child(1) {
  white-space: nowrap;
}

.print-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 720;
  white-space: nowrap;
}

.print-status::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
}

.print-status.queued {
  border-color: #d97706;
  background: rgba(217, 119, 6, .12);
  color: #f59e0b;
}

.print-status.printing {
  border-color: #0284c7;
  background: rgba(2, 132, 199, .12);
  color: #38bdf8;
}

.print-status.printed {
  border-color: #059669;
  background: rgba(5, 150, 105, .12);
  color: #10b981;
}

.print-status.failed {
  border-color: #dc2626;
  background: rgba(220, 38, 38, .12);
  color: #ef4444;
}

.print-status.cancelled {
  color: var(--muted);
}

.printing-station-setup {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.printing-station-setup > summary {
  width: fit-content;
  list-style: none;
}

.printing-station-setup > summary::-webkit-details-marker {
  display: none;
}

.printing-station-form {
  max-width: 960px;
  margin-top: 18px;
}

.printing-station-form .field small {
  color: var(--muted);
  font-weight: 450;
}

.printing-active-field label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}

.printing-station-form .form-actions {
  grid-column: 1 / -1;
}
