@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --navy: #0E1A20;
  --navy-deep: #081014;
  --navy-mid: #16262E;
  --green: #22D86B;
  --green-deep: #16B650;
  --green-soft: rgba(34, 216, 107, 0.12);
  --purple: #7C4DFF;
  --pink: #FF4D8D;
  --orange: #FF9D42;
  --blue: #3D9EFF;
  --bg: #F3F6F4;
  --sheet: #FFFFFF;
  --border: #E3E9E6;
  --ink: #0E1A20;
  --steel: #637178;
  --steel-light: #9FAAB0;
  --danger: #FF4757;
  --warn: #FFA940;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --shadow: 0 1px 3px rgba(14, 26, 32, 0.04), 0 6px 20px rgba(14, 26, 32, 0.06);
  --shadow-md: 0 4px 12px rgba(14, 26, 32, 0.08), 0 12px 32px rgba(14, 26, 32, 0.08);
  --shadow-lg: 0 16px 48px rgba(8, 16, 20, 0.18), 0 4px 16px rgba(8, 16, 20, 0.08);
  --shadow-green: 0 6px 20px rgba(34, 216, 107, 0.35);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

html, body {
  margin: 0;
  padding: 0;
  direction: rtl;
  font-family: 'Rubik', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
html { scroll-behavior: smooth; }

/* Company name under the logo in the sidebar (each company sees its own) */
.brand-org {
  margin-top: 6px; font-size: 12.5px; font-weight: 800; letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.82); text-align: center; line-height: 1.3;
}

/* Shared small utility classes — consolidate patterns repeated inline across pages */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cell-muted { color: var(--steel-light); }
/* The ✕ is the first child of .modal and sticks to its top-left corner while a long form scrolls.
   (position:absolute put it on the screen corner instead: .modal itself is not positioned.) */
.modal > .modal-close {
  display: flex; position: sticky; top: 0; z-index: 2;
  margin: 0 auto -34px -10px; /* on the title's line, 18px from the window's left edge */
  background: var(--sheet);
}
.modal > .modal-close + h3 { padding-left: 30px; }
.empty-state {
  text-align: center; color: var(--steel-light); padding: 40px 14px; font-size: 13.5px; font-weight: 600;
}
.empty-state::before {
  content: '';
  display: block;
  width: 34px; height: 34px;
  margin: 0 auto 10px;
  border-radius: 10px;
  background: var(--bg);
  border: 1.5px dashed var(--border);
}
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(6, 15, 53, 0.92); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out;
}
.lightbox-overlay img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }

body { min-height: 100vh; display: flex; flex-direction: column; }

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: 15px;
}

/* ===== Sidebar ===== */
.app-header {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 236px;
  background: linear-gradient(175deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 50;
  box-shadow: -4px 0 24px rgba(8, 16, 20, 0.15);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-header .brand {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.app-header .brand .brand-logo { height: 40px; width: auto; max-width: 100%; object-fit: contain; display: block; }
/* A company's own logo comes in unknown colours; a white chip keeps it legible on the dark sidebar. */
.app-header .brand .brand-logo.company { background: #fff; border-radius: 8px; padding: 4px 8px; }

.app-header nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 12px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.app-header nav::-webkit-scrollbar {
  display: none;
}

.app-header nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.68);
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
}
.app-header nav a .nav-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
/* the icons carry detail and colour, so they get a little more room than the old emoji */
.app-header .nav-ico { display: block; width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.app-header nav a.nav-sub .nav-ico { width: 24px; height: 24px; }
.app-header nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.09);
}
.app-header nav a.active {
  background: linear-gradient(120deg, var(--green) 0%, var(--green-deep) 100%);
  color: #04231a;
  box-shadow: var(--shadow-green);
  font-weight: 700;
}

/* ===== Sidebar nav groups (accordion) ===== */
.nav-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.82);
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-group-header:hover { color: #fff; background: rgba(255,255,255,0.09); }
.nav-group-header .nav-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-chevron {
  margin-right: auto;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  transition: transform 0.22s var(--ease-out);
}
.nav-group.expanded .nav-chevron { transform: rotate(180deg); }
.nav-group-items {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s var(--ease-out);
}
.nav-group-items-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav-group.expanded .nav-group-items { grid-template-rows: 1fr; }
.app-header nav a.nav-sub {
  padding-right: 34px;
  font-size: 13px;
}

.app-header .sidebar-footer {
  padding: 14px 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* the site pin sits inside the pill, opposite the dropdown chevron */
.app-header .sidebar-footer .site-badge {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"), url('../icons/nav/site.webp');
  background-repeat: no-repeat, no-repeat;
  background-position: left 14px center, right 10px center;
  background-size: 10px, 20px;
  padding-right: 38px;
}
.app-header .site-badge {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat left 14px center;
  background-size: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  border-radius: 999px;
  padding: 9px 16px 9px 32px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  width: 100%;
  cursor: pointer;
}
.app-header .site-badge option {
  color: #0E1A20;
  background: #ffffff;
  font-weight: 600;
  padding: 10px;
}
.app-header .site-badge option:checked,
.app-header .site-badge option:hover {
  background: #E7F8EE;
  color: #0E1A20;
}
.auth-legal {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 22px; font-size: 12.5px; color: var(--steel);
}
.auth-legal a { color: var(--steel); text-decoration: none; }
.auth-legal a:hover { color: var(--green-deep); text-decoration: underline; }
.app-header .sidebar-legal {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 8px; font-size: 11.5px; color: rgba(255,255,255,0.45);
}
.app-header .sidebar-legal a { color: rgba(255,255,255,0.55); text-decoration: none; }
.app-header .sidebar-legal a:hover { color: #fff; text-decoration: underline; }
.app-header .logout-btn {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.82);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 999px;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}
.app-header .logout-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.header-menu-btn {
  display: none;
  position: fixed; top: 14px; right: 14px; z-index: 60;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 19px;
  align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform 0.15s, right 0.28s var(--ease-out);
}
.header-menu-btn:active { transform: scale(0.94); }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(6, 12, 48, 0.55);
  backdrop-filter: blur(3px);
  z-index: 45;
}
.sidebar-backdrop.open { display: block; }

@media (max-width: 900px) {
  .app-header { transform: translateX(100%); }
  .app-header.open { transform: translateX(0); }
  .header-menu-btn { display: flex; }
  .page { margin-right: 0 !important; }
  footer.app-footer { margin-right: 0 !important; }
  .page-title { padding-right: 62px; }
}

.field-hint { font-size: 11.5px; color: var(--steel); margin-top: 4px; min-height: 0; }
.field-hint:empty { display: none; }

/* ===== Licensing path to טופס 4 (facility-file.html, js/licensing.js) ===== */
.lic-card { margin-bottom: 20px; }
.lic-card[hidden] { display: none; }
.lic-card .card-header { flex-wrap: wrap; gap: 6px 12px; }
.lic-sub { font-size: 12px; color: var(--steel); }
.lic-path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.lic-step button { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 8px; padding: 10px 12px;
  background: var(--sheet); border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer; font: inherit; text-align: right; color: var(--ink); }
.lic-step button:hover { border-color: var(--green); }
.lic-step.active button { border-color: var(--green-deep); box-shadow: 0 0 0 3px var(--green-soft); }
.lic-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--bg); color: var(--steel); }
.lic-done .lic-num { background: var(--green); color: #fff; }
.lic-partial .lic-num { background: var(--warn); color: #fff; }
.lic-name { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.lic-count { font-size: 12px; color: var(--steel); font-variant-numeric: tabular-nums; }
.lic-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--bg); overflow: hidden; }
.lic-bar span { display: block; height: 100%; background: var(--green-deep); border-radius: 2px; }
.lic-note { font-size: 12px; color: var(--steel); margin: 8px 2px 0; }
.lic-offer { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 12px;
  background: var(--green-soft); border-radius: var(--radius-sm); padding: 14px 16px; }
.lic-offer p { margin: 4px 0 0; font-size: 13px; color: var(--ink); line-height: 1.6; max-width: 70ch; }
.lic-inst { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--navy); }
.lic-inst input { font-size: 13px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--sheet); min-width: 180px; }
.lic-offer.small { background: var(--bg); font-size: 13px; padding: 10px 14px; }
.lic-basis { font-size: 11.5px; color: var(--steel); }
.lic-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.lic-status-open { background: var(--bg); color: var(--steel); }
.lic-status-progress { background: #FFF1DC; color: #B25E00; }
.lic-status-done { background: var(--green-soft); color: var(--green-deep); }

.corr-reply { font-size: 12px; color: var(--steel); }

/* ===== Price comparison (prices.html) ===== */
.pc-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pc-group { background: var(--bg); border-radius: var(--radius-sm); padding: 12px 14px; }
.pc-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pc-head b { font-size: 14px; color: var(--navy); }
.pc-head span { font-size: 12px; color: var(--steel); }
.pc-spread { margin-inline-start: auto; font-weight: 700; color: #B25E00 !important; }
.pc-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.pc-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; background: var(--sheet); border-radius: 9px; padding: 6px 10px; font-size: 13px; }
.pc-list li.best { box-shadow: inset 0 0 0 1.5px var(--green); }
.pc-price { font-weight: 800; font-variant-numeric: tabular-nums; }
.pc-date { grid-column: 1 / -1; font-size: 11.5px; color: var(--steel); }
.pc-date.old { color: #B25E00; }
.pc-note { font-size: 11.5px; color: var(--steel); margin-top: 6px; }

/* ===== חריגים — extra work (exceptions.html) ===== */
.xw-card { margin-bottom: 20px; }
.xw-card[hidden] { display: none; }
.xw-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.xw-block { border-radius: var(--radius-sm); padding: 12px 14px; background: var(--bg); border-inline-start: 4px solid var(--steel-light); }
.xw-block.xw-in { border-inline-start-color: var(--green); }
.xw-block.xw-out { border-inline-start-color: var(--blue); }
.xw-title { font-weight: 800; font-size: 13.5px; color: var(--navy); margin-bottom: 8px; }
.xw-block dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.xw-block dt { font-size: 11.5px; color: var(--steel); }
.xw-block dd { margin: 0; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.xw-block dd small { display: block; font-size: 11px; font-weight: 600; color: var(--steel); }
.xw-warn { margin: 8px 0 0; font-size: 12px; font-weight: 700; color: #D1293A; }
.xw-note { margin: 4px 0 0; font-size: 12px; color: var(--steel); }
.xw-dir { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.xw-dir.xw-in { background: var(--green-soft); color: var(--green-deep); }
.xw-dir.xw-out { background: rgba(61, 158, 255, 0.14); color: #1F6FC5; }
.xw-sub { font-size: 11.5px; color: var(--steel); margin-top: 2px; }
.xw-sub-inline { font-size: 11.5px; color: var(--steel); }
.xw-noinst { font-size: 11.5px; font-weight: 700; color: #D1293A; }
.qc-fixed { font-size: 11.5px; font-weight: 700; color: var(--green-deep); }
.qc-due { font-size: 11.5px; color: var(--steel); }

/* ===== Weekly meeting: open items and action items ===== */
.mt-list { display: grid; gap: 6px; }
.mt-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 140px auto; gap: 6px; align-items: center; }
.mt-row input, .mt-row select { font-size: 13px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--sheet); min-width: 0; }
.mt-row.saved { display: flex; justify-content: space-between; gap: 10px; background: var(--bg); border-radius: 9px; padding: 7px 10px; font-size: 13px; }
.mt-meta { color: var(--steel); font-size: 12px; white-space: nowrap; }
.mt-open { margin: 4px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: 13px; }
.mt-open a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.mt-badge { display: inline-block; margin-inline-start: 8px; font-size: 11.5px; font-weight: 700; color: var(--green-deep); background: var(--green-soft); border-radius: 999px; padding: 1px 8px; }
@media (max-width: 600px) { .mt-row { grid-template-columns: 1fr 1fr; } .mt-row input[data-k="title"] { grid-column: 1 / -1; } }

/* ===== QC checklists (js/qc-checklists.js) and non-conformances ===== */
.qc-checklist { background: var(--bg); border-radius: var(--radius-sm); padding: 12px 14px; margin: 4px 0 16px; }
.qc-empty { margin: 0; font-size: 13px; color: var(--steel); }
.qc-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 8px; }
.qc-head b { font-size: 14px; color: var(--navy); }
.qc-head span { font-size: 11.5px; color: var(--steel); }
.qc-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; counter-reset: qc; }
.qc-item { counter-increment: qc; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--sheet); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.qc-item.hold { border-inline-start: 3px solid var(--warn); }
.qc-text::before { content: counter(qc) ". "; color: var(--steel); font-weight: 700; }
.qc-hold-key { display: inline-block; font-size: 10.5px; font-weight: 800; color: #B25E00; background: #FFF1DC; border-radius: 999px; padding: 1px 7px; }
.qc-choices { display: flex; gap: 4px; }
.qc-choice { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--sheet); color: var(--steel); }
.qc-choice.on.qc-ok { background: var(--green); border-color: var(--green); color: #04231a; }
.qc-choice.on.qc-fail { background: var(--danger); border-color: var(--danger); color: #fff; }
.qc-choice.on.qc-na { background: var(--steel-light); border-color: var(--steel-light); color: #fff; }
.qc-mini { font-size: 12px; color: var(--steel); white-space: nowrap; }
.qc-mini-fail { color: var(--danger); }
.lic-status-fail { background: #FFECEE; color: #D1293A; }
.ncr-sev { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 800; color: #fff; }
.ncr-sev-1 { background: var(--steel-light); }
.ncr-sev-2 { background: var(--warn); }
.ncr-sev-3 { background: var(--danger); }
.ncr-late { font-size: 11.5px; font-weight: 700; color: #D1293A; }

/* ===== "מהמסמכים המצורפים" — what the attached documents say (js/doc-insights.js) ===== */
.doc-insights { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.doc-insights > * { min-width: 0; }
.doc-insights[hidden] { display: none; }
.di-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--navy); }
.di-head b { font-size: 14px; }
.di-head span { font-size: 11.5px; color: var(--steel); }
.di-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.di-checks li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.5; padding: 7px 10px; border-radius: 10px; background: var(--sheet); }
.di-checks li .ui-ico { flex: none; margin-top: 2px; }
.di-checks .di-ok .ui-ico { color: var(--green-deep); }
.di-checks .di-info .ui-ico { color: var(--steel); }
.di-checks .di-warn { background: #FFF6EA; }
.di-checks .di-warn .ui-ico { color: #C46A00; }
.di-checks .di-bad { background: #FFECEE; }
.di-checks .di-bad .ui-ico { color: var(--danger); }
.di-more summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--steel); }
.di-more .table-wrap { margin-top: 8px; max-height: 260px; overflow: auto; }
.di-table { font-size: 12px; }
.di-table th, .di-table td { padding: 6px 8px; white-space: nowrap; }
.di-table .di-na { color: var(--steel-light); }
.di-table .di-doubt { color: #C46A00; font-weight: 700; }
.di-foot { font-size: 11px; color: var(--steel); margin: 6px 0 0; }
.di-docs { margin: 6px 0 0; padding-inline-start: 18px; font-size: 12px; color: var(--ink); display: grid; gap: 3px; }
.di-docs .di-pending { color: var(--steel); }
.di-read { justify-self: start; }
.di-dot { width: 11px; height: 11px; border-radius: 50%; border: 0; padding: 0; margin-inline-start: 6px; vertical-align: middle; cursor: pointer; }
.di-dot-ok { background: var(--green); }
.di-dot-warn { background: var(--warn); }
.di-dot-bad { background: var(--danger); }

/* ===== Phones: bottom tab bar and home tiles (hidden on desktop) ===== */
.tab-bar, .home-tiles { display: none; }
@media (max-width: 900px) {
  .tab-bar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px rgba(14, 26, 32, 0.08);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .tab-bar .tab {
    flex: 1; position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 0 4px;
    background: none; border: 0;
    color: var(--steel); font: inherit; font-size: 11.5px; font-weight: 600;
    text-decoration: none; cursor: pointer;
  }
  .tab-bar .tab:active { transform: scale(0.94); }
  .tab-bar .tab.active { color: var(--green-deep); font-weight: 800; }
  .tab-bar .tab.active::before {
    content: ''; position: absolute; top: -7px;
    width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--green);
  }
  .tab-badge {
    position: absolute; top: 1px; left: calc(50% - 24px);
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--danger); color: #fff;
    font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center;
  }
  body.has-tab-bar .header-menu-btn { display: none; }
  body.has-tab-bar .page-title { padding-right: 0; }
  body.has-tab-bar .page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body.has-tab-bar footer.app-footer { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  body.has-tab-bar .toast-host { bottom: calc(84px + env(safe-area-inset-bottom)); }

  .home-tiles { display: block; margin: 6px 0 22px; }
  .tiles-title { font-size: 13px; font-weight: 800; color: var(--steel); margin: 18px 4px 9px; }
  .tiles-title:first-child { margin-top: 4px; }
  .tiles-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .tile {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    min-height: 106px; padding: 16px 6px 12px;
    background: #fff; border-radius: 16px;
    box-shadow: 0 2px 12px rgba(14, 26, 32, 0.07);
    color: var(--navy); text-align: center; text-decoration: none;
    transition: transform 0.15s var(--ease-spring);
  }
  .tile:active { transform: scale(0.96); }
  .tile .ico3d { width: 46px; height: 46px; filter: drop-shadow(0 2px 3px rgba(14, 26, 32, 0.16)); }
  .tile-label { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
  .tile-badge { position: absolute; top: 8px; left: 8px; }
  .tile-badge.count {
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    background: var(--danger); color: #fff; font-size: 12px; font-weight: 800;
  }
  .tile-badge.done {
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--green); color: #fff;
  }
}

/* ===== Desktop sidebar collapse ===== */
@media (min-width: 901px) {
  .header-menu-btn {
    display: flex;
    top: 20px;
    right: 250px;
  }
  .app-header.desktop-hidden { transform: translateX(100%); box-shadow: none; }
  body.sidebar-collapsed .page,
  body.sidebar-collapsed footer.app-footer { margin-right: 0; }
  body.sidebar-collapsed .header-menu-btn { right: 20px; }
}

/* ===== Layout ===== */
.page {
  flex: 1;
  /* auto, not 100%: with the sidebar's margin a 100% width overflowed every screen
     narrower than about 1500px and cut the page off on the left */
  width: auto;
  min-width: 0;
  max-width: 1280px;
  margin-right: 236px;
  padding: 32px 24px 64px;
  transition: margin-right 0.28s var(--ease-out);
}

.page-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 6px;
  letter-spacing: -0.7px;
  line-height: 1.2;
  animation: rise-in 0.5s var(--ease-spring) both;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 24px 0 28px;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-card {
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring), border-color 0.3s var(--ease-spring);
  animation: rise-in 0.5s var(--ease-spring) both;
}
.stats-row .stat-card:nth-child(1) { animation-delay: 0.03s; }
.stats-row .stat-card:nth-child(2) { animation-delay: 0.07s; }
.stats-row .stat-card:nth-child(3) { animation-delay: 0.11s; }
.stats-row .stat-card:nth-child(4) { animation-delay: 0.15s; }
.stats-row .stat-card:nth-child(5) { animation-delay: 0.19s; }
.stats-row .stat-card:nth-child(6) { animation-delay: 0.23s; }
.stats-row .stat-card:nth-child(7) { animation-delay: 0.27s; }
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(34, 216, 107, 0.3);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-deep) 100%);
}
.stat-card.has-ico {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  align-items: center;
}
.stat-card.has-ico .stat-ico {
  grid-column: 2; grid-row: 1 / span 2;
  width: 44px; height: 44px; object-fit: contain;
  /* the set was lit for a dark sidebar; a soft shadow keeps the pale ones from fading into a white card */
  filter: drop-shadow(0 2px 3px rgba(14, 26, 32, 0.18));
}
.stat-card.has-ico .label, .stat-card.has-ico .value { grid-column: 1; }
.stat-card .label {
  position: relative;
  color: var(--steel);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.stat-card .value {
  position: relative;
  color: var(--navy);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.6px;
}

.card {
  background: var(--sheet);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px;
  margin: 20px 0;
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.card:hover { border-color: #DCE1F2; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.card-header h2 {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.15px;
  color: var(--navy);
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.25s var(--ease-out), background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(120deg, var(--green) 0%, var(--green-deep) 100%);
  color: #04231a;
  box-shadow: var(--shadow-green);
}
.btn-primary:hover {
  box-shadow: 0 8px 26px rgba(34, 216, 107, 0.45);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0) scale(0.97); }

.btn-outline {
  background: var(--sheet);
  color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--navy-mid);
  background: rgba(14, 26, 32, 0.03);
}

.btn-ghost {
  background: rgba(14, 26, 32, 0.05);
  color: var(--navy);
}
.btn-ghost:hover { background: rgba(14, 26, 32, 0.1); }

.btn-danger {
  background: rgba(255, 71, 87, 0.09);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(255, 71, 87, 0.16); }

.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ===== Filter bar ===== */
.filter-toggle { position: relative; }
.filter-panel {
  display: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-panel.open { display: flex; }
.filter-field { display: flex; flex-direction: column; gap: 6px; }
.filter-field label { font-size: 12px; font-weight: 600; color: var(--steel); }
.filter-field input, .filter-field select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  min-width: 150px;
  background: var(--sheet);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.filter-field input:focus, .filter-field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(34, 216, 107, 0.12);
}

/* ===== Table ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--sheet);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
thead th {
  background: #F7F8FC;
  color: var(--steel);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.15px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  padding: 13px 16px;
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
tbody td.num-cell {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr {
  animation: rise-in 0.3s var(--ease-out) both;
  transition: background 0.15s var(--ease-out);
}
tbody tr:nth-child(1) { animation-delay: 0.01s; }
tbody tr:nth-child(2) { animation-delay: 0.03s; }
tbody tr:nth-child(3) { animation-delay: 0.05s; }
tbody tr:nth-child(4) { animation-delay: 0.07s; }
tbody tr:nth-child(5) { animation-delay: 0.09s; }
tbody tr:nth-child(6) { animation-delay: 0.11s; }
tbody tr:nth-child(7) { animation-delay: 0.13s; }
tbody tr:nth-child(8) { animation-delay: 0.15s; }
tbody tr.empty-row { animation: none; }
tbody tr:hover {
  background: linear-gradient(90deg, rgba(34, 216, 107, 0.05) 0%, transparent 70%);
}
.empty-row td { text-align: center; color: var(--steel-light); padding: 48px 14px; font-size: 13.5px; font-weight: 600; }
.empty-row td::before {
  content: '';
  display: block;
  width: 34px; height: 34px;
  margin: 0 auto 10px;
  border-radius: 10px;
  background: var(--bg);
  border: 1.5px dashed var(--border);
}

/* ===== Icons ===== */
/* line icons take their size from width/height and their colour from the control */
.ui-ico { display: inline-block; vertical-align: -0.18em; flex-shrink: 0; }
.ico3d { display: inline-block; vertical-align: middle; object-fit: contain; flex-shrink: 0; }
.btn .ico3d { margin: -4px 0; filter: drop-shadow(0 1px 2px rgba(14, 26, 32, 0.15)); }
.with-ico { display: flex; align-items: center; gap: 10px; }
.with-ico .ico3d { filter: drop-shadow(0 2px 3px rgba(14, 26, 32, 0.16)); }
/* row buttons use the 3D set's colours: edit blue, delete red, PDF orange, send green */
.icon-btn .ui-ico-pencil, .icon-btn .ui-ico-mail { color: var(--blue); }
.icon-btn .ui-ico-trash { color: var(--danger); }
.icon-btn .ui-ico-file-text { color: var(--orange); }
.icon-btn .ui-ico-send, .icon-btn .ui-ico-lock-open { color: var(--green-deep); }
.icon-btn .ui-ico-lock { color: var(--navy); }
.doc-badge .ui-ico { margin-inline-end: 1px; }
.zone-ico { display: block; margin: 0 auto 8px; width: 44px; height: 44px; object-fit: contain; }
.attach-zone .zone-ico { width: 40px; height: 40px; }
.sev-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sev-dot.sev-red { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.18); }
.sev-dot.sev-orange { background: var(--orange); box-shadow: 0 0 0 3px rgba(255, 157, 66, 0.2); }
.att-text { display: flex; align-items: center; gap: 10px; }
.all-clear { display: flex; align-items: center; gap: 8px; color: var(--steel); font-size: 14px; }

/* report exports: one row per module with its PDF and Excel buttons */
.export-list { display: flex; flex-direction: column; gap: 6px; }
.export-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 12px; background: var(--bg); }
.export-row > .ico3d { filter: drop-shadow(0 1px 2px rgba(14, 26, 32, 0.16)); }
.export-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--navy); }
.export-row .btn-sm { padding: 6px 11px; font-size: 12.5px; background: #fff; }

.row-actions { white-space: nowrap; }
.row-actions-inner { display: flex; gap: 4px; align-items: center; }
.icon-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  color: var(--steel);
  font-size: 14px;
  transition: background 0.18s var(--ease-out), color 0.18s var(--ease-out), transform 0.18s var(--ease-spring);
}
.icon-btn:hover { background: rgba(14, 26, 32, 0.07); color: var(--navy); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0) scale(0.92); }
.icon-btn.danger:hover { background: rgba(255, 71, 87, 0.1); color: var(--danger); }

.site-check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.site-check {
  position: relative;
  display: flex; align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px 7px 34px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}
.site-check input {
  position: absolute; opacity: 0; width: 0; height: 0; margin: 0;
}
.site-check::before {
  content: '';
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 6px;
  border: 2px solid var(--steel-light); background: var(--sheet);
  transition: background 0.15s, border-color 0.15s;
}
.site-check.checked::before {
  background: var(--green);
  border-color: var(--green);
}
.site-check.checked::after {
  content: '✓';
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #04231a; font-size: 11px; font-weight: 800; line-height: 1;
}
.site-check.checked {
  border-color: var(--green);
  background: var(--green-soft);
}

.doc-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(120deg, rgba(34, 216, 107,0.14) 0%, rgba(22,182,80,0.10) 100%);
  color: var(--green-deep);
  border: none;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s var(--ease-spring), box-shadow 0.18s var(--ease-out);
}
.doc-badge:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

/* ===== Modal / Form ===== */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(8, 16, 20, 0.55);
  backdrop-filter: blur(5px);
  z-index: 100;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--sheet);
  border: none;
  border-radius: var(--radius-lg);
  padding: 30px 28px 26px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal h3 {
  margin: 0 0 18px;
  color: var(--navy);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
/* display:flex beats the hidden attribute (QC defect fields show only for a failed check) */
.field[hidden] { display: none; }
.field label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1px;
  color: var(--steel);
}
.field input, .field select, .field textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  background: var(--sheet);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(34, 216, 107, 0.14);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 20px;
}

/* ===== File attach widget ===== */
.attach-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  color: var(--steel);
  font-size: 13px;
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
}
.attach-zone:hover, .attach-zone.dragover {
  border-color: var(--green);
  background: var(--green-soft);
}
.attach-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.attach-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out), transform 0.2s var(--ease-spring);
  animation: rise-in 0.35s var(--ease-spring) both;
}
.attach-list .attach-item:nth-child(1) { animation-delay: 0.02s; }
.attach-list .attach-item:nth-child(2) { animation-delay: 0.05s; }
.attach-list .attach-item:nth-child(3) { animation-delay: 0.08s; }
.attach-list .attach-item:nth-child(4) { animation-delay: 0.11s; }
.attach-list .attach-item:nth-child(5) { animation-delay: 0.14s; }
.attach-item:hover { border-color: var(--border); background: var(--sheet); box-shadow: var(--shadow); }
a.attach-item:hover { transform: translateX(-2px); }
.attach-item .remove { color: var(--danger); font-size: 16px; padding: 2px 6px; }

/* ===== Toast / inline messages ===== */
.msg {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 14px;
  display: none;
}
.msg.show { display: block; }
.msg.error { background: rgba(255, 71, 87, 0.1); color: var(--danger); }
.msg.success { background: var(--green-soft); color: var(--green-deep); }

.toast-host {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.toast {
  background: var(--navy-deep);
  color: #fff;
  padding: 13px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.22s ease;
}
.toast.error { background: var(--danger); }
.toast.success {
  background: linear-gradient(120deg, var(--green) 0%, var(--green-deep) 100%);
  color: #04231a;
  font-size: 15px;
  font-weight: 800;
  padding: 14px 22px;
  animation: toast-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(4, 35, 26, 0.15);
  margin-left: 6px;
  font-size: 13px;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-pop {
  0% { opacity: 0; transform: translateY(10px) scale(0.9); }
  60% { transform: translateY(0) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Login (Auth) — asymmetric split screen ===== */
.auth-split {
  flex: 1;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  direction: ltr;
}

.auth-visual {
  position: relative;
  overflow: hidden;
  background: linear-gradient(175deg, var(--navy) 0%, var(--navy-deep) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
}
.auth-visual::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 40%, transparent 85%);
}
.auth-visual::after {
  content: '';
  position: absolute; inset: -20%;
  background:
    radial-gradient(circle at 25% 20%, rgba(34, 216, 107, 0.32), transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(22, 182, 80, 0.18), transparent 45%),
    radial-gradient(circle at 60% 15%, rgba(88, 220, 118, 0.10), transparent 40%);
  filter: blur(10px);
  animation: mesh-drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes mesh-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-3%, 3%) scale(1.08); }
}
.auth-visual-top { position: relative; z-index: 1; }
.auth-visual-top img { display: block; width: 100%; max-width: 400px; height: auto; }
.auth-visual-body { position: relative; z-index: 1; direction: rtl; text-align: right; }
.auth-visual-body h2 {
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.25;
  margin: 0 0 14px;
  max-width: 420px;
}
.auth-visual-body p {
  color: rgba(255,255,255,0.6);
  font-size: 14.5px;
  line-height: 1.7;
  max-width: 380px;
  margin: 0;
}
.auth-visual-foot {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  font-weight: 600;
  direction: rtl;
}
.auth-visual-foot .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(34, 216, 107,0.18);
  animation: pulse-dot 2.2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.auth-form-panel {
  direction: rtl;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
  animation: rise-in 0.5s var(--ease-spring) both;
}

/* The logo has light lettering and no background, so on the light card it sits on
   the same dark ground as the desktop panel. Phones only; desktop shows the panel. */
.auth-brand {
  background: linear-gradient(175deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 20px;
}
.auth-brand img { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto; }
.auth-form-panel .auth-card .auth-brand { display: none; }

.auth-card .tagline {
  color: var(--navy);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 30px;
}

.auth-card .field {
  text-align: right;
  margin-bottom: 15px;
}

.auth-card .btn-primary {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
  padding: 14px;
  font-size: 15.5px;
  letter-spacing: 0.2px;
}

@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-form-panel .auth-card .auth-brand { display: block; }
}

.password-wrap { position: relative; }
.password-wrap input { padding-left: 44px; }
.password-toggle {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 15px;
  color: var(--steel);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.password-toggle:hover {
  background: var(--bg);
  color: var(--navy);
}

.step-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-bottom: 22px;
}
.step-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.25s ease;
}
.step-dots span.active {
  background: var(--green);
  width: 22px;
  border-radius: 4px;
}

.switch-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--steel);
  margin-top: 14px;
  cursor: pointer;
  font-weight: 600;
  padding: 8px;
  border-radius: 8px;
  transition: color 0.15s;
}
.switch-link:hover {
  color: var(--navy);
  text-decoration: underline;
}

.btn:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.field.field-error input {
  border-color: var(--danger) !important;
}
.field-error-msg {
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  display: none;
}
.field.field-error .field-error-msg {
  display: block;
}

.auth-form {
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.auth-form.hidden { display: none; }
.auth-form.entering {
  opacity: 0;
  transform: translateY(8px);
}

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.auth-card.shake {
  animation: shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* ===== Loader ===== */
.spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, var(--green) 0deg, var(--green-deep) 140deg, transparent 200deg, transparent 360deg);
  animation: spin 0.85s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

footer.app-footer {
  text-align: center;
  color: var(--steel-light);
  font-size: 12px;
  padding: 20px;
  margin-right: 236px;
  transition: margin-right 0.28s var(--ease-out);
}

/* ===== Welcome block (dashboard) ===== */
.welcome-block {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.welcome-greeting {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.5px;
  line-height: 1.25;
}
.welcome-meta {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--steel);
}
.welcome-site {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  background: var(--green-soft);
  border: 1px solid rgba(34, 216, 107, 0.25);
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
}

/* ===== Upload progress ===== */
.upload-progress {
  margin-top: 12px;
}
.upload-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-deep) 100%);
  transition: width 0.25s ease;
}
.upload-progress-text {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--steel);
}

/* ===== Audit meta ===== */
.record-audit[hidden] { display: none; } /* empty on a new record; inline-block would still show the pill */
.record-audit {
  margin: -8px 0 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--steel);
  background: var(--bg);
  border-radius: 999px;
  padding: 6px 12px;
  display: inline-block;
}
.audit-cell {
  white-space: nowrap;
  vertical-align: middle;
}
.audit-who {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy);
}
.audit-when {
  font-size: 11px;
  color: var(--steel);
  margin-top: 2px;
}

/* red counts in the menu (support replies, new support requests) */
.nav-count { margin-inline-start: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
             background: var(--danger); color: #fff; font-size: 11px; font-weight: 800;
             display: inline-flex; align-items: center; justify-content: center; }
.tab .tab-dot { position: absolute; top: 6px; inset-inline-end: 28%; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.nav-count[hidden] { display: none; }

/* announcements from the platform operator, under the header */
.tadok-ann { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; border-radius: 12px;
             padding: 10px 14px; margin-bottom: 12px; font-size: 14px; line-height: 1.6; }
.tadok-ann.info { background: #E6EFFA; color: #1F3F66; }
.tadok-ann.warn { background: #FFF1D6; color: #7A4A06; }
.tadok-ann-x { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; padding: 0 4px; flex-shrink: 0; }

/* support mode (platform operator viewing a company, read only) */
#tadokSupportBar { position: sticky; top: 0; z-index: 40; }
.tadok-support-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
  justify-content: space-between; background: #7A2E0E; color: #fff; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18); font-size: 14px; }
.tadok-support-bar b { font-variant-numeric: tabular-nums; }
.tadok-support-bar .btn { background: #fff; color: #7A2E0E; border: 0; font-weight: 800; }
.support-log-state { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--steel); white-space: nowrap; }
.support-log-state.on { background: #FFE3D6; color: #7A2E0E; }
/* on desktop the floating menu button sits over the top right of the page */
@media (min-width: 901px) { .tadok-support-bar { padding-right: 64px; } }
