/* ============================================================
   Recipe Calculator — Master Stylesheet (v5, final)
   - Uniform form controls everywhere (44px height)
   - Grid-based field layout that cannot shrink inputs
   - Responsive: desktop / laptop / tablet / mobile
   - Light + dark tokens
   - Modal, recipe builder, pricing, admin tables, macro cards
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --brand:        #16a34a;
  --brand-dark:   #0f7a37;
  --brand-soft:   #e9f7ee;
  --accent:       #f59e0b;
  --danger:       #dc2626;
  --danger-dark:  #b91c1c;
  --danger-soft:  #fef2f2;
  --warn-soft:    #fef3c7;
  --info-soft:    #eff6ff;

  --text:         #0f172a;
  --text-muted:   #64748b;

  --bg:           #f6f7f9;
  --surface:      #ffffff;
  --surface-2:    #f1f5f9;
  --border:       #e2e8f0;
  --border-strong:#cbd5e1;

  --shadow-sm:    0 1px 2px rgba(15,23,42,.06);
  --shadow:       0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.06);
  --shadow-lg:    0 24px 64px rgba(15,23,42,.25);

  --radius-sm:    10px;
  --radius:       14px;
  --radius-lg:    20px;

  --control-h:    44px;
  --maxw:         1200px;
  --font:         'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --bg:           #0b1220;
  --surface:      #111a2e;
  --surface-2:    #1b2740;
  --border:       #22304d;
  --border-strong:#334155;
  --brand-soft:   #0d2818;
  --shadow-sm:    0 1px 2px rgba(0,0,0,.4);
  --shadow:       0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg:    0 24px 64px rgba(0,0,0,.55);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { max-width: 100%; display: block; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  margin: 0 0 8px;
  line-height: 1.2;
  letter-spacing: -.01em;
}
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: relative;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .5px;
}
.brand-name { font-size: 16px; }

.nav { display: flex; align-items: center; gap: 20px; }
.nav a { color: var(--text); font-weight: 500; font-size: 14px; }
.nav a:hover { color: var(--brand); text-decoration: none; }
.nav-user { color: var(--text-muted); font-size: 13px; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 8px;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- License banner ---------- */
.license-banner {
  background: var(--warn-soft);
  color: #92400e;
  border-bottom: 1px solid #fcd34d;
  padding: 10px 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.main {
  flex: 1;
  padding: 32px 0 60px;
}
.app-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
}
.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  position: sticky;
  top: 88px;
  box-shadow: var(--shadow);
}
.side-link {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.side-link:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.side-link.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 14px;
}

/* ============================================================
   PAGE HEAD
   ============================================================ */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.page-head h1 { font-size: 22px; margin: 0; }
.page-head > div { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   FORM CONTROLS — unified
   ============================================================ */
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="color"],
input[type="file"],
input:not([type]),
select,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: var(--control-h);
  min-height: var(--control-h);
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: calc(var(--control-h) - 3px);
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

textarea {
  height: auto;
  min-height: 110px;
  line-height: 1.5;
  padding: 12px 14px;
  resize: vertical;
}

input[type="file"] {
  height: auto;
  min-height: var(--control-h);
  padding: 8px 12px;
  line-height: 26px;
  cursor: pointer;
}
input[type="color"] { padding: 4px 6px; cursor: pointer; }

select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 15px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
  cursor: pointer;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

input::placeholder,
textarea::placeholder { color: var(--text-muted); opacity: .7; }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .15);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-2);
  opacity: .75;
  cursor: not-allowed;
}
input[readonly],
textarea[readonly] { background: var(--surface-2); }

/* ---------- Field layout ---------- */
.field {
  display: block;
  width: 100%;
  min-width: 0;
  margin-bottom: 14px;
}
.field > input,
.field > select,
.field > textarea { width: 100%; }

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}
.field-row > * { min-width: 0; width: 100%; }
.field-row > .field { margin-bottom: 0; }

.field-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}
.field-row-3 > * { min-width: 0; width: 100%; }
.field-row-3 > .field { margin-bottom: 0; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}
.grid-2 > * { min-width: 0; }

.form-flex {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: end;
}
.form-flex > .field,
.form-flex > input,
.form-flex > select,
.form-flex > textarea {
  flex: 1 1 200px;
  min-width: 0;
}

table.data input,
table.data select,
table.data textarea { width: 100%; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--control-h);
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .05s, background .15s, border-color .15s, color .15s;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); text-decoration: none; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); text-decoration: none; }

.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th,
table.data td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--surface-2); }

/* ============================================================
   FLASH
   ============================================================ */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 14px;
  border: 1px solid transparent;
  line-height: 1.5;
}
.flash-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.flash-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.flash-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-muted    { background: var(--surface-2); color: var(--text-muted); }

/* ============================================================
   HERO
   ============================================================ */
.hero { text-align: center; padding: 72px 0 48px; }
.hero h1 {
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -.02em;
}
.hero p {
  font-size: clamp(15px, 1.6vw, 19px);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 28px;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   FEATURES
   ============================================================ */
.features {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 48px 0;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.feature .ico { font-size: 26px; line-height: 1; }
.feature h3 { margin: 10px 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* ============================================================
   PRICING
   ============================================================ */
.pricing {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 40px 0;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  position: relative;
}
.plan.featured { border-color: var(--brand); border-width: 2px; }
.plan.featured::before {
  content: 'Popular';
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--brand);
  color: #fff;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
}
.plan-name { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.plan-price { font-size: 32px; font-weight: 800; margin: 6px 0 4px; }
.plan-price small { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.plan-price + p.muted {  margin: 4px 0 14px 0; }
.plan ul { list-style: none; padding: 0; margin: 16px 0 22px; flex: 1; }
.plan li { padding: 6px 0; font-size: 14px; color: var(--text-muted); }
.plan li::before { content: '✓ '; color: var(--brand); font-weight: 700; }

/* ============================================================
   MODAL — generic + buy
   ============================================================ */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  z-index: 200;
  overflow: hidden;
}
.modal-back.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalIn .22s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal h2 { margin: 0 0 16px; font-size: 20px; }

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal.buy-modal {
  max-width: 640px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.buy-modal .buy-head { flex-shrink: 0; }
.modal.buy-modal .buy-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal.buy-modal .buy-body::-webkit-scrollbar { width: 8px; }
.modal.buy-modal .buy-body::-webkit-scrollbar-track { background: transparent; }
.modal.buy-modal .buy-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
.modal.buy-modal .buy-body::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.buy-head {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  position: relative;
}
.buy-head h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.buy-head p { margin: 0; font-size: 13px; color: var(--text-muted); }

.buy-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .15s;
}
.buy-close:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.buy-body { padding: 22px 26px 26px; }

.buy-summary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.buy-summary .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
}
.buy-summary .row span:first-child { color: var(--text-muted); }
.buy-summary .row span:last-child  { font-weight: 500; font-variant-numeric: tabular-nums; }
.buy-summary .row.total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 17px;
}
.buy-summary .row.total span:first-child { color: var(--text); font-weight: 700; }
.buy-summary .row.total span:last-child  { color: var(--brand); font-weight: 800; }

.buy-bkash {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border: 1.5px dashed #fca5a5;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 22px;
  position: relative;
}
.buy-bkash::before {
  content: '💳';
  position: absolute;
  top: -12px;
  left: 18px;
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1;
}
.buy-bkash strong {
  display: block;
  color: #dc2626;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.4;
}
.buy-bkash p { margin: 0; font-size: 13px; color: #7f1d1d; line-height: 1.55; }

.buy-section {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 22px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.buy-section::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.buy-section:first-child { margin-top: 0; }

.buy-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.buy-grid .span-2 { grid-column: 1 / -1; }
.buy-grid > * { min-width: 0; }

.buy-body label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.buy-body label .req { color: #dc2626; margin-left: 2px; }

.buy-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 0;
  line-height: 1.5;
}

.buy-submit {
  width: 100%;
  padding: 14px;
  height: auto;
  font-size: 15px;
  font-weight: 700;
  margin-top: 22px;
  border-radius: 12px;
}
.buy-submit:disabled { opacity: .6; cursor: not-allowed; }

.buy-foot {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 14px 0 0;
  line-height: 1.5;
}

/* ============================================================
   SUMMARY ROWS
   ============================================================ */
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
}
.summary-row + .summary-row { border-top: 1px dashed var(--border); }
.summary-row span:first-child { color: var(--text-muted); }
.summary-row span:last-child  { font-weight: 500; text-align: right; }
.summary-row.total {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 12px;
  font-weight: 700;
  font-size: 16px;
}
.summary-row.total span:last-child { color: var(--brand); }

.bkash-note {
  background: #fff1f2;
  border: 1px dashed #fca5a5;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 14px 0;
}
.bkash-note strong { color: #dc2626; }

/* ============================================================
   MACRO CARDS
   ============================================================ */
.macros {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.macro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.macro .label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
}
.macro .value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.macro.carbs   .value { color: #2563eb; }
.macro.protein .value { color: #16a34a; }
.macro.fat     .value { color: #f59e0b; }
.macro.fiber   .value { color: #8b5cf6; }
.macro.cal     .value { color: #dc2626; }

/* ============================================================
   RECIPE BUILDER
   ============================================================ */
.builder-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--surface);
  position: relative;
}
.builder-row > * { min-width: 0; }
.builder-row .field { margin: 0; position: relative; min-width: 0; }

.suggest-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  max-height: 260px;
  overflow-y: auto;
  z-index: 30;
  padding: 4px 0;
}
.suggest-item {
  padding: 9px 14px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.suggest-item:hover,
.suggest-item.active { background: var(--brand-soft); }
.suggest-item .muted { font-size: 12px; }

.rec-total {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 12px;
  line-height: 34px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}
.footer-links a { margin-left: 16px; color: var(--text-muted); }
.footer-links a:hover { color: var(--brand); }

/* ============================================================
   UTILITIES
   ============================================================ */
.muted { color: var(--text-muted); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .side-link { white-space: nowrap; }
}

@media (max-width: 720px) {
  .field-row,
  .field-row-3,
  .grid-2,
  .buy-grid { grid-template-columns: 1fr; }
  .buy-grid .span-2 { grid-column: 1 / -1; }

  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    right: 0;
    left: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 14px 20px;
    gap: 4px;
    box-shadow: 0 12px 24px rgba(0,0,0,.08);
  }
  body.nav-open .nav { display: flex; }
  .nav a { padding: 10px 4px; }

  .hero { padding: 44px 0 32px; }
  .modal { padding: 20px; }

  .builder-row { grid-template-columns: 1fr; }
  .builder-row .field { grid-column: 1 / -1; }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links a:first-child { margin-left: 0; }
}

@media (max-width: 640px) {
  .modal-back { padding: 0; align-items: flex-end; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal.buy-modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .buy-head { padding: 18px 20px 14px; }
  .buy-head h2 { font-size: 18px; }
  .buy-body { padding: 18px 20px 22px; }
  .buy-summary { padding: 14px; }
  .buy-summary .row.total { font-size: 16px; }
  .buy-bkash { padding: 14px; }
  .buy-bkash strong { font-size: 14px; }
}

@media (max-width: 480px) {
  body { font-size: 14px; }
  .container { padding: 0 14px; }
  .card { padding: 16px; }
  .macros { grid-template-columns: 1fr 1fr; }
  .buy-head h2 { font-size: 17px; }
  .buy-section { font-size: 10px; }
}

@media print {
  .topbar, .sidebar, .footer, .nav-toggle, .btn, .flash { display: none !important; }
  .main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ============================================================
   PRICING — support up to 6 cards (1 single + 5 SaaS)
   ============================================================ */
.pricing.pricing-6 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 1200px) {
  .pricing.pricing-6 {
    /* 3 cards per row on desktop for readability */
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1600px) {
  .pricing.pricing-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* Slightly tighter cards when there are 6 in a row */
@media (min-width: 1600px) {
  .pricing-6 .plan { padding: 22px; }
  .pricing-6 .plan-price { font-size: 26px; }
  .pricing-6 .plan li { font-size: 13px; padding: 4px 0; }
}

/* ============================================================
   FOOTER — multi-column layout
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 40px 0 22px;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col a {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  line-height: 1.5;
}
.footer-col a:hover { color: var(--brand); }
.footer-h {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text);
  margin: 0 0 6px;
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-col { align-items: center; }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

