:root {
  --bg: #f0f3f6;
  --surface: #ffffff;
  --text: #142033;
  --muted: #5f6f82;
  --border: #dbe3ec;
  --primary: #0f766e;
  --primary-hover: #0d9488;
  --primary-soft: rgba(15, 118, 110, 0.12);
  --danger: #dc2626;
  --warn: #d97706;
  --success: #059669;
  --sidebar: #0b1220;
  --sidebar-text: #94a3b8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.04);
  --font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --space: clamp(1rem, 2.5vw, 2rem);
  --content: min(1120px, 100%);
  --touch: 44px;
  --sidebar-w: 15.5rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(15, 118, 110, 0.08), transparent 55%),
    linear-gradient(180deg, #f7f9fb 0%, var(--bg) 40%);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

img, canvas, svg, video { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  background: linear-gradient(180deg, #0b1220 0%, #0f1c2e 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 1.25rem;
  color: #fff;
  text-decoration: none !important;
}

.brand strong {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.brand small { color: var(--sidebar-text); font-size: 0.75rem; }

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }

.nav a {
  color: var(--sidebar-text);
  min-height: 2.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  font-size: 0.92rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
}

.nav a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(15, 118, 110, 0.35); color: #5eead4; font-weight: 600; }

.nav-section {
  margin: 1rem 0.85rem 0.35rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 1rem 0.5rem 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.user-chip span { display: block; color: #e2e8f0; font-size: 0.85rem; font-weight: 600; }
.user-chip small { color: var(--sidebar-text); font-size: 0.7rem; }

.nav-toggle {
  display: none;
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top));
  left: max(0.75rem, env(safe-area-inset-left));
  z-index: 60;
  width: var(--touch);
  height: var(--touch);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: #0b1220;
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  position: relative;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
body.nav-open .nav-toggle-bars { background: transparent; }
body.nav-open .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
body.nav-open .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 35;
  backdrop-filter: blur(2px);
}

.main {
  padding: var(--space);
  padding-bottom: calc(var(--space) + 1.5rem);
  width: var(--content);
  margin: 0 auto;
  min-width: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-header h1 {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.stat-card, .card, .hero-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card { padding: 1rem 1.1rem; }
.stat-label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.35rem; }
.stat-value { font-family: var(--display); font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-warn { border-color: #fcd34d; background: #fffbeb; }
.stat-warn .stat-value { color: var(--warn); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card { padding: 1.15rem; }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.card-header h2 { font-family: var(--display); font-size: 1rem; font-weight: 600; }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 36rem;
}

.table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warn { background: #fef3c7; color: #92400e; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #e8eef4; color: var(--text); }
.btn-secondary:hover { background: #d7e0ea; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef2f6; color: var(--text); }
.btn-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: var(--success); color: #fff; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-sm { min-height: 2.15rem; padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-lg { min-height: 3rem; padding: 0.85rem 1.35rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

.form { display: flex; flex-direction: column; gap: 0.85rem; }
.form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}
.form input, .form select, .form textarea, .search-bar input {
  font-family: inherit;
  font-size: 1rem;
  min-height: var(--touch);
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  width: 100%;
}
.form textarea { min-height: 5rem; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus, .search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; flex-wrap: wrap; }
.form-card { max-width: 40rem; }

.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.search-bar input { flex: 1 1 12rem; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-warn { background: #fef3c7; color: #92400e; }

.empty { color: var(--muted); padding: 1.5rem 0; text-align: center; }
.quick-actions, .actions, .page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.inline { display: inline; }
.link { font-size: 0.85rem; font-weight: 600; }

.filter-pills { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.pill {
  min-height: 2rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--muted);
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
}
.pill.active, .pill:hover { background: var(--primary); color: #fff; }

.supplier-list { display: flex; flex-direction: column; gap: 0.75rem; }
.supplier-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.supplier-item:last-child { border-bottom: none; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding-top: 1rem;
  flex-wrap: wrap;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* Auth */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(800px 400px at 80% 10%, rgba(20, 184, 166, 0.25), transparent 50%),
    linear-gradient(145deg, #0f172a 0%, #134e4a 100%);
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}

.auth-card {
  background: #fff;
  border-radius: 18px;
  padding: clamp(1.35rem, 4vw, 2rem);
  width: min(100%, 24rem);
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand .brand-mark { margin: 0 auto 0.65rem; width: 3.25rem; height: 3.25rem; }
.auth-brand h1 { font-family: var(--display); font-size: 1.45rem; margin: 0.2rem 0; }
.auth-brand p { color: var(--muted); font-size: 0.9rem; margin: 0; }
.auth-hint { text-align: center; margin-top: 1.25rem; font-size: 0.8rem; color: var(--muted); }
.auth-top { display: flex; justify-content: flex-end; margin-bottom: 0.75rem; }

/* Locale switcher */
.locale-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.1);
}
.landing-body .locale-switch,
.auth-body .locale-switch {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}
.sidebar .locale-switch {
  width: 100%;
  justify-content: center;
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}
.locale-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.landing-body .locale-btn,
.auth-body .locale-btn { color: #94a3b8; }
.sidebar .locale-btn { color: var(--sidebar-text); }
.locale-btn:hover {
  background: rgba(15, 118, 110, 0.12);
  color: var(--primary);
  text-decoration: none;
}
.landing-body .locale-btn:hover,
.auth-body .locale-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.sidebar .locale-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.locale-btn.is-active {
  background: var(--primary);
  color: #fff;
}
.landing-body .locale-btn.is-active,
.auth-body .locale-btn.is-active {
  background: #14b8a6;
  color: #0b1220;
}
.sidebar .locale-btn.is-active {
  background: #14b8a6;
  color: #0b1220;
}

/* Dashboard */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.hero-stat {
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 100%);
  color: #fff;
  border: 0;
  padding: clamp(1rem, 2.5vw, 1.35rem) clamp(1rem, 2.5vw, 1.5rem);
}
.hero-stat-accent { background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%); }
.hero-stat-label { display: block; font-size: 0.78rem; opacity: 0.85; margin-bottom: 0.35rem; }
.hero-stat-value {
  font-family: var(--display);
  font-size: clamp(1.35rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  word-break: break-word;
}

.health-bar h2 { font-size: 0.95rem; margin: 0 0 1rem; font-family: var(--display); }
.health-items { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.health-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.health-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.health-ok .health-dot { background: var(--success); }
.health-warn .health-dot { background: var(--warn); }
.health-crit .health-dot { background: var(--danger); }
.health-track { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: #f1f5f9; }
.health-seg.ok { background: var(--success); }
.health-seg.warn { background: var(--warn); }
.health-seg.crit { background: var(--danger); }

.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { padding: 0.65rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.activity-list li:last-child { border-bottom: none; }
.activity-time { display: block; font-size: 0.72rem; color: var(--muted); margin-bottom: 0.15rem; }

.chart-card canvas { max-height: 220px; width: 100% !important; }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; font-size: 0.9rem; }
.detail-list dt { color: var(--muted); }

.scanner-card { margin-bottom: 1rem; }
.scanner-camera { margin-top: 1rem; max-width: 25rem; }
.adjust-buttons { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.stock-take-item { text-align: center; padding: clamp(1rem, 4vw, 2rem); }
.stock-take-compare { display: flex; gap: 1.5rem; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 1.5rem; }
.stock-take-form input { font-size: 1.5rem; text-align: center; width: min(100%, 8rem); }
.transfer-form { grid-template-columns: 2fr 1fr 1fr 1fr auto; align-items: end; }
@media (max-width: 900px) {
  .transfer-form { grid-template-columns: 1fr; }
}

/* Landing */
.landing-body {
  background:
    radial-gradient(900px 420px at 70% -10%, rgba(20, 184, 166, 0.2), transparent 55%),
    linear-gradient(180deg, #0b1220 0%, #0f172a 45%, #10253a 100%);
  color: #e2e8f0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}
.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem var(--space);
  max-width: 1100px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.landing-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: #fff;
}
.landing-logo .brand-mark { width: 2.25rem; height: 2.25rem; }
.landing-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.landing-nav .btn-ghost { color: #cbd5e1; }
.landing-nav .btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }
.landing-hero {
  text-align: center;
  padding: clamp(2.5rem, 8vw, 4.5rem) var(--space) clamp(2rem, 5vw, 3rem);
  max-width: 46rem;
  margin: 0 auto;
}
.hero-badge {
  display: inline-block;
  background: rgba(20,184,166,0.2);
  color: #5eead4;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 1.15rem;
}
.landing-hero h1 {
  font-family: var(--display);
  font-size: clamp(2.1rem, 7vw, 3.2rem);
  color: #fff;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin: 0 0 1rem;
}
.hero-sub { font-size: clamp(1rem, 2.6vw, 1.15rem); color: #94a3b8; margin: 0 0 0.85rem; }
.hero-tagline { color: #64748b; font-size: 0.95rem; margin: 0 0 1.5rem; }
.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.landing-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  max-width: 900px;
  margin: 0 auto 2.5rem;
  padding: 0 var(--space);
}
.landing-stat {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 1.1rem 0.85rem;
  text-align: center;
}
.landing-stat strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: #5eead4;
  margin-bottom: 0.25rem;
}
.landing-stat span { font-size: 0.78rem; color: #94a3b8; }

.landing-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  max-width: 900px;
  margin: 0 auto 2.5rem;
  padding: 0 var(--space);
}
.feature-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 1.15rem 1rem;
  text-align: center;
}
.feature-card .feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 0.65rem;
  border-radius: 0.65rem;
  background: var(--primary-soft);
  border: 1px solid rgba(94,234,212,0.25);
  color: #2dd4bf;
}
.feature-card .feature-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}
.feature-card h3 { font-size: 0.92rem; color: #cbd5e1; margin: 0; font-weight: 500; }

.landing-note {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 2.5rem;
  padding: 0 var(--space);
  color: #94a3b8;
  font-size: 0.9rem;
}
.landing-footer {
  text-align: center;
  padding: 2rem var(--space);
  border-top: 1px solid rgba(255,255,255,0.06);
  color: #64748b;
  font-size: 0.85rem;
}
.landing-footer p { margin: 0 0 0.35rem; }

@media print {
  .sidebar, .nav-toggle, .sidebar-backdrop, .page-header .actions, .page-header a, .btn { display: none !important; }
  .app { display: block; }
  .main { padding: 0; max-width: none; width: 100%; }
}

/* Tablet */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .sidebar-backdrop { display: block; }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(18rem, 86vw);
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 12px 0 40px rgba(0,0,0,0.25);
  }
  body.nav-open .sidebar { transform: translateX(0); }

  .main {
    padding-top: calc(var(--touch) + 1.25rem);
    width: 100%;
  }

  .grid-2,
  .form-grid,
  .hero-stats { grid-template-columns: 1fr; }

  .landing-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Phone */
@media (max-width: 640px) {
  .page-header { align-items: stretch; }
  .page-actions, .page-header > a { width: 100%; }
  .page-actions .btn, .page-header > a.btn { width: 100%; }

  .table { min-width: 0; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
  }
  .table td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    border: 0;
    text-align: right;
  }
  .table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-align: left;
    flex: 0 0 40%;
  }
  .table td.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-top: 0.65rem;
  }
  .table td.actions::before { display: none; }

  .supplier-item { flex-direction: column; }
  .landing-features,
  .email-grid,
  .landing-stats { grid-template-columns: 1fr; }
  .landing-header { justify-content: center; text-align: center; }
  .landing-nav { justify-content: center; width: 100%; }
  .landing-nav .btn { flex: 1 1 auto; }
  .hero-cta .btn { width: min(100%, 18rem); }
}

@media (max-width: 380px) {
  .landing-hero h1 { font-size: 1.85rem; }
  .hero-stat-value { font-size: 1.25rem; }
}
