/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT — Simunova CRM Design System v2
   App shell · Sidebar · Topbar · Tables · Panels · Responsive
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Uygulama iskeleti ──────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ─── Permission-based nav visibility ────────────────────────────────────── */
.nav-hidden { display: none !important; }

/* Sidebar nav başta görünmez, izinler uygulanınca .perms-ready ile gösterilir */
.sidebar-nav { opacity: 0; transition: opacity .15s; }
.sidebar-nav.perms-ready { opacity: 1; }

/* İzin-gated aksiyon düğmeleri (topbar vb., sidebar dışı): izinler uygulanana dek
   gizli kalır; nav.js applyNavPermissions izin VARSA .perm-ready ekleyip gösterir.
   "Önce görünüp sonra kaybolma" flash'ını önler (Issue #675). Sidebar nav-item'lar
   kendi opacity gate'ini kullandığından hariç tutulur. */
[data-permission]:not(.nav-item):not(.perm-ready) { display: none !important; }

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--c-sidebar);
  background-image: linear-gradient(175deg, var(--c-sidebar) 0%, var(--c-sidebar-2) 100%);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 40;
  border-right: 1px solid var(--c-border);
}

[data-theme="dark"] .sidebar {
  background-image: linear-gradient(175deg, var(--c-sidebar) 0%, var(--c-sidebar-2) 60%, #0D1A2F 100%);
  border-right: 1px solid rgba(255, 255, 255, .04);
}

.sidebar-logo {
  padding: 24px 20px 22px;
  border-bottom: 1px solid var(--c-border);
  text-align: center;
}

.sidebar-logo img {
  filter: none;
}

[data-theme="dark"] .sidebar-logo img {
  /* invert renkli/foto logoları negatife çeviriyordu (#501). Doğal renk +
     açık zemin kutusu: her logo türü koyu sidebar'da okunaklı ve doğru renkte. */
  filter: none;
  background: #fff;
  padding: 6px 10px;
  border-radius: 10px;
}

[data-theme="dark"] .sidebar-logo {
  border-bottom-color: rgba(255, 255, 255, .06);
}

.sidebar-logo .logo-text {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 400;
  color: var(--c-text);
  letter-spacing: .01em;
}

[data-theme="dark"] .sidebar-logo .logo-text {
  color: #fff;
}

.sidebar-logo .logo-sub {
  font-size: .68rem;
  color: var(--c-sidebar-text);
  margin-top: 3px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .6;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  margin: 2px 10px;
  color: var(--c-sidebar-text);
  font-size: .84rem;
  font-weight: 400;
  transition: all var(--duration) var(--ease-out);
  border-radius: 8px;
  border-left: none;
  position: relative;
  letter-spacing: .01em;
}

.nav-item:hover {
  background: rgba(0, 0, 0, .04);
  color: var(--c-text);
}

/* İşlem bekleyen kayıt rozeti (#992) — nav öğesinin sağına yaslı sayı pili */
.nav-badge {
  margin-left: auto;
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--c-accent, #2563eb);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  letter-spacing: 0;
}
.nav-badge[hidden] { display: none; }

[data-theme="dark"] .nav-item:hover {
  background: rgba(255, 255, 255, .07);
  color: #D4DEF0;
}

.nav-item.active {
  background: rgba(30, 159, 255, .08);
  color: var(--c-sidebar-act);
  font-weight: 500;
}

[data-theme="dark"] .nav-item.active {
  background: rgba(77, 180, 255, .12);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--c-sidebar-act);
  box-shadow: 0 0 8px rgba(30, 159, 255, .25);
}

[data-theme="dark"] .nav-item.active::before {
  box-shadow: 0 0 8px rgba(77, 180, 255, .4);
}

.nav-icon {
  width: 20px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: .75;
  transition: opacity var(--duration);
}

.nav-item:hover .nav-icon { opacity: 1; }
.nav-item.active .nav-icon { opacity: 1; }

.nav-icon svg {
  display: block;
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
  background: var(--c-surface-alt);
}

[data-theme="dark"] .sidebar-footer {
  border-top-color: rgba(255, 255, 255, .06);
  background: rgba(0, 0, 0, .08);
}

.sidebar-user {
  font-size: .78rem;
  color: var(--c-sidebar-text);
  margin-bottom: 10px;
}

.sidebar-user span {
  color: var(--c-text);
  font-weight: 500;
  display: block;
  font-size: .82rem;
}

[data-theme="dark"] .sidebar-user span {
  color: #D4DEF0;
}

.sidebar-user-meta {
  font-size: .72rem;
  color: var(--c-text-muted);
  margin-top: 4px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.sidebar-user-meta span {
  display: block;
  color: var(--c-text-2);
  font-weight: 500;
  font-size: .74rem;
}

[data-theme="dark"] .sidebar-user-meta {
  color: rgba(255, 255, 255, .45);
}

[data-theme="dark"] .sidebar-user-meta span {
  color: rgba(255, 255, 255, .6);
}

/* ─── Main content ───────────────────────────────────────────────────────── */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

.topbar {
  border-bottom: 1px solid var(--c-border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  /* Opak zemin — sticky + backdrop-filter blur her scroll karesinde arka planı
     yeniden bulanıklaştırıp jank yaratıyordu (#945). Blur kaldırıldı. */
  background: var(--c-surface, #fff);
  box-shadow: 0 1px 3px rgba(21, 27, 43, .03);
}

[data-theme="dark"] .topbar {
  background: var(--c-surface, #1a1d27);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
  letter-spacing: -.01em;
}

.topbar-breadcrumb {
  font-size: .85rem;
  color: var(--c-text-muted);
  flex: 1;
}

.topbar-breadcrumb a {
  color: var(--c-accent);
  transition: color var(--duration);
}

.topbar-breadcrumb a:hover {
  color: var(--c-accent-dark);
  text-decoration: underline;
}

.page-body {
  flex: 1;
  padding: 24px 28px;
}

/* ─── Login sayfası ──────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0C1526;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(30, 159, 255, .12) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  pointer-events: none;
}

.login-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

/* ─── Stat kartları ──────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stats-row-6 {
  grid-template-columns: repeat(6, 1fr);
}

.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-slow), transform var(--duration-slow);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--c-border-dark);
  border-radius: 0 2px 2px 0;
  transition: background var(--duration-slow);
}

.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.stat-label {
  font-size: .72rem;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 500;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
  color: var(--c-text);
  line-height: 1.1;
}

.stat-card.accent::before {
  background: var(--c-accent);
}

.stat-card.accent .stat-value {
  color: var(--c-accent);
}

.stat-card.success::before {
  background: var(--c-success);
}

.stat-card.success .stat-value {
  color: var(--c-success);
}

.stat-card.warning::before {
  background: var(--c-warning);
}

.stat-card.warning .stat-value {
  color: var(--c-warning);
}

.stat-card.danger::before {
  background: var(--c-danger);
}

.stat-card.danger .stat-value {
  color: var(--c-danger);
}

/* ─── Tablo alanı ────────────────────────────────────────────────────────── */
.table-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.table-toolbar {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--c-border);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: 4px;
}

.table-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .855rem;
}

thead th {
  background: var(--c-surface-alt);
  color: var(--c-text-muted);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 11px 14px;
  border-bottom: 2px solid var(--c-border);
  white-space: nowrap;
  text-align: left;
}

tbody tr {
  border-bottom: 1px solid var(--c-border);
  transition: background var(--duration);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: rgba(241, 243, 249, .4);
}

[data-theme="dark"] tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, .02);
}

tbody tr:hover {
  background: var(--c-accent-soft);
}

tbody td {
  padding: 11px 14px;
  vertical-align: middle;
}

.row-inactive {
  opacity: .45;
}

.row-inactive .company-name {
  text-decoration: line-through;
}

.td-date {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: .78rem;
  color: var(--c-text-muted);
  white-space: nowrap;
}

.td-agent {
  font-size: .82rem;
}

.td-actions {
  white-space: nowrap;
}

.table-placeholder {
  text-align: center;
  padding: 48px 20px !important;
  color: var(--c-text-muted);
  font-size: .9rem;
}

.table-error {
  color: var(--c-danger);
}

/* ─── Sayfalama ──────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-alt);
}

.page-info {
  font-size: .82rem;
  color: var(--c-text-muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ─── Lead detay sayfası ─────────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  align-items: start;
}

.detail-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  font-weight: 600;
  font-size: .92rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--c-surface-alt);
  letter-spacing: -.01em;
}

.panel-body {
  padding: 20px;
}

/* ─── Timeline ───────────────────────────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--c-text-muted);
  font-size: .88rem;
}

.timeline-item {
  display: flex;
  gap: 12px;
  padding: 0 20px 0 20px;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 30px;
  top: 28px;
  bottom: 0;
  width: 1px;
  background: var(--c-border);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-accent);
  border: 2px solid var(--c-surface);
  outline: 2px solid var(--c-accent);
  flex-shrink: 0;
  margin-top: 18px;
}

.sale-dot {
  background: var(--c-success);
  outline-color: var(--c-success);
}

.timeline-card {
  flex: 1;
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 10px 0;
  transition: border-color var(--duration);
}

.timeline-card:hover {
  border-color: var(--c-border-dark);
}

.sale-card {
  border-color: rgba(16, 184, 84, .25);
  background: var(--c-success-soft);
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tl-type {
  font-weight: 500;
  font-size: .85rem;
}

.tl-outcome {
  font-size: .8rem;
  color: var(--c-text-2);
}

.tl-date {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: .75rem;
  color: var(--c-text-muted);
  margin-left: auto;
}

.tl-user {
  font-size: .75rem;
  color: var(--c-text-muted);
}

.tl-amount {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--c-success);
  font-size: .9rem;
}

.tl-note {
  margin-top: 6px;
  font-size: .83rem;
  color: var(--c-text-2);
  line-height: 1.5;
}

/* ─── Meta bilgiler ──────────────────────────────────────────────────────── */
.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  font-size: .8rem;
}

.meta-item label {
  color: var(--c-text-muted);
  display: block;
  margin-bottom: 1px;
}

.meta-item span {
  font-weight: 500;
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, .50);
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, .60);
}

.modal-box {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: modal-enter .25s var(--ease-out);
}

.modal-box.modal-wide {
  max-width: 760px;
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1rem;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── Hamburger butonu ───────────────────────────────────────────────────── */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--c-accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(30, 159, 255, .35);
  transition: all var(--duration) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.hamburger:hover { background: var(--c-accent-dark); }
.hamburger:active { transform: scale(.95); }

/* Sidebar içi kapat butonu */
.sidebar-close-btn {
  display: none;
  width: 100%;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  color: var(--c-text);
  font-size: .85rem;
  cursor: pointer;
  text-align: center;
  transition: background var(--duration);
  -webkit-tap-highlight-color: transparent;
}

.sidebar-close-btn:hover { background: var(--c-accent-soft); }

[data-theme="dark"] .sidebar-close-btn {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
  color: #fff;
}
[data-theme="dark"] .sidebar-close-btn:hover { background: rgba(255,255,255,.12); }

/* Overlay (sidebar açıkken arka plan) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, .50);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 49;
}

.sidebar-overlay.open { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 1024px) ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .page-body {
    padding: 20px 22px;
  }
}

/* ── Mobile (≤ 768px) ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Layout */
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .3s var(--ease-out);
    height: 100vh;
    height: 100dvh;
    top: 0;
    left: 0;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .hamburger {
    display: flex;
  }

  .sidebar-close-btn {
    display: block;
  }

  /* Topbar */
  .topbar {
    padding: 10px 16px;
    gap: 10px;
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .topbar-title {
    font-size: .9rem;
  }

  .topbar-breadcrumb {
    font-size: .78rem;
  }

  /* Page */
  .page-body {
    padding: 16px 16px;
  }

  /* Stats */
  .stats-row,
  .stats-row-6 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 14px 16px;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  /* Detail grid */
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Table toolbar */
  .table-toolbar {
    padding: 12px 16px;
    gap: 8px;
  }

  .table-toolbar .spacer {
    display: none;
  }

  /* Table cells — larger touch targets */
  tbody td {
    padding: 10px 12px;
  }

  thead th {
    padding: 8px 12px;
  }

  /* Modal — bottom sheet style */
  .modal-overlay {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-box {
    max-width: 100% !important;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: modal-slide-up .3s var(--ease-out);
  }

  .modal-body {
    padding: 16px;
  }

  .modal-header {
    padding: 16px 16px 14px;
  }

  /* Login */
  .login-card {
    padding: 28px 22px;
    border-radius: var(--radius);
  }

  /* Form rows stack on mobile */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Small Mobile (≤ 480px) ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .topbar {
    padding: 8px 12px;
    gap: 8px;
  }

  .topbar .btn-sm {
    padding: 5px 10px;
    font-size: .75rem;
  }

  .page-body {
    padding: 12px 12px;
  }

  .table-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }

  .search-input-wrap {
    width: 100%;
  }

  .search-input-wrap input {
    width: 100%;
    min-width: unset;
  }

  .login-card {
    padding: 24px 16px;
    margin: 0 8px;
  }

  .panel-body {
    padding: 14px;
  }

  .panel-header {
    padding: 12px 14px;
    font-size: .88rem;
  }

  /* Pagination */
  .pagination {
    padding: 12px 10px;
    gap: 8px;
  }

  .page-info {
    font-size: .75rem;
  }

  /* Meta grid */
  .meta-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  /* Buttons — bigger touch targets */
  .btn {
    padding: 10px 16px;
    min-height: 40px;
  }

  .btn-sm {
    padding: 7px 12px;
    min-height: 34px;
  }
}

/* ── Touch device optimizations ───────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects that cause sticky states on touch */
  .nav-item:hover {
    background: transparent;
    color: var(--c-sidebar-text);
  }
  .nav-item.active:hover {
    background: rgba(30, 159, 255, .12);
    color: var(--c-sidebar-act);
  }

  /* Larger tap targets */
  .nav-item {
    padding: 12px 20px;
  }

  .btn-icon {
    padding: 8px 10px;
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Disable transform hover effects */
  .stat-card:hover {
    transform: none;
  }

  .btn-primary:hover:not(:disabled),
  .btn-danger:hover:not(:disabled),
  .btn-success:hover:not(:disabled) {
    transform: none;
  }
}

/* ── Safe area support (notched devices) ──────────────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .sidebar-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .modal-overlay {
    padding-bottom: env(safe-area-inset-bottom);
  }

  @media (max-width: 768px) {
    .page-body {
      padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
  }
}

/* ── Print ────────────────────────────────────────────────────────────── */
@media print {
  .sidebar,
  .topbar,
  .hamburger,
  .sidebar-overlay,
  .btn,
  .pagination { display: none !important; }

  .app { grid-template-columns: 1fr; }
  .page-body { padding: 0; }
  .table-panel { border: none; box-shadow: none; }
}
