/* =========================================================
   Pharma Rep Tracker — Turquoise Design System
   Mobile-first · RTL · Arabic
   ========================================================= */

:root {
  --teal-950: #042f2e;
  --teal-900: #134e4a;
  --teal-800: #115e59;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-300: #5eead4;
  --teal-200: #99f6e4;
  --teal-100: #ccfbf1;
  --teal-50: #f0fdfa;

  --ink: #0f2d2b;
  --ink-soft: #3d5c59;
  --muted: #6b8a87;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --line: rgba(13, 148, 136, 0.16);
  --shadow: 0 12px 40px rgba(15, 118, 110, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Cairo", "Segoe UI", Tahoma, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(45, 212, 191, 0.28), transparent 55%),
    radial-gradient(90% 60% at 0% 100%, rgba(13, 148, 136, 0.18), transparent 50%),
    linear-gradient(165deg, #f0fdfa 0%, #e6faf6 42%, #d9f5ef 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- App shell ---------- */

.app-shell {
  width: min(100%, 480px);
  margin-inline: auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
}

.app-shell--home {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
}

/* ---------- Hero / Home ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 28px 22px 34px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(4, 47, 46, 0.35), transparent 40%),
    linear-gradient(160deg, var(--teal-800) 0%, var(--teal-600) 48%, var(--teal-500) 100%);
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  box-shadow: 0 18px 40px rgba(15, 118, 110, 0.22);
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% 30%;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 65%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  top: -40px;
  left: -30px;
  pointer-events: none;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  margin-bottom: 18px;
  animation: rise-in 0.7s ease both;
}

.brand-mark svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-kicker {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.85;
  animation: rise-in 0.7s ease 0.08s both;
}

.hero-title {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 6vw, 2.05rem);
  font-weight: 800;
  line-height: 1.25;
  animation: rise-in 0.7s ease 0.14s both;
}

.hero-sub {
  margin: 0;
  max-width: 28ch;
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: 0.92;
  animation: rise-in 0.7s ease 0.2s both;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  animation: rise-in 0.7s ease 0.28s both;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* ---------- Content ---------- */

.content {
  flex: 1;
  padding: 22px 18px 8px;
}

.section-label {
  margin: 0 0 14px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--teal-800);
}

.module-grid {
  display: grid;
  gap: 12px;
}

.module-link {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: rise-in 0.55s ease both;
}

.module-link:nth-child(1) { animation-delay: 0.05s; }
.module-link:nth-child(2) { animation-delay: 0.1s; }
.module-link:nth-child(3) { animation-delay: 0.15s; }
.module-link:nth-child(4) { animation-delay: 0.2s; }
.module-link:nth-child(5) { animation-delay: 0.25s; }

.module-link:active {
  transform: scale(0.985);
}

.module-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--teal-500), var(--teal-700));
  color: #fff;
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.28);
}

.module-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-text h2 {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
}

.module-text p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.module-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--teal-700);
  background: var(--teal-50);
}

.module-arrow svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ---------- Page header ---------- */

.page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.96), rgba(240, 253, 250, 0.88));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.back-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-solid);
  color: var(--teal-800);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.08);
}

.back-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-header-main {
  flex: 1;
  min-width: 0;
}

.page-header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--teal-900);
}

.page-header p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.header-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal-700);
  white-space: nowrap;
}

.chip-link {
  color: inherit;
}

.privacy-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--teal-900);
  background: rgba(204, 251, 241, 0.55);
  border: 1px solid rgba(13, 148, 136, 0.28);
}

.login-panel {
  padding: 4px 2px 20px;
}

.role-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.role-option {
  display: block;
  cursor: pointer;
}

.role-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-card {
  display: block;
  padding: 16px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.role-card strong {
  display: block;
  font-size: 1rem;
  color: var(--teal-900);
  margin-bottom: 4px;
}

.role-card small {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.role-option input:checked + .role-card {
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow: 0 12px 28px rgba(13, 148, 136, 0.18);
  background: linear-gradient(180deg, rgba(204, 251, 241, 0.55), #fff);
}

.login-submit {
  width: 100%;
}

.form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.84rem;
  color: #9f1239;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

/* ---------- Form placeholder ---------- */

.form-panel {
  margin: 18px;
  padding: 18px 16px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: rise-in 0.5s ease both;
}

.form-intro {
  margin: 0 0 16px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.checklist {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.9), rgba(255, 255, 255, 0.95));
  transition: border-color 0.2s ease, background 0.2s ease;
}

.checklist-item:has(input:checked) {
  border-color: rgba(13, 148, 136, 0.35);
  background: linear-gradient(180deg, rgba(204, 251, 241, 0.65), rgba(255, 255, 255, 0.98));
}

.checklist-item label {
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink);
}

.check {
  position: relative;
  width: 24px;
  height: 24px;
  margin-top: 2px;
}

.check input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}

.check span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1.5px solid var(--teal-400);
  background: #fff;
  transition: all 0.18s ease;
}

.check span svg {
  width: 14px;
  height: 14px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.4;
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.18s ease;
}

.check input:checked + span {
  background: linear-gradient(145deg, var(--teal-500), var(--teal-700));
  border-color: var(--teal-600);
}

.check input:checked + span svg {
  opacity: 1;
  transform: scale(1);
}

.form-actions {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(145deg, var(--teal-500), var(--teal-700));
  box-shadow: 0 10px 22px rgba(13, 148, 136, 0.28);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  color: var(--teal-800);
  background: transparent;
  border: 1px solid var(--line);
}

.placeholder-note {
  margin: 14px 18px 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--teal-900);
  background: rgba(204, 251, 241, 0.55);
  border: 1px dashed rgba(13, 148, 136, 0.35);
}

/* ---------- Tabs (Team Development) ---------- */

.tabs-wrap {
  padding: 14px 16px 8px;
  animation: rise-in 0.45s ease both;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.08);
}

.tabs--four {
  grid-template-columns: 1fr 1fr;
}

.tabs--one {
  grid-template-columns: 1fr;
}

.tabs--four .tab {
  font-size: 0.78rem;
  padding: 11px 6px;
  line-height: 1.35;
}

.tab {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 12px 10px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.report-card {
  margin-top: 4px;
}

.report-note {
  margin: 0;
  text-align: start;
}

.report-form-panel {
  margin: 0;
}

.field-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.field {
  display: grid;
  gap: 6px;
  text-align: start;
}

.field span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal-900);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--teal-700) 50%),
    linear-gradient(135deg, var(--teal-700) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(1.1em + 2px), calc(100% - 13px) calc(1.1em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-left: 36px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(13, 148, 136, 0.55);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

.field textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.7;
}

.field-section-title {
  margin: 4px 0 10px;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--teal-800);
  text-align: start;
}

.btn-whatsapp {
  color: #fff;
  background: linear-gradient(145deg, #25d366, #128c7e);
  box-shadow: 0 10px 22px rgba(18, 140, 126, 0.28);
}

.whatsapp-hint {
  margin: 12px 0 0;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--muted);
  text-align: start;
}

.archive-panel {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.archive-head h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--teal-900);
}

.archive-head > p {
  margin: 0 0 8px;
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.archive-types {
  margin: 0 0 16px;
  padding: 0 18px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.7;
}

.archive-empty {
  text-align: center;
  padding: 18px 10px 8px;
}

.archive-empty h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--teal-900);
}

.archive-empty p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--muted);
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.archive-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.9), #fff);
}

.archive-item strong {
  display: block;
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 3px;
}

.archive-item span {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
}

.visit-block[hidden],
.profile-mode-panel[hidden] {
  display: none !important;
}

.visit-type-tabs {
  margin-bottom: 16px;
}

.visit-type-tabs .subtab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  line-height: 1.25;
}

.visit-type-tabs .visit-type-label {
  font-weight: 800;
}

.visit-type-tabs .visit-type-sub {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.85;
}

.profile-suggest-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(13, 148, 136, 0.22);
  border-radius: 12px;
  background: #f8fffd;
  max-height: 220px;
  overflow: auto;
}

.profile-suggest-list[hidden] {
  display: none !important;
}

.profile-suggest-item {
  appearance: none;
  border: 1px solid rgba(13, 148, 136, 0.18);
  background: #fff;
  color: #0f2d2b;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: right;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.profile-suggest-item[hidden] {
  display: none !important;
}

.profile-suggest-item:hover,
.profile-suggest-item:focus {
  border-color: rgba(13, 148, 136, 0.45);
  background: #ecfdf8;
  outline: none;
}

.choice-list {
  margin-bottom: 16px;
}

.field--full {
  grid-column: 1 / -1;
}

[data-product-select-wrap] span,
[data-drug-store-select-wrap] span {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal-900);
  margin-bottom: 6px;
}

[data-product-select-wrap] select,
[data-product-other],
[data-drug-store-select-wrap] select,
[data-drug-store-other] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
}

[data-product-other],
[data-drug-store-other] {
  margin-top: 8px;
}

.upload-drop {
  display: block;
  margin-top: 6px;
  border: 1.5px dashed rgba(13, 148, 136, 0.45);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.9), #fff);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.upload-drop:hover {
  border-color: var(--teal-600);
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.12);
}

.upload-drop-inner {
  display: grid;
  gap: 4px;
  padding: 18px 14px;
  text-align: center;
}

.upload-drop-inner strong {
  font-size: 0.92rem;
  color: var(--teal-900);
}

.upload-drop-inner small {
  font-size: 0.78rem;
  color: var(--muted);
}

.upload-drop-name {
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal-700);
}

.stamp-preview {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: #f8fffd;
  border-top: 1px solid var(--line);
  padding: 10px;
}

.samples-rows {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.sample-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.75), #fff);
}

.btn-add-product {
  width: 100%;
  margin-bottom: 14px;
  color: var(--teal-800);
  background: transparent;
  border: 1.5px dashed rgba(13, 148, 136, 0.45);
  box-shadow: none;
}

.btn-add-product:hover {
  background: rgba(204, 251, 241, 0.45);
}

.sample-remove {
  padding: 10px 12px;
}

.creds-card,
.preview-creds,
.user-card {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.creds-card h2 {
  margin: 0 0 10px;
  font-size: 1.02rem;
  color: var(--teal-900);
}

.creds-card p,
.preview-creds p,
.user-card-head p {
  margin: 0 0 6px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.creds-card code,
.user-card code {
  font-weight: 800;
  color: var(--teal-800);
}

.permission-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.permission-grid--compact {
  grid-template-columns: 1fr 1fr;
}

.permission-box {
  display: block;
  cursor: pointer;
}

.permission-box input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.permission-card {
  display: block;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.permission-card strong {
  display: block;
  font-size: 0.88rem;
  color: var(--teal-900);
  margin-bottom: 3px;
}

.permission-card small {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.45;
}

.permission-box input:checked + .permission-card {
  border-color: rgba(13, 148, 136, 0.45);
  background: linear-gradient(180deg, rgba(204, 251, 241, 0.55), #fff);
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.12);
}

.user-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.user-card-head strong {
  display: block;
  color: var(--teal-900);
  margin-bottom: 4px;
}

.users-list {
  display: grid;
  gap: 12px;
  padding-bottom: 20px;
}

.tab.is-active {
  color: #fff;
  background: linear-gradient(145deg, var(--teal-500), var(--teal-700));
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.25);
}

.tab-panel {
  margin-top: 16px;
}

.tab-panel[hidden],
.subtab-panel[hidden] {
  display: none !important;
}

.panel-intro {
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.subtabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.subtabs--three {
  grid-template-columns: 1fr 1fr 1fr;
}

.subtabs--three .subtab {
  font-size: 0.72rem;
  padding: 10px 4px;
  line-height: 1.35;
}

.subtab {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 10px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--teal-800);
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all 0.18s ease;
}

.subtab.is-active {
  color: var(--teal-900);
  background: linear-gradient(180deg, var(--teal-100), #fff);
  border-color: rgba(13, 148, 136, 0.4);
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.12);
}

.upload-grid {
  display: grid;
  gap: 12px;
}

.upload-card {
  padding: 20px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  text-align: center;
}

.upload-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--teal-500), var(--teal-700));
  box-shadow: 0 10px 22px rgba(13, 148, 136, 0.25);
}

.upload-icon--audio {
  background: linear-gradient(145deg, #2dd4bf, #0f766e);
}

.upload-icon--pdf {
  background: linear-gradient(145deg, #14b8a6, #115e59);
}

.upload-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-card h2 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--teal-900);
}

.upload-card > p {
  margin: 0 0 16px;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--muted);
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 240px);
  cursor: pointer;
}

.file-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  text-align: start;
}

.file-list:empty {
  display: none;
}

.file-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.95), #fff);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink);
}

.file-list .file-meta {
  min-width: 0;
}

.file-list .file-name {
  display: block;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-list .file-size {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
}

.file-list .file-badge {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--teal-800);
  background: var(--teal-100);
}

.file-list .media-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

.file-list .media-item-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.file-list .media-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-list .media-delete {
  border: 1px solid rgba(185, 28, 28, 0.25);
  background: rgba(254, 226, 226, 0.7);
  color: #991b1b;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.file-list .media-delete:hover {
  background: #fecaca;
}

.file-list .media-preview {
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
}

.file-list .media-preview video,
.file-list .media-preview audio {
  display: block;
  width: 100%;
}

.file-list .media-preview video {
  max-height: 240px;
  background: #000;
}

.file-list .media-preview--protected {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.file-list .media-preview--protected video {
  pointer-events: auto;
}

.file-list .media-preview--protected video::-webkit-media-controls-enclosure {
  overflow: hidden;
}

.file-list .media-watermark {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.28);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 12px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  background:
    repeating-linear-gradient(
      -18deg,
      transparent 0 48px,
      rgba(255, 255, 255, 0.04) 48px 96px
    );
}

.file-list .media-shield {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.file-list .media-protect-note {
  margin: 0;
  padding: 8px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #92400e;
  background: rgba(254, 243, 199, 0.95);
}

body.media-capture-guard .media-preview--protected video {
  visibility: hidden;
}

body.media-capture-guard .media-preview--protected::after {
  content: "المحتوى محمي";
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: #0f172a;
  color: #fff;
  font-weight: 800;
}

.skill-flow-hint {
  margin: 0 0 12px;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--teal-800);
  font-weight: 700;
}

.skill-catalog-actions {
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(13, 148, 136, 0.28);
  background: rgba(240, 253, 250, 0.85);
  text-align: start;
}

.skill-catalog-actions .btn {
  width: 100%;
}

.skill-lesson-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 6px;
  flex-wrap: wrap;
}

.skill-lesson-title-row h2 {
  margin: 0;
  flex: 1;
  min-width: 140px;
}

.skill-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-hidden-badge {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #92400e;
  background: #fef3c7;
  vertical-align: middle;
}

.skill-lesson.is-skill-hidden {
  opacity: 0.82;
  border-style: dashed;
}

.btn-skill-edit,
.btn-skill-hide,
.btn-skill-show,
.btn-skill-delete {
  flex-shrink: 0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.btn-skill-edit {
  border: 1px solid rgba(13, 148, 136, 0.35);
  background: rgba(204, 251, 241, 0.95);
  color: var(--teal-900);
}

.btn-skill-hide {
  border: 1px solid rgba(146, 64, 14, 0.3);
  background: rgba(254, 243, 199, 0.95);
  color: #92400e;
}

.btn-skill-show {
  border: 1px solid rgba(21, 128, 61, 0.4);
  background: rgba(220, 252, 231, 0.98);
  color: #166534;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

.btn-skill-delete {
  border: 1px solid rgba(185, 28, 28, 0.35);
  background: rgba(254, 226, 226, 0.95);
  color: #991b1b;
}

.btn-skill-edit:hover {
  background: #99f6e4;
}

.btn-skill-hide:hover {
  background: #fde68a;
}

.btn-skill-show:hover {
  background: #bbf7d0;
}

.btn-skill-delete:hover {
  background: #fecaca;
}

.voiceprints-section {
  margin: 0 0 18px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.9), rgba(255, 255, 255, 0.75));
}

.voiceprints-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.voiceprints-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--teal-900);
}

.voiceprint-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.voiceprint-record-status {
  margin: 6px 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #b45309;
}

.voiceprint-card.is-recording {
  outline: 2px solid rgba(220, 38, 38, 0.45);
}

.product-voiceprints {
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px dashed rgba(13, 148, 136, 0.35);
  border-radius: 14px;
  background: rgba(240, 253, 250, 0.65);
  text-align: start;
}

.product-voiceprints-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.voiceprint-card--nested {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  padding: 10px 12px;
}

.voiceprint-card--nested .upload-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 6px;
}

.voiceprint-card--nested h2 {
  font-size: 0.98rem;
}

.lesson-units {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.lesson-unit {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  padding: 12px;
  text-align: start;
}

.lesson-unit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.lesson-unit-head h3 {
  margin: 0;
  font-size: 0.98rem;
  color: var(--teal-900);
}

.lesson-unit-num {
  color: var(--teal-700);
}

.lesson-add-wrap {
  margin-top: 14px;
}

.skill-lesson .skill-part {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  text-align: start;
}

.skill-part-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--teal-900);
}

.skill-quiz-hint,
.quiz-status {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}

.quiz-gate {
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(13, 148, 136, 0.45);
  background: rgba(204, 251, 241, 0.55);
  color: var(--teal-900);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.6;
}

.skill-quiz.is-locked .quiz-take {
  display: none !important;
}

.skill-quiz.is-unlocked {
  border-radius: 12px;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.25);
  padding: 8px;
  background: rgba(240, 253, 250, 0.55);
}

.skill-quiz.is-unlocked .quiz-gate {
  display: none;
}

.quiz-manage {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 10px;
}

.quiz-manage summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--teal-800);
  padding: 6px 2px;
}

.quiz-editor {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.quiz-editor label,
.quiz-question-editor label {
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.quiz-editor input,
.quiz-editor textarea,
.quiz-question-editor input,
.quiz-question-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.quiz-question-editor {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.quiz-q-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-options-edit {
  display: grid;
  gap: 8px;
}

.quiz-editor-actions,
.quiz-take-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quiz-take-form {
  display: grid;
  gap: 12px;
}

.quiz-q {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.quiz-q legend {
  padding: 0 4px;
  font-weight: 800;
  font-size: 0.86rem;
}

.quiz-option {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.quiz-scorecard {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.quiz-scorecard.is-pass {
  background: rgba(220, 252, 231, 0.85);
  border-color: rgba(22, 163, 74, 0.35);
}

.quiz-scorecard.is-fail {
  background: rgba(254, 226, 226, 0.85);
  border-color: rgba(220, 38, 38, 0.3);
}

.quiz-scorecard h4 {
  margin: 0 0 6px;
}

.quiz-details {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.quiz-details li {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.82rem;
}

.quiz-details li.is-correct {
  border-color: rgba(22, 163, 74, 0.35);
}

.quiz-details li.is-wrong {
  border-color: rgba(220, 38, 38, 0.3);
}

.quiz-detail-flags {
  margin-top: 4px;
  font-weight: 800;
  font-size: 0.75rem;
}

.quiz-detail-explain {
  margin-top: 4px;
  color: var(--muted);
}

.quiz-results-board {
  margin-top: 14px;
}

.quiz-results-board h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.quiz-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.quiz-result-row,
.quiz-empty {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.8rem;
}

.quiz-result-row.is-pass {
  background: rgba(240, 253, 244, 0.95);
}

.quiz-result-row.is-fail {
  background: rgba(254, 242, 242, 0.95);
}

.quiz-result-main {
  min-width: 0;
}

.quiz-result-name {
  display: block;
}

.quiz-result-meta,
.quiz-result-grade {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.quiz-result-score {
  text-align: end;
  font-weight: 800;
  white-space: nowrap;
}

.file-list .media-preview audio {
  background: #f8fafc;
  padding: 8px;
}

.file-list .media-preview--pdf {
  background: #f8fafc;
  border: 1px solid var(--line);
  padding: 8px;
  display: grid;
  gap: 8px;
}

.file-list .media-preview--pdf iframe {
  width: 100%;
  height: 280px;
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.file-list .media-open-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal-800);
  text-decoration: none;
}

.file-list .media-open-link:hover {
  text-decoration: underline;
}

/* ---------- Bottom nav ---------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding: 8px 10px calc(8px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: 0 -8px 28px rgba(15, 118, 110, 0.08);
  z-index: 40;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 6px 2px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.nav-item.is-active,
.nav-item:hover {
  color: var(--teal-700);
  background: rgba(204, 251, 241, 0.55);
}

/* ---------- Home without sticky bottom padding tweak ---------- */

.home-footer {
  margin: 22px 18px 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  animation: rise-in 0.6s ease 0.35s both;
}

/* ---------- Motion ---------- */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Supervisor checklist manage ---------- */

.checklist-manage {
  margin-bottom: 18px;
}

.checklist-manage .checklist-item {
  align-items: center;
  gap: 10px;
}

.checklist-manage .checklist-item label {
  flex: 1;
}

.checklist-manage-add {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

@media (min-width: 640px) {
  .checklist-manage-add {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

/* ---------- Cash invoice preview ---------- */

.invoice-preview {
  margin: 8px 0 18px;
  border: 1px solid rgba(13, 148, 136, 0.22);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #f0fdfa 0%, #fff 42%);
}

.invoice-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(13, 148, 136, 0.15);
}

.invoice-preview-head strong {
  color: var(--teal-900);
  font-size: 0.95rem;
}

.invoice-preview-head span {
  font-size: 0.8rem;
  color: #0f766e;
  font-weight: 700;
}

.invoice-preview-table-wrap {
  overflow-x: auto;
}

.invoice-preview table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

.invoice-preview th,
.invoice-preview td {
  padding: 10px 12px;
  border-bottom: 1px solid #e6f2ef;
  text-align: right;
  font-size: 0.86rem;
  vertical-align: top;
}

.invoice-preview th {
  background: #f8fffd;
  color: #115e59;
  font-weight: 800;
}

.invoice-preview-empty {
  text-align: center !important;
  color: #6b8a87;
  padding: 18px 12px !important;
}

.invoice-preview-total--support {
  margin-top: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f172a;
  background: rgba(29, 111, 184, 0.2) !important;
  border: 1px solid rgba(29, 111, 184, 0.35);
  border-radius: 10px;
}

.invoice-preview-total--support span,
.invoice-preview-total--support strong {
  color: #0f172a;
  font-weight: 800;
  background: transparent;
}

.mail-setup {
  margin: 0 0 14px;
  padding: 14px 14px 10px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #dbe3ef;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.mail-setup--warn {
  border-color: #f59e0b;
  background: #fffbeb;
}

.mail-setup--ok {
  border-color: #34d399;
  background: #ecfdf5;
}

.mail-setup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.mail-setup-head strong {
  color: #0f4c81;
}

.mail-setup-head span {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid currentColor;
}

.mail-setup--warn .mail-setup-head span {
  color: #b45309;
}

.mail-setup--ok .mail-setup-head span {
  color: #047857;
}

.invoice-images-box {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px dashed rgba(15, 76, 129, 0.45);
  border-radius: 14px;
  background: #f8fafc;
}

.invoice-images-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.invoice-upload-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 112px;
  padding: 14px 10px;
  border-radius: 14px;
  border: 1px solid #bfdbfe;
  background: #fff;
  color: #0f4c81;
  cursor: pointer;
  text-align: center;
}

.invoice-upload-card strong {
  font-size: 0.95rem;
}

.invoice-upload-card small {
  color: #64748b;
  font-size: 0.75rem;
}

.invoice-upload-icon {
  display: inline-flex;
  color: #1d6fb8;
  margin-bottom: 2px;
}

.invoice-images-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

.invoice-images-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}

.invoice-images-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.invoice-images-remove {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.email-pick-list {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.email-pick-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.email-pick-item input {
  margin-top: 4px;
}

.email-pick-item span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.email-pick-item strong {
  color: #0f4c81;
  font-size: 0.92rem;
}

.email-pick-item small {
  color: #64748b;
  font-size: 0.8rem;
  word-break: break-all;
}

.invoice-preview-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f0fdfa;
  font-size: 0.9rem;
}

.invoice-preview-total strong {
  color: #0f766e;
  font-size: 1rem;
}

/* ---------- Sales stats ---------- */

.stats-periods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.stats-card {
  padding: 14px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(240, 253, 250, 0.95), rgba(255, 255, 255, 0.88));
}

.stats-card h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: #0f766e;
}

.stats-main {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #134e4a;
  line-height: 1.25;
  word-break: break-word;
}

.stats-main small {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}

.stats-sub {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.55;
}

.stats-users {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.stats-user-card {
  padding: 14px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.stats-user-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: #0f172a;
}

.stats-rep-label {
  margin: 0 0 2px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f766e;
}

.stats-rep-amount {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
}

.stats-rep-amount strong {
  display: inline-block;
  color: #134e4a;
  font-size: 1.05rem;
}

.stats-user-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.stats-user-grid div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 0.78rem;
  color: #475569;
}

.stats-user-grid strong {
  color: #0f766e;
  font-size: 0.8rem;
}

@media (max-width: 420px) {
  .stats-periods {
    grid-template-columns: 1fr;
  }
}

/* ---------- Desktop comfort ---------- */

@media (min-width: 768px) {
  .hero {
    padding: 36px 28px 40px;
  }

  .content {
    padding: 26px 22px 10px;
  }

  .module-link:hover {
    border-color: rgba(13, 148, 136, 0.35);
    box-shadow: 0 16px 36px rgba(15, 118, 110, 0.16);
    transform: translateY(-1px);
  }
}
