/* Maya G Solutions Ltd - Freight Management System */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  --page: #f8fafc;
  --surface: #ffffff;
  --ink: #0b1220;
  --text: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #dc2626;
  --accent-hover: #b91c1c;
  --accent-tint: #fef2f2;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 12px 32px rgba(15,23,42,.08);
  --radius: 12px;
  --green: #059669;
  --green-tint: #ecfdf5;
  --amber: #7c3aed;
  --amber-tint: #f5f3ff;
  --red: #dc2626;
  --red-tint: #fef2f2;
  --info: #4f46e5;
  --info-tint: #eef2ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--page);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: 'Manrope', system-ui, sans-serif;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 { font-weight: 800; font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2rem); }
h2 { font-weight: 800; font-size: 1.35rem; }
h3 { font-weight: 700; font-size: 1.05rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }

input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

.field { margin-bottom: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn.secondary:hover { background: var(--page); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

.error-text { color: var(--red); font-size: 0.85rem; margin-top: 8px; min-height: 1.2em; }
.hint-text { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 15%, #1a1005 0%, #0b0705 45%, #050403 100%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #14100d;
  border: 1px solid #2a2118;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 24px 60px rgba(0,0,0,.5);
  padding: 36px 32px;
}

.auth-card img.logo { height: 64px; width: auto; display: block; margin: 0 auto 20px; }
.auth-card h1 { text-align: center; font-size: 1.3rem; margin-bottom: 4px; color: #f8fafc; }
.auth-card .sub { text-align: center; color: #94a3b8; font-size: 0.9rem; margin-bottom: 24px; }

.auth-card label { color: #94a3b8; }
.auth-card input {
  background: #1c1712;
  border: 1px solid #332821;
  color: #f8fafc;
}
.auth-card input:focus {
  border-color: var(--accent);
  outline-color: var(--accent);
}
.auth-card .hint-text { color: #94a3b8; }
.auth-card .hint-text a { color: var(--accent); }
.auth-card .error-text { color: #f87171; }

altcha-widget {
  color-scheme: dark;
  --altcha-color-base: #1c1712;
  --altcha-color-base-content: #f8fafc;
  --altcha-border-color: #332821;
  --altcha-border-radius: 10px;
  --altcha-max-width: 100%;
}

/* ---------- Page loader ---------- */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--page);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}
.page-loader .spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: page-spin 0.7s linear infinite;
}
@keyframes page-spin { to { transform: rotate(360deg); } }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--ink);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  z-index: 40;
  transition: transform .2s ease;
}

.mobile-logo-bar { display: none; }

.sidebar-brand { display: flex; justify-content: flex-start; padding: 2px 4px 16px; }
.sidebar-brand img { height: 52px; width: auto; display: block; }

.nav-toggle {
  display: none;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 10px;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sidebar nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }

.sidebar nav a {
  color: #cbd5e1;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 9px;
}
.sidebar nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: var(--accent); color: #fff; }

.sidebar .user-box {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 14px;
  margin-top: 14px;
}
.sidebar .user-box .name { color: #fff; font-weight: 600; font-size: 0.9rem; }
.sidebar .user-box .role { font-size: 0.78rem; color: #94a3b8; text-transform: capitalize; margin-bottom: 10px; }
.sidebar .user-box button { width: 100%; }

.main {
  flex: 1;
  margin-left: 240px;
  padding: 32px 40px;
  max-width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.topbar .mobile-head { display: none; align-items: center; gap: 12px; }

/* ---------- Dashboard widgets ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card .label { color: var(--muted); font-size: 0.82rem; font-weight: 500; margin-bottom: 8px; }
.stat-card .value { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 1.7rem; color: var(--ink); }
.stat-card.accent-red .value { color: var(--red); }
.stat-card.accent-amber .value { color: var(--amber); }
.stat-card.accent-green .value { color: var(--green); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}
.panel .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.panel .panel-head h3 { margin: 0; }
.panel .panel-body { padding: 4px 0; }
.panel .panel-body.pad { padding: 20px; }

.table-wrap { overflow-x: auto; max-width: 100%; }
.panel { min-width: 0; }
.main { min-width: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 20px;
  background: var(--page);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 14px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--page); }

.empty-row td { text-align: center; color: var(--muted); padding: 32px 20px; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--line);
  color: var(--text);
  white-space: nowrap;
}
.badge.blue { background: var(--info-tint); color: var(--info); }
.badge.green { background: var(--green-tint); color: var(--green); }
.badge.amber { background: var(--amber-tint); color: var(--amber); }
.badge.red { background: var(--red-tint); color: var(--red); }
.badge.grey { background: #f1f5f9; color: var(--muted); }

/* ---------- Toolbar / filters ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar .search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 380px;
}
.toolbar .search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.toolbar .search-box input { padding-left: 36px; }
.toolbar select { width: auto; min-width: 150px; }
.toolbar .spacer { flex: 1; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,18,32,.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  margin: auto;
}
.modal.modal-lg { max-width: 860px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--page); }
.modal-body { padding: 24px; max-height: 70vh; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}
.form-grid .field.full { grid-column: 1 / -1; }
.form-section-title {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 14px 0 4px;
}
.form-section-title:first-child { margin-top: 0; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tabs button {
  background: none;
  border: none;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; overflow-x: hidden; }
.tab-panel.active { display: block; }
.tabs { min-width: 0; }

/* ---------- Detail header ---------- */
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.detail-head .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.detail-head .back-link:hover { color: var(--accent); }
.detail-head h1 { margin-bottom: 4px; }
.detail-head .meta { color: var(--muted); font-size: 0.9rem; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.info-grid .info-block h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 700;
}
.info-grid .info-block p { margin-bottom: 4px; font-size: 0.9rem; }
.info-grid .info-block p.muted { color: var(--muted); }

.mini-stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.mini-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  min-width: 140px;
}
.mini-stat .label { font-size: 0.76rem; color: var(--muted); margin-bottom: 4px; }
.mini-stat .value { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 1.3rem; color: var(--ink); }

.text-link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0;
}
.text-link-btn:hover { text-decoration: underline; }
.row-actions { display: flex; gap: 10px; }
.icon-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--muted);
}
.icon-btn:hover { background: var(--page); color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }

.cards-pad { padding: 20px; }
.customer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.customer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease;
}
.customer-card:hover { box-shadow: var(--shadow); border-color: #cbd5e1; transform: translateY(-1px); }
.customer-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.customer-avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent-tint);
  color: var(--accent);
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.customer-card-actions { display: flex; gap: 6px; }
.customer-card-name { font-size: 1.02rem; margin-bottom: 2px; word-break: break-word; }
.customer-card-contact { color: var(--muted); font-size: 0.85rem; margin-bottom: 12px; }
.customer-card-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--text);
  margin-bottom: 6px;
}
.customer-card-row svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--muted); }
.customer-card-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-card-foot { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}
.pagination .btn { height: 34px; padding: 0 14px; font-size: 0.85rem; }

.dropzone {
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
}
.dropzone:hover { border-color: var(--accent); color: var(--accent); }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
}
.chip button { background: none; border: none; cursor: pointer; color: var(--muted); display: flex; }
.chip button:hover { color: var(--red); }

.banner {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.banner.success { background: var(--green-tint); color: var(--green); }
.banner.error { background: var(--red-tint); color: var(--red); }
.banner button { background: none; border: none; cursor: pointer; color: inherit; }

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 14px; padding: 0 0 20px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item .dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
  margin-top: 4px; flex-shrink: 0; position: relative; z-index: 1;
}
.timeline-item:not(:last-child)::before {
  content: ""; position: absolute; left: 5px; top: 16px; bottom: -4px; width: 2px; background: var(--line);
}
.timeline-item .body { flex: 1; }
.timeline-item .status-name { font-weight: 700; color: var(--ink); font-size: 0.92rem; }
.timeline-item .meta { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.timeline-item .note { color: var(--text); font-size: 0.88rem; margin-top: 4px; }

/* ---------- Status stepper (dropdown-like) ---------- */
.status-select-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Line items table ---------- */
.items-table input, .items-table select { padding: 7px 8px; font-size: 0.85rem; }
.items-table td { padding: 8px 10px; }
.items-table .amount-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals-box { margin-left: auto; max-width: 320px; }
.totals-box .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.9rem; }
.totals-box .row.grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.totals-box .row.balance { font-weight: 700; color: var(--accent); }

/* ---------- Print / PDF documents ---------- */
.print-page {
  background: #fff;
  max-width: 800px;
  margin: 0 auto;
  padding: 48px;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  color: #1e293b;
}
.print-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid var(--ink); padding-bottom: 20px; margin-bottom: 24px; }
.print-logo-band { display: inline-flex; align-items: center; background: var(--ink); border-radius: 0; padding: 0; margin-left: 0; }
.print-logo-band img { height: 90px; width: auto; display: block; }
.print-head .doc-title { text-align: right; }
.print-head .doc-title h2 { font-size: 1.6rem; margin-bottom: 4px; }
.print-head .doc-title .num { color: var(--accent); font-weight: 700; }
.print-company { font-size: 0.82rem; color: #475569; margin-top: 10px; line-height: 1.5; }
.print-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.print-meta-grid h4 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; margin-bottom: 6px; }
.print-meta-grid p { font-size: 0.88rem; margin-bottom: 2px; }
.print-bl-highlight { background: var(--accent-tint); border: 1px solid var(--accent); border-radius: 8px; padding: 10px 16px; margin-bottom: 20px; font-weight: 700; color: var(--accent); }
.print-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 0.85rem; }
.print-table th { text-align: left; background: #f1f5f9; padding: 8px 10px; font-size: 0.72rem; text-transform: uppercase; color: #64748b; border-bottom: 1px solid #cbd5e1; }
.print-table td { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; }
.print-table td.num { text-align: right; }
.print-totals { margin-left: auto; max-width: 280px; margin-bottom: 24px; }
.print-totals .row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.88rem; }
.print-totals .row.grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px; font-weight: 800; font-size: 1.1rem; }
.print-stamp {
  display: inline-block; border: 3px solid var(--green); color: var(--green);
  font-weight: 800; font-size: 1.3rem; padding: 8px 24px; border-radius: 8px;
  transform: rotate(-6deg); text-transform: uppercase; letter-spacing: 0.05em;
  margin: 12px 0;
}
.print-notes { font-size: 0.82rem; color: #475569; margin-top: 16px; white-space: pre-wrap; }
.print-payment-details { background: #f8fafc; border-radius: 8px; padding: 16px; margin-top: 20px; font-size: 0.82rem; }
.print-payment-details h4 { font-size: 0.78rem; text-transform: uppercase; color: #64748b; margin-bottom: 8px; }
.print-payment-details .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.print-actions { display: flex; gap: 10px; justify-content: flex-end; margin: 0 auto 16px; max-width: 800px; padding: 0 20px; box-sizing: border-box; }
.pack-cover { margin-bottom: 32px; }
.pack-cover h2 { font-size: 1.5rem; margin-bottom: 4px; }
.pack-cover .sub { color: #64748b; font-size: 0.9rem; margin-bottom: 20px; }
.pack-cover-stats { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.pack-cover-stats div { background: #f8fafc; border-radius: 8px; padding: 12px 18px; min-width: 140px; }
.pack-cover-stats .label { font-size: 0.72rem; text-transform: uppercase; color: #64748b; margin-bottom: 4px; }
.pack-cover-stats .value { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.pack-item { page-break-before: always; padding-top: 8px; }
.pack-item:first-of-type { page-break-before: auto; }

.terms-page { page-break-before: always; padding-top: 8px; }
.terms-page h3 { font-size: 1.05rem; margin: 0 0 14px; color: #0f172a; }
.terms-page h4 { font-size: 0.85rem; margin: 16px 0 6px; color: #0f172a; }
.terms-page ul { margin: 0 0 4px 18px; padding: 0; }
.terms-page li { font-size: 0.76rem; line-height: 1.55; color: #334155; margin-bottom: 5px; }
.terms-page .terms-tagline { font-size: 0.78rem; font-style: italic; color: #dc2626; text-align: center; margin-top: 20px; }
.pack-file-embed { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pack-file-embed img { display: block; width: 100%; max-height: 900px; object-fit: contain; }
.pack-file-embed iframe { width: 100%; height: 900px; border: none; }
.pack-no-file { color: #94a3b8; font-size: 0.85rem; font-style: italic; margin-top: 12px; }

@media print {
  body * { visibility: hidden; }
  .print-page, .print-page * { visibility: visible; }
  .print-page { position: absolute; top: 0; left: 0; box-shadow: none; margin: 0; padding: 20px; max-width: 100%; }
  .print-actions, .sidebar, .topbar, .app-shell > .sidebar { display: none !important; }
}

/* ---------- Misc ---------- */
.section-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.money { font-variant-numeric: tabular-nums; }
.currency-toggle { display: flex; gap: 8px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.checkbox-row input[type=checkbox] { width: auto; }
.checkbox-row label { margin: 0; }
.doc-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--page); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; font-size: 0.85rem; }
.doc-chip .doc-name { font-weight: 600; color: var(--ink); }
.doc-chip .doc-type { color: var(--muted); font-size: 0.78rem; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.filter-grid .field { margin-bottom: 0; min-width: 0; }
.filter-grid .field input, .filter-grid .field select { min-width: 0; }

/* ---------- Landing page ---------- */
.land-header {
  background: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky;
  top: 0;
  z-index: 50;
}
.land-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.land-brand { display: flex; align-items: center; }
.land-brand img { height: 48px; width: auto; display: block; }
.land-nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
}
.land-nav { display: flex; align-items: center; gap: 24px; }
.land-nav a:not(.btn) { color: #cbd5e1; font-weight: 600; font-size: 0.92rem; }
.land-nav a:not(.btn):hover { color: #fff; text-decoration: none; }
.land-nav .btn { height: 40px; padding: 0 20px; }

.land-hero { padding: 72px 24px 88px; background: var(--page); overflow: hidden; }
.land-hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
}
.land-hero-copy h1 {
  font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem);
  line-height: 1.05;
  margin-bottom: 18px;
}
.land-hero-copy h1 .accent-word { color: var(--accent); }
.land-lead { font-size: 1.1rem; color: var(--muted); max-width: 480px; margin-bottom: 28px; }
.land-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.land-hero-actions .btn { height: 48px; padding: 0 26px; font-size: 1rem; }

.land-hero-visual { position: relative; min-height: 320px; }
.mock-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px 20px;
  position: absolute;
  width: 280px;
  animation: land-float 6s ease-in-out infinite;
}
.mock-card-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.mock-card-title { font-weight: 700; color: var(--ink); font-size: 1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mock-card-figure { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 2rem; color: var(--green); }
.mock-card-sub { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.mock-badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
}
.mock-badge.blue { background: var(--info-tint); color: var(--info); }
.mock-badge.amber { background: var(--amber-tint); color: var(--amber); }
.mock-card-1 { top: 0; left: 40px; z-index: 3; animation-delay: 0s; }
.mock-card-2 { top: 120px; left: 0; z-index: 2; animation-delay: 1.2s; }
.mock-card-3 { top: 220px; left: 90px; z-index: 1; animation-delay: 2.4s; }
@keyframes land-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .mock-card { animation: none; } }

.land-section { padding: 88px 24px; }
.land-section-tint { background: var(--accent-tint); }
.land-section-inner { max-width: 1180px; margin: 0 auto; }
.land-section-head { text-align: center; max-width: 560px; margin: 0 auto 44px; }
.land-section-head h2 { margin-bottom: 10px; }
.land-section-head p { color: var(--muted); font-size: 1.02rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(15,23,42,.08), 0 20px 40px rgba(15,23,42,.12); }
.feature-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--accent-tint);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 0.92rem; }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.step-card { text-align: left; }
.step-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.step-card h3 { margin-bottom: 6px; }
.step-card p { color: var(--muted); font-size: 0.92rem; }

.land-about { text-align: center; max-width: 680px; }
.land-about h2 { margin-bottom: 16px; }
.land-about p { color: var(--muted); font-size: 1.05rem; line-height: 1.7; }

.land-cta { background: var(--ink); padding: 72px 24px; }
.land-cta-inner { text-align: center; }
.land-cta h2 { color: #fff; margin-bottom: 22px; }
.land-cta .btn { height: 48px; padding: 0 30px; font-size: 1rem; }

.land-footer { padding: 28px 24px; text-align: center; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .land-hero-inner { grid-template-columns: 1fr; }
  .land-hero-visual { min-height: 300px; margin-top: 20px; }
}

@media (max-width: 720px) {
  .land-nav-toggle { display: inline-flex; }
  .land-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--ink);
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 24px;
  }
  .land-nav.open { display: flex; }
  .land-nav a:not(.btn) { padding: 10px 0; width: 100%; }
  .land-nav .btn { margin-top: 8px; width: 100%; }
  .land-header-inner { position: relative; }
  .land-hero { padding: 48px 20px 56px; }
  .land-section { padding: 56px 20px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 24px 18px; }
  .nav-toggle { display: inline-flex; }
  .topbar .mobile-head { display: flex; }
  .topbar #page-title-desktop { display: none; }
  .sidebar-brand { display: none; }
  .mobile-logo-bar {
    display: flex;
    justify-content: center;
    padding: 18px 0 22px;
    margin: -24px -18px 20px;
    background: var(--ink);
  }
  .mobile-logo-bar img { height: 46px; width: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-body { max-height: 76vh; }
}

@media (max-width: 1000px) {
  .table-wrap { overflow-x: visible; }
  .table-wrap table thead { display: none; }
  .table-wrap table, .table-wrap table tbody, .table-wrap table tr, .table-wrap table td { display: block; width: 100%; }
  .table-wrap table { border-collapse: separate; }
  .table-wrap table tbody tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 0 0 12px;
    box-shadow: var(--shadow);
  }
  .table-wrap table tbody tr:last-child { margin-bottom: 0; }
  .table-wrap table tbody tr:hover { background: var(--surface); }
  .table-wrap table tbody td {
    border-bottom: 1px dashed var(--line);
    padding: 8px 16px;
    white-space: normal;
    word-break: break-word;
  }
  .table-wrap table tbody td:first-child { padding-top: 14px; font-weight: 700; color: var(--ink); font-size: 0.95rem; }
  .table-wrap table tbody td:last-child { border-bottom: none; padding-bottom: 14px; }
  .table-wrap table tbody td:empty,
  .table-wrap table tbody td[data-label=""] { padding-top: 0; padding-bottom: 14px; }
  .table-wrap table tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
  }
  .table-wrap table tbody td:first-child::before { display: none; }
  .table-wrap table tbody td[data-label=""]::before { display: none; }
  .table-wrap table tbody tr.empty-row { box-shadow: none; border-style: dashed; }
  .table-wrap table tbody tr.empty-row td { text-align: center; padding: 24px 16px; }
  .table-wrap table tbody tr.empty-row td::before { display: none; }
  .panel .table-wrap { padding: 16px; }
}
