/* =========================================================
   Ten Tech Solutions — account & admin areas
   Builds on styles.css tokens (navy, vivid blue, white).
   Layout: navy top bar, light work surface, cards only where
   an object needs to stand apart (records, forms, counts).
   ========================================================= */

.app-body { background: var(--mist); min-height: 100vh; }

/* ---------- App shell: fixed sidebar + work surface ---------- */
.shell { --side-w: 264px; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; background: var(--paper); border-right: 1px solid var(--line); overflow-y: auto; z-index: 60;
}
.is-admin .sidebar { background: var(--navy-950); border-right-color: rgba(255,255,255,.06); color: #c9d2ff; }
.side-top { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.side-brand { display: inline-flex; padding: 6px 8px; border-radius: 10px; }
.is-admin .side-brand { background: #fff; }
.side-brand img { width: 118px; height: auto; }
.side-badge { font: 600 .66rem/1 var(--font-label); letter-spacing: .06em; text-transform: uppercase; padding: 5px 7px; border-radius: 6px; background: var(--blue-soft); color: var(--blue); }
.is-admin .side-badge { background: rgba(79,123,255,.2); color: #b9caff; }
.side-close { display: none; margin-left: auto; }
.side-label { margin: 14px 12px 6px; font: 600 .68rem/1.2 var(--font-label); letter-spacing: .06em; text-transform: uppercase; color: #8a8fb5; }
.is-admin .side-label { color: #6f76b0; }
.app-nav ul { list-style: none; display: grid; gap: 2px; }
.app-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--ink-2); font-weight: 600; font-size: .96rem; text-decoration: none; position: relative;
  transition: background .15s ease, color .15s ease;
}
.app-nav a .i { width: 19px; height: 19px; color: #7c82ad; transition: color .15s ease; }
.app-nav a:hover { background: var(--mist-2); color: var(--navy); }
.app-nav a[aria-current="page"] { background: var(--blue-soft); color: var(--blue); }
.app-nav a[aria-current="page"] .i { color: var(--blue); }
.app-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); }
.is-admin .app-nav a { color: #c9d2ff; }
.is-admin .app-nav a .i { color: #7f88c7; }
.is-admin .app-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.is-admin .app-nav a[aria-current="page"] { background: linear-gradient(90deg, rgba(79,123,255,.28), rgba(79,123,255,.08)); color: #fff; }
.is-admin .app-nav a[aria-current="page"] .i { color: #8fb0ff; }
.is-admin .app-nav a[aria-current="page"]::before { background: var(--blue-bright); }

.side-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 16px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: inherit; text-decoration: none; font-weight: 600; font-size: .94rem; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.help-card { display: grid; gap: 8px; justify-items: start; padding: 16px; border-radius: 14px; background: linear-gradient(150deg, var(--mist) 0%, var(--blue-soft) 100%); border: 1px solid var(--line); }
.help-card strong { color: var(--navy); }
.help-card p { font-size: .86rem; color: var(--muted); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); min-width: 0; }
.is-admin .user-card { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); }
.user-meta { display: grid; min-width: 0; flex: 1; }
.user-meta strong { font-size: .92rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-admin .user-meta strong { color: #fff; }
.is-admin .user-meta small { color: #8f97cf; }
.avatar { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--navy)); color: #fff; font: 700 .85rem/1 var(--font-body); letter-spacing: .02em; }
.avatar-sm { width: 34px; height: 34px; font-size: .78rem; }
.icon-btn { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.icon-btn:hover { color: var(--blue); border-color: var(--blue); }
.icon-btn .i { width: 18px; height: 18px; }
.is-admin .sidebar .icon-btn { background: transparent; border-color: rgba(255,255,255,.12); color: #c9d2ff; }
.is-admin .sidebar .icon-btn:hover { color: #fff; border-color: #fff; }

.shell-main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px clamp(16px, 3vw, 36px);
  background: rgba(245,247,253,.85); -webkit-backdrop-filter: saturate(1.5) blur(12px); backdrop-filter: saturate(1.5) blur(12px); border-bottom: 1px solid var(--line);
}
.side-open, .topbar-logo { display: none; }
.topbar-logo img { width: 104px; height: auto; }
.topbar-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .92rem; color: var(--muted); }
.topbar-crumb .i { transform: rotate(-90deg); width: 14px; height: 14px; }
.topbar-crumb strong { color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar .btn-sm { gap: 6px; }

.app-main { flex: 1; padding: clamp(20px, 3vw, 36px) clamp(16px, 3vw, 36px) 64px; }
.app-main > .wrap { max-width: 1240px; margin-inline: auto; padding-inline: 0; }
.app-main:focus { outline: none; }

.side-scrim { display: none; }
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 30px 60px -20px rgba(7,4,52,.5); visibility: hidden; }
  body.side-open .sidebar { transform: none; visibility: visible; }
  .side-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(7,4,52,.45); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.side-open .side-scrim { opacity: 1; pointer-events: auto; }
  body.side-open { overflow: hidden; }
  .side-close { display: inline-grid; }
  .side-open, .topbar-logo { display: inline-flex; }
  .topbar-crumb { display: none; }
}
@media (max-width: 560px) {
  .topbar-hide-sm { display: none; }
  .topbar .avatar-sm { display: none; }
}

/* ---------- Welcome banner ---------- */
.welcome {
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: clamp(22px, 3.5vw, 36px); margin-bottom: 22px; border-radius: 20px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #3557ff 0%, rgba(53,87,255,0) 55%), linear-gradient(135deg, var(--navy) 0%, var(--navy-950) 100%);
  box-shadow: 0 24px 48px -28px rgba(23,7,135,.7);
}
.welcome::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); mask-image: linear-gradient(90deg, transparent, #000 70%); }
.welcome-text { display: grid; gap: 6px; max-width: 40rem; }
.welcome-eyebrow { font: 600 .74rem/1.3 var(--font-label); letter-spacing: .06em; text-transform: uppercase; color: #b9caff; }
.welcome h1 { font-size: var(--step-3); font-weight: 700; color: #fff; }
.welcome p:last-child { color: #d6deff; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.welcome-actions .btn { gap: 8px; }
@media (max-width: 560px) { .welcome-actions, .welcome-actions .btn { width: 100%; } }

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: var(--step-3); font-weight: 700; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 46rem; }
.crumb { font-size: var(--step--1); margin-bottom: 8px; display: inline-flex; gap: 6px; align-items: center; }
.crumb a { color: var(--blue); text-decoration: none; font-weight: 600; }

/* Surfaces */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); padding: clamp(18px, 3vw, 28px); display: grid; gap: 16px; min-width: 0; }
.panel h2 { font-size: var(--step-2); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: grid; gap: 20px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

/* Counts */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat {
  --tone: var(--blue); --tone-bg: var(--blue-soft);
  position: relative; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px;
  display: grid; gap: 6px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tone); opacity: .9; }
a.stat:hover { border-color: var(--tone); box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-navy { --tone: var(--navy); --tone-bg: #ece9ff; }
.stat-amber { --tone: #d97706; --tone-bg: #fff4e0; }
.stat-green { --tone: var(--ok); --tone-bg: var(--ok-bg); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--tone-bg); color: var(--tone); }
.stat-icon .i { width: 20px; height: 20px; }
.stat-label { font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.stat-num { font: 700 2.3rem/1.05 var(--font-display); color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-sub { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.stat-sub .i { width: 14px; height: 14px; opacity: 0; transform: translateX(-4px); transition: opacity .15s ease, transform .15s ease; }
a.stat:hover .stat-sub .i { opacity: 1; transform: none; color: var(--tone); }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { padding: 14px; gap: 4px; border-radius: 14px; }
  .stat-icon { width: 30px; height: 30px; border-radius: 9px; }
  .stat-icon .i { width: 16px; height: 16px; }
  .stat-top { align-items: flex-start; }
  .stat-label { font-size: .8rem; line-height: 1.25; }
  .stat-num { font-size: 1.8rem; }
  .stat-sub { font-size: .75rem; }
  .stat-grid-3 .stat-icon, .stat-grid-3 .stat-sub { display: none; }
}

/* Quick actions & start cards */
.quick-list { display: grid; gap: 4px; }
.quick { display: flex; align-items: center; gap: 14px; padding: 10px; margin-inline: -10px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.quick:hover { background: var(--mist); }
.quick-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); }
.quick-icon .i { width: 20px; height: 20px; }
.quick-text { display: grid; min-width: 0; flex: 1; }
.quick-text strong { color: var(--navy); font-weight: 700; }
.quick-text small { color: var(--muted); font-size: .84rem; }
.quick-arrow { width: 16px; height: 16px; color: var(--muted); transition: transform .15s ease, color .15s ease; }
.quick:hover .quick-arrow { transform: translateX(3px); color: var(--blue); }
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.start-card { display: grid; gap: 6px; align-content: start; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(180deg, #fff 0%, var(--mist) 100%); color: var(--ink); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.start-card:hover { border-color: var(--blue); box-shadow: var(--shadow); transform: translateY(-2px); }
.start-card .quick-icon { margin-bottom: 6px; }
.start-card strong { color: var(--navy); }
.start-card small { color: var(--muted); font-size: .86rem; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font: 600 .72rem/1 var(--font-label); letter-spacing: .06em; text-transform: uppercase; color: var(--ok); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px var(--ok-bg); }

/* Tables become cards on narrow screens */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow-sm); }
.panel .table-wrap { box-shadow: none; }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th { text-align: left; font: 600 .75rem/1.2 var(--font-label); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; background: #f8f9fe; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover td { background: #f6f8ff; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
table.data a.row-link { color: inherit; text-decoration: none; }
@media (max-width: 720px) {
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.data td { border: 0; padding: 3px 0; }
  table.data td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .8rem; font-weight: 600; }
  table.data .num { text-align: left; }
}

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters .field { min-width: 0; flex: 1 1 180px; }
.filters .field-search { flex: 3 1 240px; }
.filters label { font-size: var(--step--1); }

/* Status pills — state shown by colour and text */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 600 .78rem/1.5 var(--font-body); white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-new, .pill-submitted { background: #e8eeff; color: #1d3fc4; border-color: #c9d6ff; }
.pill-in_progress, .pill-under_review { background: #fff4e0; color: #8a5300; border-color: #f1d6a4; }
.pill-awaiting_customer { background: #fdf0ff; color: #7a2391; border-color: #ecc8f5; }
.pill-proposal_ready, .pill-published, .pill-resolved { background: var(--ok-bg); color: var(--ok); border-color: #b9e3cf; }
.pill-closed, .pill-archived, .pill-draft { background: #eef0f6; color: #4b4f75; border-color: #dde1f2; }
.pill-cancelled, .pill-spam { background: var(--bad-bg); color: var(--bad); border-color: #f2c4c0; }
.pill-quote { background: #e8eeff; color: var(--navy); }
.pill-fixed { background: #eef0f6; color: var(--navy); }

/* Record details */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; }
.facts dt { color: var(--muted); font-size: var(--step--1); font-weight: 600; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.notice { padding: 14px 16px; border-radius: 12px; background: #f6f8ff; border: 1px solid #d7defa; color: var(--ink); font-size: .95rem; }
.notice-warn { background: var(--warn-bg); border-color: #f1d6a4; }
.notice-ok { background: var(--ok-bg); border-color: #b9e3cf; }
.notice-bad { background: var(--bad-bg); border-color: #f2c4c0; }
.internal { background: #fffbea; border: 1px solid #f0e2a8; border-radius: 14px; padding: 16px; display: grid; gap: 12px; }
.internal h3 { font-size: 1rem; display: flex; gap: 8px; align-items: center; }
.internal-tag { font: 600 .7rem/1.4 var(--font-label); letter-spacing: .06em; text-transform: uppercase; color: #7a5b00; background: #fbefc0; padding: 2px 8px; border-radius: 6px; }

/* Conversation */
.thread { display: grid; gap: 12px; }
.msg { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); max-width: 46rem; }
.msg-admin { background: #f1f4ff; border-color: #d7defa; }
.msg-meta { font-size: .8rem; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.msg-meta strong { color: var(--navy); }
.note { padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid #f0e2a8; }

/* Timeline */
.timeline { list-style: none; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 16px 24px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { display: block; font-size: .8rem; color: var(--muted); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.field .check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.field .check input { width: 20px; height: 20px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.radio-card { position: relative; }
.radio-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio-card span { display: grid; gap: 2px; padding: 14px 16px; border: 1.5px solid #c7cdea; border-radius: 14px; background: var(--paper); cursor: pointer; height: 100%; }
.radio-card strong { color: var(--navy); }
.radio-card small { color: var(--muted); }
.radio-card input:checked + span { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,79,242,.15); }
.radio-card input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Empty, loading, error */
.empty { display: grid; justify-items: start; gap: 12px; padding: clamp(24px, 5vw, 44px); border: 1.5px dashed #c7cdea; border-radius: 16px; background: var(--paper); }
.empty h2 { font-size: var(--step-2); }
.empty p { color: var(--muted); max-width: 40rem; }
.loading { display: flex; gap: 12px; align-items: center; color: var(--muted); padding: 24px 0; }
.loading::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--blue); animation: spin .8s linear infinite; }
.error-box { padding: 16px; border-radius: 14px; background: var(--bad-bg); border: 1px solid #f2c4c0; color: var(--bad); display: grid; gap: 10px; justify-items: start; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 100; background: var(--navy-950); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 16px 40px -16px rgba(0,0,0,.5); font-weight: 600; max-width: calc(100vw - 32px); }
.toast-bad { background: var(--bad); }

/* Pagination */
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--muted); font-size: var(--step--1); }

/* Activity list */
.activity { list-style: none; display: grid; }
.activity li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.activity li:last-child { border-bottom: 0; }
.activity-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); }
.activity-icon .i { width: 17px; height: 17px; }
.act-signup { background: var(--ok-bg); color: var(--ok); }
.act-customer_message { background: #fdf0ff; color: #7a2391; }
.act-status { background: #fff4e0; color: #8a5300; }
.activity .what { min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.activity .when { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.activity a { color: var(--ink); text-decoration: none; font-weight: 600; }
.activity a:hover { color: var(--blue); }
.empty-soft { border-style: solid; background: var(--mist); }

/* Simple pages (404, no access) */
.simple-body { display: flex; flex-direction: column; }
.simple-bar { display: flex; align-items: center; min-height: 68px; padding-inline: var(--gutter); background: var(--paper); border-bottom: 1px solid var(--line); }
.simple-bar img { width: 130px; height: auto; }

/* Auth pages: brand panel + form */
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); min-height: 100vh; }
.auth-aside {
  overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  position: sticky; top: 0; height: 100vh; padding: clamp(28px, 4vw, 56px); color: #fff;
  background: radial-gradient(90% 70% at 100% 0%, #3557ff 0%, rgba(53,87,255,0) 60%), radial-gradient(80% 60% at 0% 100%, rgba(56,189,248,.25) 0%, rgba(56,189,248,0) 60%), linear-gradient(160deg, var(--navy) 0%, var(--navy-950) 100%);
}
.auth-aside::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(circle at 70% 40%, #000, transparent 75%); mask-image: radial-gradient(circle at 70% 40%, #000, transparent 75%); }
.auth-logo { align-self: flex-start; display: inline-flex; padding: 10px 14px; border-radius: 14px; background: #fff; }
.auth-logo img { width: 140px; height: auto; }
.auth-pitch { display: grid; gap: 16px; max-width: 30rem; }
.auth-badge { justify-self: start; padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(185,202,255,.35); font: 600 .72rem/1.2 var(--font-label); letter-spacing: .06em; text-transform: uppercase; color: #b9caff; }
.auth-pitch h2 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); font-weight: 700; line-height: 1.1; color: #fff; }
.auth-pitch > p { color: #d6deff; }
.auth-points { list-style: none; display: grid; gap: 12px; margin-top: 8px; }
.auth-points li { display: flex; align-items: center; gap: 12px; color: #eef2ff; }
.auth-points .i { flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.1); color: #8fb0ff; }
.auth-legal { font-size: .82rem; color: #9aa3d6; }
.auth-side { display: flex; flex-direction: column; background: var(--mist); min-width: 0; }
.auth-top { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 20px clamp(16px, 3vw, 36px); }
.auth-top .btn { gap: 6px; }
.i-back { transform: rotate(180deg); }
.auth-logo-sm { display: none; margin-right: auto; }
.auth-logo-sm img { width: 120px; height: auto; }
.auth-wrap { flex: 1; display: grid; place-items: center; padding: 8px var(--gutter) 56px; }
.auth-wrap > .wrap { width: 100%; padding: 0; display: grid; justify-items: center; }
.auth-card { width: min(100%, 440px); background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); padding: clamp(24px, 5vw, 40px); display: grid; gap: 18px; }
.auth-card h1 { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.2rem); font-weight: 700; }
.auth-card form { display: grid; gap: 16px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: var(--step--1); }
.auth-links a { color: var(--blue); font-weight: 600; text-decoration: none; }
.auth-foot { text-align: center; font-size: var(--step--1); color: var(--muted); }
.auth-foot a { color: var(--blue); font-weight: 600; }
.simple-body .auth-wrap { padding-top: 40px; }
@media (max-width: 900px) {
  .auth-split { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .auth-logo-sm { display: inline-flex; }
  .auth-top { justify-content: space-between; background: var(--paper); border-bottom: 1px solid var(--line); padding-block: 12px; }
  .auth-wrap { padding-top: 28px; }
}
.code-input { font: 600 1.6rem/1 var(--font-mono) !important; letter-spacing: .3em; text-align: center; }
.qr { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 8px; }
.secret { font-family: var(--font-mono); font-size: .95rem; padding: 10px 12px; border-radius: 10px; background: var(--mist); overflow-wrap: anywhere; user-select: all; }
.backup-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; font-family: var(--font-mono); padding: 12px; border-radius: 12px; background: var(--mist); }
.steps-list { display: grid; gap: 14px; padding-left: 20px; }

.muted-link { color: var(--muted); }
.small-print { font-size: .82rem; color: var(--muted); }
.danger-zone { border-color: #f2c4c0; }
.btn-danger { --btn-bg: var(--paper); --btn-fg: var(--bad); --btn-border: #f2c4c0; }
.btn-danger:hover { --btn-bg: var(--bad-bg); --btn-border: var(--bad); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .88rem; }

.field-label { font-weight: 600; }
.tablist .tab-link { display: inline-flex; align-items: center; color: var(--muted); font-weight: 600; padding: 10px 18px; border-radius: 999px; text-decoration: none; min-height: 44px; }
.tablist .tab-link:hover { color: var(--navy); }
.tablist .tab-link[aria-current="page"] { background: var(--navy); color: #fff; }
.panel .plan-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); max-width: none; }


/* =========================================================
   Store: buy, cart, checkout, orders, my services
   ========================================================= */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.center { text-align: center; }
.panel h2 .i { width: 22px; height: 22px; color: var(--blue); margin-right: 8px; vertical-align: -3px; }
.test-mode { display: block; }
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--blue); color: #fff; font: 700 .74rem/1.5 var(--font-body); text-align: center; }
.is-account .app-nav a[aria-current="page"] .nav-count { background: var(--blue); }

.buy-search { display: flex; gap: 10px; }
.buy-search input { flex: 1; min-width: 0; font: 500 1.05rem/1.2 var(--font-body); }
.buy-search .btn { gap: 8px; flex: none; }
.tld-prices { display: flex; flex-wrap: wrap; gap: 8px; }
.tld-chip { display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--mist); color: var(--ink); cursor: pointer; font: 500 .9rem/1.2 var(--font-body); }
.tld-chip strong { font-family: var(--font-body); color: var(--navy); }
.tld-chip span { color: var(--muted); }
.tld-chip:hover { border-color: var(--blue); background: var(--blue-soft); }
.buy-hit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-radius: 14px; background: var(--ok-bg); border: 1px solid #b9e3cf; }
.buy-hit-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.buy-hit-name .i { color: var(--ok); }
.buy-hit-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.buy-hit-actions select { width: auto; min-width: 200px; }
.buy-hit-actions .btn, .shop-card .btn { gap: 8px; }
@media (max-width: 560px) { .buy-search { flex-direction: column; } .buy-hit-actions, .buy-hit-actions select, .buy-hit-actions .btn { width: 100%; } }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.shop-card { position: relative; display: grid; gap: 12px; align-content: start; padding: 22px 20px 20px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, #fff 0%, var(--mist) 100%); }
.shop-card-featured { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,79,242,.12); }
.shop-card .plan-badge { position: absolute; top: -11px; left: 18px; }
.shop-card h3 { font-size: 1.15rem; color: var(--navy); }
.shop-price strong { font: 700 1.7rem/1 var(--font-display); color: var(--navy); }
.shop-price span { color: var(--muted); font-size: .9rem; }
.spec-list { list-style: none; display: grid; gap: 6px; font-size: .92rem; }
.spec-list li { display: flex; gap: 8px; align-items: flex-start; }
.spec-list .i { color: var(--ok); width: 16px; height: 16px; margin-top: 3px; }
.shop-fields { display: grid; gap: 10px; }
.shop-fields label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--ink-2); }

.cart-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .cart-layout { grid-template-columns: minmax(0, 1fr); } }
.cart-lines { list-style: none; display: grid; }
.cart-line { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line-bad { background: var(--bad-bg); margin-inline: -12px; padding-inline: 12px; border-radius: 10px; }
.cart-desc { flex: 1; min-width: 0; display: grid; gap: 4px; overflow-wrap: anywhere; }
.item-note { color: var(--ink-2, #3a3f5c); background: #fff7e6; border: 1px solid #f3d9a4; border-radius: 10px; padding: 10px 12px; }
.item-fix { display: grid; gap: 6px; margin-top: 6px; }
.item-fix-row { display: flex; gap: 8px; flex-wrap: wrap; }
.item-fix-row .control { flex: 1 1 220px; min-width: 0; }
.cart-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-summary { position: sticky; top: 84px; }
.summary-lines { list-style: none; display: grid; gap: 10px; font-size: .92rem; }
.summary-lines li { display: flex; justify-content: space-between; gap: 12px; }
.summary-lines strong { white-space: nowrap; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .total { font-weight: 700; color: var(--navy); font-size: 1.15rem; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; line-height: 1.5; }
.check input { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.btn-khalti { --btn-bg: #5c2d91; --btn-fg: #fff; --btn-border: #5c2d91; }
.btn-khalti:hover { --btn-bg: #4a2275; --btn-border: #4a2275; }
@media (max-width: 720px) { .cart-line { flex-wrap: wrap; } .cart-summary { position: static; } }

.setting-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-of-type { border-bottom: 0; }
.setting-row > div { flex: 1 1 240px; }
.expiry-warn { color: var(--warn); font-weight: 700; }
.mono-soft { font-family: var(--font-mono); font-size: .9rem; }
.renew-panel select { width: auto; min-width: 160px; }

/* Store statuses */
.pill-pending_payment, .pill-pending, .pill-processing, .pill-paid { background: #fff4e0; color: #8a5300; border-color: #f1d6a4; }
.pill-completed, .pill-done, .pill-active { background: var(--ok-bg); color: var(--ok); border-color: #b9e3cf; }
.pill-attention, .pill-failed, .pill-manual { background: #fdf0ff; color: #7a2391; border-color: #ecc8f5; }
.pill-expired, .pill-refunded, .pill-inactive, .pill-deleted, .pill-suspended { background: var(--bad-bg); color: var(--bad); border-color: #f2c4c0; }

/* Admin store */
.status-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); font-size: .88rem; }
.status-chip strong { color: var(--navy); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot-ok { background: var(--ok); } .dot-warn { background: #d97706; } .dot-bad { background: var(--bad); }
table.data input[type=number], table.data input[type=text] { width: 110px; min-height: 36px; padding: 6px 8px; }
table.data input[type=checkbox] { width: 20px; height: 20px; }
table.data tbody tr.no-click { cursor: default; }
table.data tbody tr.no-click:hover td { background: inherit; }
.events { list-style: none; display: grid; gap: 6px; font-size: .85rem; }
.events li { display: flex; gap: 10px; }
.events .when { color: var(--muted); width: 150px; flex: none; font-variant-numeric: tabular-nums; }

.control { padding: 10px 12px; font-size: .95rem; }
.control[aria-invalid="true"] { border-color: var(--bad); }
.buy-search .control { padding: 12px 14px; font: 500 1.05rem/1.2 var(--font-body); }
table.data .control { width: 110px; padding: 6px 8px; }
.inline-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--blue); color: #fff; font: 700 .74rem/1 var(--font-body); }
.btn-primary .inline-count { background: #fff; color: var(--blue); }
.shop-card-focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(29,79,242,.25); }
.store-state strong { display: block; margin-bottom: 4px; }
.reason-list { margin: 6px 0 0 18px; display: grid; gap: 4px; }

/* ---------- Mobile hardening ---------- */
@media (max-width: 760px) {
  .welcome-eyebrow { font-size: .75rem; }
  .auth-card a, .auth-links a { display: inline-flex; align-items: center; min-height: 40px; }
  .check { min-height: 40px; }
  .crumb a, .page-crumb a { display: inline-flex; align-items: center; min-height: 36px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}
@media (max-width: 720px) {
  .cart-line { align-items: flex-start; column-gap: 10px; row-gap: 8px; }
  .cart-line > .cart-desc { flex: 1 1 100%; }
  .cart-line > .cart-amt { margin-left: auto; }
}
@media (max-width: 560px) {
  .tablist { display: flex; width: 100%; }
  .tablist .tab-link { flex: 1 1 auto; justify-content: center; padding: 8px 12px; font-size: .9rem; }
}

/* Admin → Products & prices: collapsible sections, instant saves */
.prod-finder { position: sticky; top: 72px; z-index: 5; padding: 10px 0; background: var(--mist, #f5f7fd); }
.prod-section { padding: 0; overflow: hidden; }
.prod-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; cursor: pointer; list-style: none; }
.prod-summary::-webkit-details-marker { display: none; }
.prod-summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; margin-left: 8px; color: var(--muted, #4b4f75); }
.prod-section[open] > .prod-summary::after { transform: rotate(-135deg); }
.prod-title { font-weight: 700; font-size: 1.15rem; color: var(--ink, #0f1035); margin-right: auto; }
.prod-count { font-size: .9rem; color: var(--muted, #4b4f75); background: var(--mist, #f5f7fd); padding: 4px 10px; border-radius: 999px; }
.prod-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 22px 12px; }
.prod-section .table-wrap { border-top: 1px solid var(--line, #e1e5f3); }
tr.prod-off td:not(:first-child) { opacity: .55; }
.prod-state { display: block; min-height: 1.2em; font-size: .8rem; font-weight: 600; }
.prod-state-ok { color: var(--ok, #0e7a4f); }
.prod-state-bad { color: var(--bad, #b3261e); }

/* Team members: photo thumbnails and live preview (photos are linked from other sites) */
.team-cell { display: flex; align-items: center; gap: 12px; }
.team-thumb { position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, var(--blue, #2148f5), var(--navy, #170787)); color: #fff; font-weight: 700; font-size: .85rem; }
.team-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.team-preview { display: flex; align-items: center; gap: 16px; padding: 12px; border: 1px dashed var(--line, #d9dcef); border-radius: 14px; }
.team-preview-frame { flex: none; width: 96px; height: 96px; border-radius: 14px; overflow: hidden; background: var(--mist, #f3f5fd); }
.team-preview-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
.team-preview.is-empty .team-preview-frame img { display: none; }
.team-preview p { margin: 4px 0 0; }
.text-ok { color: #0f7a45; }
.text-bad { color: #b42318; }

/* AI assistant (enquiries) */
.ai-panel { border-color: color-mix(in srgb, var(--blue, #2148f5) 22%, var(--line, #d9dcef)); background: linear-gradient(180deg, color-mix(in srgb, var(--blue, #2148f5) 4%, #fff), #fff 140px); }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.ai-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.ai-badge { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; color: var(--blue, #2148f5); background: color-mix(in srgb, var(--blue, #2148f5) 10%, #fff); }
.ai-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.ai-more { margin: 6px 0 10px; }
.ai-more > summary { cursor: pointer; font-size: .9rem; color: var(--muted, #5b6080); padding: 4px 0; }
.ai-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0; }
.ai-result { display: grid; gap: 8px; margin: 10px 0; }
.ai-out { width: 100%; min-height: 220px; font-size: .95rem; line-height: 1.55; resize: vertical; }
.ai-out[aria-busy="true"] { background: repeating-linear-gradient(90deg, #f4f6fd 0 40%, #eceffb 50%, #f4f6fd 60% 100%); background-size: 300% 100%; animation: ai-shimmer 1.4s linear infinite; }
@keyframes ai-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .ai-out[aria-busy="true"] { animation: none; } }
.ai-meta { margin: 0; }
.ai-actions { margin-top: 0; }
.steps-list { margin: 4px 0 12px; padding-left: 20px; display: grid; gap: 2px; }
@media (max-width: 600px) { .ai-opts { grid-template-columns: 1fr; } .ai-buttons .btn { flex: 1 1 auto; } }

/* Staff & access */
.user-role { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #c9d6ff; background: rgba(255,255,255,.1); width: max-content; }
.user-meta { display: grid; }
.pill-ok { background: var(--ok-bg); color: var(--ok); border-color: #b9e3cf; }
.pill-info { background: #e8eeff; color: #1d3fc4; border-color: #c9d6ff; }
.pill-warn { background: #fff4e0; color: #8a5300; border-color: #f1d6a4; }
.pill-bad { background: var(--bad-bg); color: var(--bad); border-color: #f2c4c0; }
.staff-cell { display: flex; align-items: center; gap: 12px; }
.you-tag { margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: .7rem; font-weight: 700; color: var(--blue); background: #e8eeff; vertical-align: middle; }
.control-sm { padding: 6px 30px 6px 10px; min-height: 36px; font-size: .9rem; width: auto; }
.row-tools { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.btn-danger-text { color: var(--bad); }
.role-fieldset { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
.role-fieldset legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.role-cards { display: grid; gap: 10px; }
.role-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s; }
.role-card:hover { border-color: #b9c6f5; }
.role-card:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(33,72,245,.12); background: #f7f9ff; }
.role-card input { margin-top: 3px; accent-color: var(--blue); }
.role-card-body { display: grid; gap: 2px; }
.role-card-body small { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-cell .i { width: 18px; height: 18px; color: var(--ok); }
.perm-no { color: #a5a9c4; }
@media (max-width: 760px) { .perm-table td.perm-cell { text-align: right; } }
.staff-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1180px) { .staff-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.staff-table td:first-child { min-width: 260px; }
.perm-table td:first-child { min-width: 200px; }
.perm-table th:not(:first-child), .perm-table td.perm-cell { width: 90px; }
.perm-table th, .perm-table td { padding-left: 10px; padding-right: 10px; }
.perm-table th:not(:first-child) { letter-spacing: .02em; }

/* eSewa / offline payment (eSewa green) */
.btn-esewa { --btn-bg: #41a124; --btn-fg: #fff; --btn-border: #41a124; }
.btn-esewa:hover { --btn-bg: #368a1d; --btn-border: #368a1d; }
.esewa-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 10px; border-radius: 8px; background: #41a124; color: #fff; font: 800 1.05rem/1 var(--font-display, inherit); vertical-align: middle; flex: none; }
.pay-methods { border: 0; padding: 0; margin: 4px 0 14px; display: grid; gap: 10px; min-width: 0; }
.pay-methods legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.pay-option { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pay-option input { margin-top: 4px; }
.pay-option-body { display: grid; gap: 2px; }
.pay-option-body small { color: var(--muted); }
.pay-khalti:has(input:checked) { border-color: #5c2d91; box-shadow: 0 0 0 3px rgba(92,45,145,.14); }
.pay-offline:has(input:checked) { border-color: #41a124; box-shadow: 0 0 0 3px rgba(65,161,36,.16); }
.pay-khalti input { accent-color: #5c2d91; } .pay-offline input { accent-color: #41a124; }
.esewa-box { border-color: #b9dfae; background: linear-gradient(180deg, #f3fbef, #fff 160px); }
.esewa-head { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; }
.esewa-head h2 { margin: 0; }
.esewa-head .esewa-mark { width: 40px; height: 40px; font-size: 1.4rem; border-radius: 12px; }
.esewa-head p { margin: 2px 0 0; }
.esewa-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 720px) { .esewa-grid:has(.esewa-qr) { grid-template-columns: 240px minmax(0, 1fr); } }
.esewa-qr { margin: 0; display: grid; gap: 6px; justify-items: center; padding: 10px; border: 1px solid #d4ebcc; border-radius: 16px; background: #fff; }
.esewa-qr img { width: 220px; height: auto; max-width: 100%; border-radius: 8px; }
.esewa-qr figcaption { font-size: .85rem; color: var(--muted); }
.esewa-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; margin: 0; align-items: center; }
.esewa-details dt { color: var(--muted); font-size: .9rem; }
.esewa-details dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.esewa-amount { font-size: 1.25rem; }
.esewa-ref { font-size: 1.05rem; padding: 2px 8px; border-radius: 8px; background: #eef8ea; color: #1f5e0f; }
.copy-btn { padding: 4px 8px; min-height: 30px; font-size: .82rem; }
.esewa-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: .95rem; }
.esewa-warning { margin: 16px 0; }
.esewa-claim { display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.esewa-claim label { font-weight: 600; }
.offline-approve { border-color: #b9dfae; }
.offline-approve h2 { display: flex; align-items: center; }
.offline-cancel { margin-top: 14px; }
.offline-cancel > summary { cursor: pointer; color: var(--muted); font-size: .92rem; }
.offline-cancel > .stack { margin-top: 10px; }
.offline-settings h2 { display: flex; align-items: center; }
.qr-admin { display: flex; gap: 16px; align-items: flex-start; margin: 14px 0; padding: 14px; border: 1px dashed var(--line); border-radius: 14px; }
.qr-frame { flex: none; width: 120px; height: 120px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); }
.qr-frame img { width: 100%; height: 100%; object-fit: contain; }
.qr-empty { color: var(--muted); font-size: .85rem; background: var(--mist, #f3f5fd); }
.stack-sm { display: grid; gap: 4px; }
.stack-sm p { margin: 0; }
@media (max-width: 520px) { .qr-admin { flex-direction: column; } .esewa-details { grid-template-columns: 1fr; } }

/* Portfolio (admin) */
.pf-admin-cell { display: flex; align-items: center; gap: 12px; }
.pf-admin-thumb { flex: none; width: 72px; height: 46px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue, #2148f5), var(--navy, #170787)); color: #fff; font-weight: 700; font-size: .8rem; border: 1px solid var(--line, #e3e6f3); }
.pf-admin-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pf-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; margin-top: 10px; }
.pf-admin-img { margin: 0; display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line, #e3e6f3); border-radius: 12px; background: #fff; }
.pf-admin-img img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line, #e3e6f3); }
.pf-admin-img .row-tools { justify-content: flex-start; align-items: center; }
.pf-cover-tag { padding: 3px 9px; border-radius: 999px; background: #e8f6ee; color: #0f7a45; font-size: .75rem; font-weight: 700; }
.pf-sale-box { padding: 14px; border: 1px dashed var(--line, #e3e6f3); border-radius: 12px; }
.pf-admin-img { min-width: 0; }
.pf-admin-img .row-tools { flex-wrap: wrap; gap: 2px; }
.pf-admin-img .row-tools .btn { padding-left: 8px; padding-right: 8px; }

/* ---------- Facebook ads (client area) ---------- */
.btn-facebook { --btn-bg: #0866ff; --btn-fg: #fff; --btn-border: #0866ff; }
.btn-facebook:hover { --btn-bg: #0757d9; --btn-border: #0757d9; }
.connect-card { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 22px; }
.connect-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: #0866ff; color: #fff; font: 800 2rem/1 var(--font-display); }
.connect-card .ticks { margin: 0; padding: 0; }
@media (max-width: 560px) { .connect-card { grid-template-columns: minmax(0, 1fr); } }
.conn-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.conn-bar.notice-bad { background: var(--bad-bg); border-color: #f2c4c0; }
.conn-who { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.conn-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ads-toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 20px; }
.ads-picker { min-width: min(100%, 320px); margin: 0; }
.ads-range { flex-wrap: wrap; }
.ad-list { list-style: none; margin: 0; padding: 0; display: grid; }
.ad-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 380px); gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.ad-card:first-child { border-top: 0; padding-top: 4px; }
.ad-thumb { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--mist-2); border: 1px solid var(--line); }
.ad-thumb-empty { display: grid; place-items: center; color: var(--navy); }
.ad-thumb-empty .i { width: 26px; height: 26px; }
.ad-main { display: grid; gap: 6px; min-width: 0; }
.ad-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ad-title strong { color: var(--navy); overflow-wrap: anywhere; }
.ad-text { color: var(--ink-2); font-size: .92rem; overflow-wrap: anywhere; }
.ad-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.ad-metrics div { background: var(--mist); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.ad-metrics dt { font-size: .74rem; color: var(--muted); font-weight: 600; }
.ad-metrics dd { margin: 2px 0 0; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; font-size: .92rem; overflow-wrap: anywhere; }
.ads-facts { grid-template-columns: max-content minmax(0, 1fr); }
.ads-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pill-closed { background: #eef0f6; color: #4b4f75; border-color: #dde1f2; }
@media (max-width: 900px) {
  .ad-card { grid-template-columns: 60px minmax(0, 1fr); }
  .ad-thumb { width: 60px; height: 60px; }
  .ad-metrics { grid-column: 1 / -1; }
}
@media (max-width: 420px) { .ad-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.meta-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-row code { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; padding: 8px 10px; border-radius: 8px; background: var(--mist); border: 1px solid var(--line); font: .85rem/1.4 var(--font-mono); }
/* Facebook ads: Pages */
.ads-h { font-size: var(--step-2); }
.page-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.page-card { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "pic info arrow" "fig fig fig"; gap: 12px 14px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color .15s ease, transform .15s ease; }
.page-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.page-card > .page-pic { grid-area: pic; }
.page-card > .i { grid-area: arrow; color: var(--muted); }
.page-pic { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: var(--mist-2); }
.page-pic-empty { display: grid; place-items: center; font: 700 1.4rem/1 var(--font-display); color: var(--navy); }
.page-info { grid-area: info; display: grid; gap: 2px; min-width: 0; }
.page-info strong { color: var(--navy); overflow-wrap: anywhere; }
.page-info small, .page-figures small { color: var(--muted); }
.page-figures { grid-area: fig; display: grid; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.page-spend { font: 700 1.35rem/1.2 var(--font-display); color: var(--navy); font-variant-numeric: tabular-nums; }
.page-head-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
/* Facebook ads: Ad Center style */
.ac-summary .ac-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ac-sum-item { display: grid; gap: 4px; padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.ac-sum-item span { font-size: .82rem; color: var(--muted); font-weight: 600; }
.ac-sum-item strong { font: 700 1.5rem/1.1 var(--font-display); color: var(--navy); font-variant-numeric: tabular-nums; }
.ac-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-filter { min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink-2); font: 600 .9rem/1 var(--font-body); cursor: pointer; }
.ac-filter[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.ac-list { display: grid; gap: 14px; }
.ac-card { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); display: grid; }
.ac-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ac-top .btn { margin-left: auto; }
.ac-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .88rem; color: var(--muted); }
.ac-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.ac-active { color: var(--ok); }
.ac-paused, .ac-review { color: var(--warn); }
.ac-issue { color: var(--bad); }
.ac-meta { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.ac-body { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 14px 16px; }
.ac-text { display: grid; gap: 4px; min-width: 0; }
.ac-text strong { color: var(--ink); }
.ac-text p { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ac-thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; border: 1px solid var(--line); }
.ac-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.ac-stats div { display: grid; gap: 2px; min-width: 0; }
.ac-stats strong { font: 700 1.15rem/1.2 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.ac-stats span { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.ac-details { padding: 14px 16px; border-top: 1px dashed var(--line); background: var(--mist); border-radius: 0 0 16px 16px; display: grid; gap: 10px; }
@media (max-width: 560px) { .ac-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
