/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Aesop Warm palette - cream + terracotta + olive */
  --primary: #a56e51;
  --primary-dark: #8f5b3f;
  --primary-light: #f6f0e3;
  --primary-soft: #f0eadc;
  --accent: #c58a6d;
  --secondary: #8a8a6d;

  --bg: #f0eadc;
  --surface: #fbf7ee;
  --surface-soft: #f6f0e3;
  --border: #e2d9c8;
  --border-strong: #d2c6ae;

  --text: #2b2825;
  --text-muted: #5a534b;
  --text-light: #625a51;

  --success: #4a6a4a;
  --success-soft: rgba(74, 106, 74, 0.08);
  --warning: #a56e51;
  --warning-soft: rgba(197, 138, 109, 0.12);
  --danger: #8a3d3d;
  --danger-soft: rgba(138, 61, 61, 0.06);

  --shadow-sm: 0 1px 0 rgba(43, 40, 37, 0.03);
  --shadow: 0 1px 0 rgba(43, 40, 37, 0.04);
  --shadow-lg: 0 4px 16px rgba(43, 40, 37, 0.06);
  --shadow-xl: 0 12px 32px rgba(43, 40, 37, 0.08);

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  --sidebar-w: 248px;

  /* Aesop Warm type stack */
  --font-display: 'Suez One', serif;
  --font-latin: 'Fraunces', serif;
}

html, body {
  font-family: 'Assistant', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body { direction: rtl; }

/* Snappier taps everywhere: kill Chrome's grey flash, allow same-frame click */
button, a, .btn, .nav-item, .upload-area, .result-field, .copy-icon-btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* WCAG focus rings on every interactive element */
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, .upload-area:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-dark); }

button { font-family: inherit; cursor: pointer; }

/* ========== Layout: Sidebar + Main ========== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-logo {
  padding: 4px 10px 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.sidebar-logo img {
  max-width: 100%;
  max-height: 60px;
  object-fit: contain;
}
.sidebar-logo .default-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
}
.sidebar-logo .default-mark .icon {
  width: 34px; height: 34px;
  background: var(--text);
  color: #fbf7ee;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.sidebar-logo .default-mark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: -.01em;
}
.customer-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}
.nav-item {
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s;
}
.nav-item:hover {
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}
.nav-item.active {
  background: var(--primary-light);
  color: var(--text);
  font-weight: 700;
  border-right: 3px solid var(--primary);
  padding-right: 9px;
}
.nav-item .icon { font-size: 16px; opacity: 0.85; }

.sidebar-footer {
  padding: 12px 4px 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.user-info {
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-info:hover { background: var(--surface-soft); }
.user-info .name { font-weight: 600; color: var(--text); font-size: 13px; }
.user-info .email { font-size: 11px; color: var(--text-light); }
.user-info .edit-hint { font-size: 11px; color: var(--primary); margin-top: 4px; opacity: 0.8; }

.logout-btn {
  margin-top: 6px;
  width: 100%;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}
.logout-btn:hover { background: var(--danger-soft); border-color: var(--danger); }

.main {
  flex: 1;
  padding: 32px 40px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* ========== Headings (matched to landing) ========== */
.page-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 400;
  margin-bottom: 6px;
  letter-spacing: -.015em;
  line-height: 1.15;
  color: var(--text);
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 28px;
  font-weight: 300;
  max-width: 640px;
  line-height: 1.6;
}

/* ========== Cards (warmer, stronger contrast on cream bg) ========== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: none;
  border: 1px solid var(--border);
  margin-bottom: 18px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-strong); }
.card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 16px;
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.2;
}

/* ========== Forms ========== */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: all 0.15s;
}
.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: var(--text-muted); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(165, 110, 81, 0.18);
}
.form-input:disabled { background: var(--surface-soft); color: var(--text-light); cursor: not-allowed; }
.form-textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ========== Buttons (matched to landing page) ========== */
.btn {
  min-height: 44px;                       /* WCAG tap target */
  padding: 11px 22px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .06s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  letter-spacing: .01em;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Primary = terracotta on cream (same as landing hero CTA) */
.btn-primary {
  background: var(--primary);
  color: #fbf7ee;
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }

/* Secondary = ghost with ink outline that fills on hover (landing style) */
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--text);
  color: #fbf7ee;
  border-color: var(--text);
}

.btn-success { background: var(--success); color: #fbf7ee; border-color: var(--success); }
.btn-success:hover:not(:disabled) { background: #3a5638; border-color: #3a5638; }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fbf7ee; }

.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; min-height: 36px; padding: 6px 10px; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-soft); color: var(--text); }

.btn-block { width: 100%; }
.btn-lg { min-height: 52px; padding: 15px 28px; font-size: 15px; font-weight: 600; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 12.5px; gap: 4px; }

/* Mobile menu toggle */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--text);
  color: #fbf7ee;
  border: 1px solid var(--text);
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: background .18s ease;
}
.mobile-menu-btn:hover, .mobile-menu-btn:focus-visible { background: var(--primary-dark); }

/* Mobile brand bar - hidden on desktop, appears at top on mobile.
   Shows the customer logo/name so it's ALWAYS visible even when the
   sidebar (which normally holds the logo) is off-screen. */
.mobile-brand-bar {
  display: none;
}
.mobile-brand-bar img.mobile-brand-logo {
  height: 34px;
  max-width: 170px;
  object-fit: contain;
  display: block;
}
.mobile-brand-bar .mobile-brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.15;
}
.mobile-brand-bar .mobile-brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--text); color: #fbf7ee;
  border-radius: 6px;
  font-size: 15px;
}

/* ========== Login page ========== */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--surface-soft) 100%);
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px 36px 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}
.login-logo {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
  letter-spacing: -0.4px;
}
.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 14px;
}
.login-customer-logo {
  text-align: center;
  margin-bottom: 18px;
}
.login-customer-logo img { max-width: 200px; max-height: 80px; object-fit: contain; }
.login-customer-name {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
  text-align: center;
  font-weight: 600;
}

/* ========== Tables ========== */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.table th {
  background: var(--surface-soft);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.4px;
}
.table tr:hover td { background: var(--surface-soft); }

/* ========== Badges ========== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge-admin { background: rgba(165, 110, 81, 0.14); color: var(--primary-dark); }
.badge-user { background: rgba(138, 138, 109, 0.16); color: #5a5a3e; }
.badge-active { background: var(--success-soft); color: var(--success); }
.badge-inactive { background: var(--danger-soft); color: var(--danger); }
.badge-couple { background: rgba(197, 138, 109, 0.18); color: var(--primary-dark); }

/* ========== Result fields (readable, warm) ========== */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.result-field {
  background: var(--surface);
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.15s, background 0.15s;
}
.result-field:hover { border-color: var(--border-strong); background: var(--surface-soft); }
.result-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.result-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: .12em;
}
.copy-icon-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  border-radius: 5px; color: var(--text-light);
  display: inline-flex; align-items: center; transition: all 0.15s;
}
.copy-icon-btn:hover { background: var(--primary-light); color: var(--primary-dark); }
.copy-icon-btn.copied { color: var(--success); background: var(--success-soft); }
.copy-icon-btn svg { width: 14px; height: 14px; }
.copy-icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.result-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  line-height: 1.4;
}
.result-value.empty { color: var(--text-light); font-style: italic; font-weight: 400; }

/* ========== Upload area ========== */
.upload-area {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 44px 24px;
  text-align: center;
  background: var(--surface-soft);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.upload-area:hover, .upload-area.drag-over {
  background: var(--primary-light);
  border-color: var(--primary);
}
.upload-area.has-image { padding: 14px; background: var(--surface); }
.upload-area .upload-icon-big {
  font-size: 44px;
  opacity: 0.55;
  margin-bottom: 10px;
}
.upload-area .upload-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -.01em;
}
.upload-area .upload-subtext {
  color: var(--text-muted);
  font-size: 12.5px;
  letter-spacing: .04em;
}
.preview-img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
}

/* ========== Loading ========== */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 20px; color: var(--primary); font-weight: 600;
  font-size: 14px;
}

/* ========== Alerts ========== */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
  border: 1px solid transparent;
}
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: rgba(138, 61, 61, 0.3); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(74, 106, 74, 0.3); }
.alert-info { background: var(--primary-light); color: var(--primary-dark); border-color: var(--border-strong); }
.alert-warning { background: var(--warning-soft); color: var(--primary-dark); border-color: rgba(197, 138, 109, 0.35); }

/* ========== Tabs ========== */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.tab.active { color: var(--text); border-bottom-color: var(--primary); font-weight: 700; }
.tab:hover:not(.active) { color: var(--text); background: var(--surface-soft); }

/* ========== Modal ========== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(43, 40, 37, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
  backdrop-filter: blur(3px);
  animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 34px;
  max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-strong);
  animation: slideUp 0.2s;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 18px;
  color: var(--text);
  letter-spacing: -.015em;
  line-height: 1.2;
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px;
}

/* ========== Spouse cards ========== */
.spouse-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.spouse-card {
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.spouse-card.has-scan { border-color: var(--success); background: var(--success-soft); }
.spouse-card-title {
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

/* ========== Video ========== */
video {
  width: 100%;
  border-radius: var(--radius);
  max-height: 360px;
  background: #000;
}

/* ========== Footer ========== */
.app-footer {
  margin-top: auto;
  padding: 24px 16px 12px;
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  background: transparent;
}
.app-footer a { color: var(--primary); font-weight: 600; }
.login-footer {
  text-align: center;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-light);
}
.login-footer a { color: var(--primary); font-weight: 600; }

/* ========== Logo upload area in settings ========== */
.logo-upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  background: var(--surface-soft);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}
.logo-upload-zone:hover, .logo-upload-zone.drag-over {
  background: var(--primary-light);
  border-color: var(--primary);
}
.logo-upload-zone .icon { font-size: 32px; margin-bottom: 8px; opacity: 0.6; }
.logo-upload-zone .label { font-weight: 600; font-size: 13px; color: var(--text); }
.logo-upload-zone .hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.logo-preview {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); padding: 18px;
  border-radius: var(--radius); border: 1px solid var(--border);
  margin-bottom: 12px;
}
.logo-preview img { max-height: 80px; max-width: 280px; object-fit: contain; }

/* ========== Responsive: Tablet & Mobile ========== */
@media (max-width: 900px) {
  .main { padding: 24px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .spouse-cards { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --sidebar-w: 260px; }

  .mobile-menu-btn { display: inline-flex; }

  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    /* Higher than the brand bar (45) and the hamburger (50) so it appears
       on TOP of both when it slides in from the right. */
    z-index: 60;
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(43, 40, 37, 0.4);
    /* Above brand bar (45) and hamburger (50) but below the sidebar (60)
       so the dimmed backdrop covers the whole app area when sidebar is open. */
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

  /* Mobile brand bar - full width now that the hamburger is removed. Shows
     logo/name on the right and admin (⚙️) + logout (🚪) buttons on the left. */
  .mobile-brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    height: 44px;
    padding: 4px 6px 4px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    z-index: 45;
    overflow: hidden;
  }
  .mobile-brand-bar .mobile-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .mobile-brand-bar .mobile-brand-start {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;                 /* allow ellipsis */
    overflow: hidden;
  }
  .mobile-brand-bar .mobile-brand-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-brand-bar .mobile-logout-btn {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .mobile-brand-bar .mobile-logout-btn:active {
    background: var(--danger-soft);
    transform: scale(0.96);
  }

  .main {
    padding: 72px 16px 20px;    /* was 60 — bumped to clear the brand bar */
    max-width: 100%;
  }

  .page-title { font-size: 20px; }
  .page-subtitle { font-size: 13px; margin-bottom: 18px; }

  .card { padding: 18px 16px; border-radius: var(--radius); }

  .table th, .table td { padding: 8px 10px; font-size: 12px; }
  .table th { font-size: 10px; }

  .btn { font-size: 13px; padding: 9px 14px; }
  .btn-lg { font-size: 14px; padding: 11px 18px; }

  .modal { padding: 22px 18px; border-radius: var(--radius); }

  .upload-area { padding: 24px 14px; }
  .upload-area .upload-icon-big { font-size: 30px; }

  .result-grid { grid-template-columns: 1fr; }

  .login-card { padding: 28px 22px; border-radius: var(--radius-lg); }
  .login-logo { font-size: 19px; }
}

@media (max-width: 480px) {
  .main { padding: 56px 12px 16px; }
  .card { padding: 14px 12px; }
  .page-title { font-size: 18px; }
  .modal { padding: 18px 14px; }
  .table { font-size: 12px; }
  /* Make tables horizontally scrollable on tiny screens */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Print friendliness */
@media print {
  .sidebar, .mobile-menu-btn, .app-footer, .btn { display: none !important; }
  .main { padding: 0; }
}
