/* ==============================================
   MUSLIM APPS - COMPACT LAYOUT
   Spacing-only layer: tighter padding/margins and full-width content so
   users scroll less. Loaded LAST from base_navbar.html (after page <style>
   blocks), so equal-specificity rules here win. It must not change display,
   positioning, colors or visibility. To roll back, remove its <link>.
   ============================================== */

/* ---------- Shared tokens (used by global-standards.css) ---------- */
:root {
  --spacing-md: 0.6rem;
  --spacing-lg: 0.9rem;
  --spacing-xl: 1.2rem;
  --spacing-2xl: 1.8rem;
  --input-padding: 0.35rem 0.6rem;
  --input-height-md: 34px;
  --btn-padding-md: 0.4rem 0.85rem;
  --btn-padding-lg: 0.55rem 1.1rem;
}

/* ---------- Page container: use the full width ---------- */
main.container {
  max-width: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0.5rem 0.75rem !important;
  gap: 0.5rem !important;
  min-height: 0;
}
body.sidebar-docked main.container,
body.sidebar-collapsed main.container {
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
}

/* Desktop shows a fixed breadcrumb bar under the sub-nav, but the body offset in
   navbar.css only covers navbar + sub-nav. Reserve its height so content isn't
   tucked underneath it (the old generous padding used to hide this). */
@media (min-width: 969px) {
  main.container {
    padding-top: calc(var(--breadcrumb-height, 28px) + 0.5rem) !important;
  }
}

/* ---------- Text rhythm ---------- */
body { line-height: 1.45; }
h2, .heading-2 { margin-top: 0; margin-bottom: 0.5rem; }
h3, .heading-3, h4, .heading-4 { margin-top: 0; margin-bottom: 0.35rem; }
p, .text-body { line-height: 1.45; margin-bottom: 0.5rem; }
label, .form-label { margin-bottom: 0.2rem; }

/* ---------- Cards / tiles / sections ---------- */
.tile, .card, .section-card, .dashboard-card, .stat-card {
  padding: 0.6rem 0.75rem;
  gap: 0.4rem;
}

/* ---------- Forms (input padding comes from --input-padding above, so
   page classes that reserve room for icons still win) ---------- */
.form-group { margin-bottom: 0.5rem; }
.form-row { gap: 0.6rem; margin-bottom: 0.5rem; }
textarea { min-height: 72px; }

/* ---------- Tables ---------- */
thead th { padding: 0.45rem 0.6rem; }
tbody td { padding: 0.4rem 0.6rem; }

/* ---------- Tabs ---------- */
.nav-tabs, .tab-nav { margin-bottom: 0.5rem; }
.nav-tab { padding: 0.45rem 0.8rem; }

/* ---------- Modals ---------- */
.modal-overlay { padding: 0.75rem; }
.modal-header, .modal-footer { padding: 0.6rem 0.9rem; }
.modal-body { padding: 0.75rem 0.9rem; }
.modal-footer { gap: 0.5rem; }

/* ---------- Alerts ---------- */
.alert { padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  main.container { padding: 0.5rem !important; }
}

/* ---------- Phone: edge-to-edge content, keep comfortable tap targets ---------- */
@media (max-width: 768px) {
  main.container {
    padding: 0.4rem !important;
    border-radius: 0 !important;
  }
  .tile, .card, .section-card, .dashboard-card, .stat-card { padding: 0.5rem 0.6rem; }
  .form-row { gap: 0.4rem; }
  .modal-overlay { padding: 0.25rem; }
  thead th, tbody td { padding: 0.35rem 0.45rem; }
  /* Inputs stay at least 36px tall for comfortable tapping */
  :root { --input-height-md: 36px; }
}
