/* IMS prototype styles, matched to "Portal_All pages" PDF.
   Layout: soft yellow blob background, one white rounded frame per portal,
   left sidebar of outlined buttons, orange gradient column headers. Light theme only for now. */
:root {
  color-scheme: light;
  --bg: #fffdf2;
  --blob: #fff4a8;
  --blob-2: #fff9cf;
  --panel: #ffffff;
  --ink: #4a4a4a;
  --ink-strong: #2e2e2e;
  --ink-soft: #8a8a8a;
  --line: #e2ddd5;
  --line-soft: #efebe4;
  --field: #efefef;
  --field-line: #cfcfcf;
  --row: #f1f1f1;
  --orange: #f08a24;
  --orange-deep: #e47414;
  --orange-mid: #f7a35c;
  --orange-soft: #fbc893;
  --orange-wash: #fff3e6;
  --grad: linear-gradient(90deg, #f59a4a 0%, #f9b878 55%, #fbc893 100%);
  --grad-btn: linear-gradient(90deg, #f39a45 0%, #fbbd85 100%);
  --red: #e3161d;
  --amber: #f7941d;
  --green: #3bb54a;
  --grey-dot: #b9b9b9;
  --link: #3b2bb3;
  --locked: #e6e6e6;
  --shadow: 0 6px 18px rgba(80, 60, 30, 0.12);
  --shadow-btn: 0 3px 8px rgba(0, 0, 0, 0.16);
  --font: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-ar: 'Amiri', 'Traditional Arabic', 'Times New Roman', serif;
  --font-ur: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', serif;
  --radius: 26px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 34% 30% at 6% 8%, var(--blob) 0%, transparent 70%),
    radial-gradient(ellipse 30% 36% at 72% 18%, var(--blob-2) 0%, transparent 72%),
    radial-gradient(ellipse 30% 30% at 32% 78%, var(--blob) 0%, transparent 70%),
    radial-gradient(ellipse 26% 32% at 96% 70%, var(--blob-2) 0%, transparent 70%);
  background-attachment: fixed;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--orange-deep); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { display: block; }
.tone-red { --tone: var(--red); }
.tone-amber { --tone: var(--amber); }
.tone-green { --tone: var(--green); }
.tone-grey { --tone: var(--grey-dot); }

/* ---------- login ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr minmax(0, 560px) 1fr;
  align-items: center;
  padding-block: 28px 40px;
  gap: 24px;
}
.login-center { grid-column: 2; display: grid; gap: 22px; justify-items: center; min-width: 0; }
.verse { text-align: center; color: var(--ink-strong); display: grid; gap: 4px; }
.verse p { margin: 0; }
.bismillah { font-family: var(--font-ar); font-size: 30px; line-height: 1.6; }
.ayah { font-family: var(--font-ar); font-size: 38px; font-weight: 700; line-height: 1.6; border-bottom: 1px solid var(--ink-strong); padding-bottom: 6px; }
.urdu { font-family: var(--font-ur); font-size: 19px; line-height: 2.2; }
.login-card {
  width: 100%;
  max-width: 548px;
  background: var(--panel);
  border: 1px solid #d8d8d8;
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(120, 110, 60, 0.14);
  padding: 32px clamp(20px, 6vw, 62px) 40px;
  display: grid;
  gap: 8px;
}
.login-card h1 {
  justify-self: center;
  margin: 0 0 14px;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-strong);
  border-bottom: 2px solid var(--ink-strong);
  line-height: 1.2;
}
.login-card label { font-size: 18px; color: var(--ink-strong); }
.input-icon {
  display: flex;
  align-items: center;
  border: 1.5px solid #bdbdbd;
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  margin-bottom: 18px;
}
.input-icon svg { width: 22px; height: 22px; margin: 0 12px; color: #9a9a9a; flex: none; }
.input-icon input { flex: 1; min-width: 0; border: 0; border-left: 1.5px solid #bdbdbd; padding: 13px 18px; outline: 0; font-size: 15px; background: transparent; }
.input-icon input::placeholder { color: #9b9b9b; }
.input-icon:focus-within { border-color: var(--orange-mid); }
.login-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: -12px; flex-wrap: wrap; }
.check { font-size: 12px !important; color: var(--link) !important; text-decoration: underline; display: inline-flex; align-items: center; gap: 6px; }
.check input { accent-color: var(--link); width: 14px; height: 14px; }
.link { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; font-size: 12px; }
.link.strong { font-weight: 600; font-size: 13px; }
.login-error { margin: 4px 0 0; color: var(--red); font-size: 13px; text-align: center; }
.btn-signin {
  justify-self: center;
  width: min(100%, 275px);
  margin-top: 18px;
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  background: var(--grad-btn);
  color: #fff;
  font-size: 21px;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(240, 138, 36, 0.3);
}
.btn-signin:hover { filter: brightness(1.04); }
.login-note { text-align: center; margin: 14px 0 6px; font-size: 13px; color: var(--link); }
.btn-google {
  justify-self: center;
  width: min(100%, 276px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 16px;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  background: var(--panel);
  font-size: 13px;
}
.btn-google .g { font-weight: 700; font-size: 18px; color: #4285f4; }
.demo-box {
  width: 100%;
  max-width: 548px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed var(--orange-soft);
  border-radius: 16px;
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  font-size: 13px;
}
.demo-box p { margin: 0; }
.demo-box code { background: var(--orange-wash); padding: 1px 6px; border-radius: 4px; }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.demo-chip { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 10px; display: grid; gap: 1px; }
.demo-chip b { color: var(--orange-deep); font-size: 13px; }
.demo-chip span { font-size: 12px; color: var(--ink-soft); }
.demo-chip:hover { border-color: var(--orange-mid); }
.demo-box .link { justify-self: start; }
.welcome-side { grid-column: 3; display: grid; justify-items: start; color: #4b4b4b; padding-left: 4vw; }
.welcome-side strong { font-size: clamp(40px, 4.4vw, 86px); font-weight: 800; line-height: 1; letter-spacing: -0.01em; }
.welcome-side span { font-size: clamp(20px, 2vw, 40px); font-weight: 600; line-height: 1.2; }
.welcome-side i { font-style: normal; font-weight: 400; }

/* ---------- portal frame ---------- */
.shell { padding-block: 24px 40px; }
.frame {
  max-width: 1880px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid #d6d6d6;
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(90, 80, 40, 0.08);
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}
.frame.solo { grid-template-columns: minmax(0, 1fr); }
.sidebar { padding: 118px 22px 24px 24px; border-right: 1px solid var(--line-soft); }
.side-nav { display: grid; gap: 8px; position: sticky; top: calc(16px + env(safe-area-inset-top, 0px)); }
.side-btn {
  position: relative;
  text-align: center;
  padding: 16px 14px;
  border: 1.5px solid #c4c4c4;
  border-radius: 10px;
  background: var(--panel);
  color: #8d8d8d;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}
.side-btn:hover { color: var(--ink); }
.side-btn.active { color: var(--orange); border-color: #9d9d9d; box-shadow: var(--shadow-btn); }
.side-btn .count { position: absolute; top: -8px; right: -8px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--red); color: #fff; font-size: 12px; display: grid; place-items: center; padding: 0 6px; }
.main { padding: 26px clamp(16px, 2vw, 36px) 32px; min-width: 0; display: grid; gap: 22px; align-content: start; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.welcome {
  margin: 0;
  font-size: clamp(30px, 3vw, 50px);
  font-weight: 700;
  color: #5a5a5a;
  line-height: 1.15;
  display: inline-block;
  border-bottom: 2px solid #6a6a6a;
  text-wrap: balance;
}
.who { margin: 6px 0 0; color: var(--ink-soft); font-size: 13px; }
.logout { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: #6a6a6a; font-size: 14px; padding: 6px 0; }
.logout svg { width: 28px; height: 20px; }
.logout:hover { color: var(--orange-deep); }

/* ---------- orange column tables (form + spec) ---------- */
.gtable { display: flex; flex-wrap: wrap; gap: 0; border-radius: 6px; }
.gcol { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--orange-soft); margin: 0 -1px -1px 0; }
.gcol.wide { flex: 1.35 1 190px; }
.gcol.xwide { flex: 2 1 250px; }
.ghead {
  background: var(--grad);
  color: #fff;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  padding: 9px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gbody { padding: 12px 10px; flex: 1; display: flex; align-items: flex-start; justify-content: center; }
.gbody > * { width: 100%; }
.field {
  width: 100%;
  min-width: 0;
  background: var(--field);
  border: 1px solid var(--field-line);
  border-radius: 2px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
  padding: 7px 10px;
  text-align: center;
  font-size: 13px;
  color: #6b6b6b;
  min-height: 34px;
}
select.field { appearance: none; -webkit-appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%); background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%; background-size: 5px 5px; background-repeat: no-repeat; text-align: center; text-align-last: center; }
.field::placeholder { color: #a5a5a5; }
.field:focus { outline: 0; border-color: var(--orange-mid); background-color: #fff; }
.field.invalid, .qty-pick.invalid .chips { border-color: var(--red) !important; box-shadow: 0 0 0 2px rgba(227, 22, 29, 0.15); }
.field.small { width: 48px; flex: none; padding-inline: 4px; }
.field.ro { display: flex; align-items: center; justify-content: center; min-height: 34px; color: #7a7a7a; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline.wrap { flex-wrap: wrap; justify-content: center; }
.unit-tag { font-size: 11px; color: #6f6f6f; letter-spacing: 0.03em; }
.print-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: center; }
.field.pick { width: 62px; flex: none; padding-left: 6px; padding-right: 20px; background-position: calc(100% - 11px) 50%, calc(100% - 6px) 50%; }
.print-pick .field.pick { width: 100%; }
.gtable.prod { display: grid; grid-template-columns: 1.15fr 1.25fr 1.2fr 0.95fr 1.2fr 1.9fr 1.2fr; }
.gtable.prod .gcol { margin: 0 -1px -1px 0; }
.gtable.spec { display: grid; grid-template-columns: 1.1fr 1fr 1.25fr 1fr 1.3fr 1.1fr 1.1fr 1fr; }
.print-pick span, .print-ro span { display: block; font-size: 12px; color: #6a6a6a; margin-bottom: 4px; letter-spacing: 0.04em; }
.print-ro { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; }
.print-ro b { display: inline-block; min-width: 40px; padding: 4px 8px; border: 1px solid var(--orange-soft); border-radius: 6px; background: var(--field); font-weight: 500; color: #6b6b6b; }
.qty-pick { display: grid; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; border: 1px solid transparent; border-radius: 6px; padding: 2px; }
.chip { border: 1px solid var(--field-line); background: var(--field); border-radius: 3px; padding: 4px 8px; font-size: 12px; color: #747474; font-variant-numeric: tabular-nums; }
.chip.on { background: linear-gradient(180deg, #f6a058, #f18d36); border-color: #ee8a33; color: #fff; }
.round-plus { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid #9a9a9a; background: #fff; display: grid; place-items: center; padding: 0; box-shadow: var(--shadow-btn); }
.round-plus svg { width: 14px; height: 14px; }
.multi { position: relative; }
.multi summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 24px; position: relative; }
.multi summary::-webkit-details-marker { display: none; }
.multi summary::after { content: ''; position: absolute; right: 9px; top: 50%; border: 5px solid transparent; border-top-color: #777; margin-top: -2px; }
.multi-list { position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); width: max(100%, 200px); background: #fff; border: 1px solid var(--orange-soft); border-radius: 8px; box-shadow: var(--shadow); padding: 6px; display: grid; }
.opt { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; font-size: 13px; }
.opt:hover { background: var(--orange-wash); }
.opt input { accent-color: var(--orange); }

/* enquiry form */
.enquiry-form { display: grid; gap: 22px; padding-bottom: 22px; border-bottom: 2px solid #ececec; }
.edit-banner { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; background: var(--orange-wash); border: 1px solid var(--orange-soft); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.products { display: grid; gap: 16px; }
.product-row { display: grid; gap: 6px; }
.product-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--orange-deep); letter-spacing: 0.05em; text-transform: uppercase; }
.icon-btn { border: 0; background: none; padding: 4px; color: #8c8c8c; display: inline-grid; place-items: center; border-radius: 6px; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--orange-deep); background: var(--orange-wash); }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.btn-add { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; color: #6a6a6a; font-size: 14px; padding: 0; }
.btn-add svg { width: 30px; height: 30px; padding: 7px; border-radius: 50%; border: 1px solid #9a9a9a; background: #fff; box-shadow: var(--shadow-btn); color: #555; }
.btn-add:hover span { color: var(--orange-deep); }
.btn-save {
  border: 0;
  border-radius: 14px;
  padding: 13px 38px;
  background: var(--grad-btn);
  color: #fff;
  font-size: clamp(19px, 1.6vw, 26px);
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 7px 14px rgba(240, 138, 36, 0.32), inset 0 -2px 0 rgba(0, 0, 0, 0.06);
}
.btn-save:hover { filter: brightness(1.04); }
.btn-save.wide { padding-inline: 44px; }

/* ---------- entries table ---------- */
.entries { display: grid; gap: 14px; }
.entries-bar { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 12px 28px; }
.entries-bar h2 { margin: 0; text-align: center; font-size: clamp(28px, 2.8vw, 46px); font-weight: 600; color: #4a4a4a; }
.bar-item { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 500; color: var(--ink-strong); white-space: nowrap; }
.date-in { border: 1.5px solid var(--green); padding: 4px 10px; border-radius: 2px; background: #fff; font-size: 15px; }
.show-in { border: 1.5px solid var(--green); padding: 2px 4px; background: #fff; border-radius: 2px; }
.bar-item.search input { border: 0; border-bottom: 1px solid #555; background: transparent; width: 170px; padding: 4px 2px; outline: 0; }
.table-wrap { overflow-x: auto; min-width: 0; -webkit-overflow-scrolling: touch; }
.entries-table { width: 100%; min-width: 1180px; border-collapse: separate; border-spacing: 0 8px; font-size: 14px; }
.entries-table thead th { background: var(--grad); color: #fff; font-weight: 500; padding: 8px 6px; vertical-align: top; text-align: center; border-right: 1px solid rgba(255, 255, 255, 0.35); }
.entries-table thead th:first-child { border-radius: 6px 0 0 6px; }
.entries-table thead th:last-child { border-radius: 0 6px 6px 0; border-right: 0; vertical-align: middle; }
.th-client { background: linear-gradient(90deg, #f8ad69, #fbbe86) !important; }
.th-sort { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: #fff; font-size: 13px; font-weight: 500; padding: 2px 4px 6px; }
.th-sort svg { width: 8px; height: 13px; opacity: 0.9; }
.th-sort.sorted { text-decoration: underline; text-underline-offset: 4px; }
.th-search { display: block; width: 100%; border: 0; border-radius: 2px; background: rgba(255, 255, 255, 0.85) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='6.5' cy='6.5' r='4.5' fill='none' stroke='%23999' stroke-width='1.4'/%3E%3Cpath d='M10 10l4 4' stroke='%23999' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat 10px 50% / 12px; padding: 6px 8px 6px 28px; font-size: 12px; color: #555; }
.th-search::placeholder { color: #a8a8a8; }
.th-action span { font-size: 15px; }
.entries-table tbody td { background: var(--row); padding: 16px 10px; text-align: center; vertical-align: middle; color: #3e3e3e; position: relative; }
.entries-table tbody td + td::before { content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; border-left: 1px solid #d9d9d9; }
.entries-table tbody tr td:first-child { border-radius: 4px 0 0 4px; }
.entries-table tbody tr td:last-child { border-radius: 0 4px 4px 0; }
.entries-table tr.empty td { padding: 30px; color: var(--ink-soft); }
.c-id { white-space: nowrap; font-size: 15px; }
.c-client { text-align: left !important; }
.c-client span { display: block; font-size: 14px; line-height: 1.45; white-space: nowrap; }
.c-notes { font-size: 14px; text-transform: uppercase; white-space: nowrap; }
.c-est { min-width: 120px; }
.c-est .expand { position: absolute; top: 6px; right: 6px; }
.sub { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 6px; }
.sub.tone-red, .sub.tone-amber, .sub.tone-green { color: var(--tone); font-weight: 500; }
.pill-btn { border: 1px solid #c9c9c9; background: #fff; border-radius: 6px; padding: 9px 14px; font-size: 13px; color: #444; box-shadow: var(--shadow-btn); white-space: nowrap; }
.pill-btn:hover { border-color: var(--orange-mid); }
.c-email span:not(.badge):not(.ticks) { display: block; font-size: 12px; line-height: 1.3; }
.badge { display: inline-block; margin-top: 5px; padding: 3px 10px; border-radius: 3px; background: var(--tone, var(--red)); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; }
.ticks { display: block; font-size: 13px; color: #555; letter-spacing: -2px; margin-top: 2px; }
.ticks.read { color: #2f7fd8; }
.c-site { font-size: 13px; }
.select-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #c9c9c9; background: #fff; border-radius: 4px; padding: 6px 10px; font-size: 11px; box-shadow: var(--shadow-btn); }
.select-btn svg { width: 8px; height: 6px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; color: #8a8a8a; font-size: 15px; }
.pg { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 30px; height: 30px; font-size: 18px; line-height: 1; color: #6a6a6a; }
.pg:disabled { opacity: 0.4; cursor: default; }

/* action menu (page 2.3) */
.action-menu {
  position: fixed;
  z-index: 60;
  width: 280px;
  max-width: calc(100vw - 24px);
  background: #f4f4f4;
  border: 1.5px solid var(--orange-soft);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 8px 18px 10px;
  display: grid;
}
.action-menu button { border: 0; background: none; padding: 10px 8px; font-size: 16px; font-weight: 500; color: #6a6a6a; border-bottom: 1px solid #dcdcdc; }
.action-menu button:last-child { border-bottom: 0; }
.action-menu button:hover, .action-menu button:focus-visible { background: var(--grad-btn); color: #fff; border-radius: 22px; box-shadow: var(--shadow-btn); outline: 0; }
.action-menu button.dim { color: #b4b4b4; }

/* ---------- lists (estimation panel 3.1, team, csr) ---------- */
.panel-list { display: grid; gap: 18px; }
.list-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid #e4e4e4; }
.list-head .bar-item { align-self: end; font-size: 14px; font-weight: 400; }
.panel-title { margin: 0; font-size: clamp(36px, 4.6vw, 80px); font-weight: 600; color: #5a5a5a; line-height: 1.1; text-align: center; }
.list-date { justify-self: end; font-size: 18px; color: #3d3d3d; white-space: nowrap; }
.section-title { margin: 0; font-size: clamp(26px, 2.4vw, 38px); font-weight: 600; color: #5a5a5a; }
.section-note { margin: -8px 0 0; max-width: 70ch; color: var(--ink-soft); line-height: 1.6; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; flex-wrap: wrap; font-size: 12px; color: var(--ink-soft); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend .dot { width: 12px; height: 12px; }
.dot { flex: none; display: inline-block; width: 26px; height: 26px; border-radius: 50%; background: var(--tone, var(--red)); }
.est-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.est-item { width: 100%; display: grid; grid-template-columns: auto minmax(0, max-content) auto; justify-content: start; align-items: center; gap: 6px 22px; border: 0; background: none; padding: 6px 0; text-align: left; }
.est-text { font-size: clamp(17px, 1.6vw, 25px); font-style: italic; color: #b2b2b2; border-bottom: 1.5px solid #c8c8c8; padding-bottom: 2px; min-width: 0; overflow-wrap: anywhere; }
.est-item.pending .est-text { color: #4a4a4a; border-bottom-color: #6a6a6a; }
.est-item.waiting .est-text { color: #9a9a9a; }
.est-item:hover .est-text { color: var(--orange-deep); border-bottom-color: var(--orange-mid); }
.est-meta { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--ink-soft); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; background: var(--tone); color: #fff; font-size: 11px; font-weight: 500; }
.panel-list.compact .dot { width: 20px; height: 20px; }
.panel-list.compact .est-text { font-size: clamp(16px, 1.4vw, 21px); }
.num-pages { display: flex; justify-content: center; gap: 6px; padding-top: 16px; border-top: 2px solid #e4e4e4; }
.num-pages button { border: 0; background: none; font-size: 22px; color: #8a8a8a; padding: 2px 6px; }
.num-pages button.on { color: #222; font-weight: 600; }
.solo-top { display: flex; justify-content: flex-end; align-items: center; gap: 16px; flex-wrap: wrap; }
.solo-top .who { margin: 0; }
.placeholder { border: 2px dashed var(--line); border-radius: 18px; padding: 48px 24px; text-align: center; color: var(--ink-soft); }
.placeholder h2 { margin: 0 0 8px; color: #6a6a6a; font-size: 28px; font-weight: 600; }
.placeholder p { margin: 0 auto; max-width: 60ch; line-height: 1.6; }

/* ---------- costing sheet (page 3.2) ---------- */
.sheet-view { display: grid; gap: 16px; }
.sheet-top { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 16px; padding-bottom: 10px; border-bottom: 2px solid #dedede; }
.back { border: 0; background: none; color: #7a7a7a; font-size: 14px; padding: 0 0 8px; }
.back:hover { color: var(--orange-deep); }
.sheet-title { margin: 0; font-size: clamp(26px, 2.6vw, 40px); font-weight: 600; color: #5a5a5a; }
.sheet-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sheet-line .by { display: inline-flex; align-items: center; gap: 12px; color: var(--orange); font-size: clamp(16px, 1.5vw, 25px); }
.sheet-line .dot { width: 22px; height: 22px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1.5px solid #c4c4c4; background: #fff; border-radius: 10px; padding: 8px 14px; color: #8d8d8d; font-weight: 600; font-size: 14px; }
.tab.on { color: var(--orange); border-color: #9d9d9d; box-shadow: var(--shadow-btn); }
.gtable.spec .ghead { font-size: 14px; padding: 8px 6px; }
.gtable.spec .gbody { padding: 10px 8px; }
.gtable.spec .field.ro { font-size: 12px; }
.sheet-body { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.sheet-wrap { flex: 0 1 auto; max-width: 100%; }
.sheet { border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.sheet th, .sheet td { border: 1px solid #8f8f8f; height: 44px; }
.sheet th[scope="row"] { width: 240px; min-width: 200px; font-weight: 600; color: #2f2f2f; text-align: center; padding: 0 14px; background: #fff; }
.sheet thead th { font-weight: 600; background: #fff; color: #2f2f2f; padding: 0 12px; min-width: 150px; }
.sheet td { min-width: 150px; text-align: center; padding: 0; background: #fff; }
.sheet td.ro { padding: 0 10px; color: #444; }
.sheet td.calc { font-weight: 600; color: #2b2b2b; padding: 0 10px; }
.sheet .total-row th, .sheet .total-row td { background: #fffaf3; }
.sheet .tl-row th, .sheet .tl-row td { background: var(--locked); }
.sheet td.locked { background: var(--locked); }
.lock { display: inline-block; vertical-align: -2px; margin-left: 6px; color: #9a9a9a; }
.lock svg { width: 13px; height: 13px; }
.cell-in { width: 100%; height: 43px; border: 0; background: transparent; text-align: center; font-size: 14px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.cell-in:focus { outline: 2px solid var(--orange-mid); outline-offset: -2px; background: #fffaf2; }
.tl-row .cell-in { background: #fff; }
.price-card { flex: 1 1 280px; max-width: 420px; border: 1.5px solid var(--orange-soft); border-radius: 18px; padding: 18px 20px; background: var(--orange-wash); display: grid; gap: 10px; }
.price-card h3 { margin: 0; color: var(--orange-deep); font-size: 18px; font-weight: 600; }
.price-card p { margin: 0; font-size: 12.5px; color: #6c6c6c; line-height: 1.55; }
.price-card table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; background: #fff; border-radius: 10px; overflow: hidden; }
.price-card th { background: var(--grad); color: #fff; font-weight: 500; font-size: 12px; padding: 7px 8px; }
.price-card td { padding: 8px; text-align: center; border-top: 1px solid var(--line-soft); font-weight: 600; }
.price-card .rate { font-size: 11px; color: var(--ink-soft); }
.est-notes { display: grid; gap: 6px; max-width: 760px; }
.est-notes label { font-size: 13px; font-weight: 500; color: #555; }
.est-notes textarea { border: 1px solid var(--field-line); border-radius: 6px; padding: 10px 12px; background: var(--field); resize: vertical; }
.est-notes p { margin: 0; color: #666; }
.sheet-actions { display: flex; justify-content: center; align-items: center; gap: 22px; flex-wrap: wrap; padding-top: 8px; }
.btn-send { display: grid; gap: 2px; text-align: center; border: 1.5px solid var(--orange-soft); background: #f4f4f4; border-radius: 16px; padding: 10px 26px; box-shadow: var(--shadow); color: #6a6a6a; }
.btn-send span { font-size: 20px; font-weight: 500; }
.btn-send small { font-size: 11px; color: var(--ink-soft); }
.btn-send:hover { background: var(--grad-btn); color: #fff; }
.btn-send:hover small { color: #fff; }
.btn-ghost { border: 1.5px solid #c4c4c4; background: #fff; border-radius: 10px; padding: 10px 18px; color: #6a6a6a; font-weight: 500; }
.btn-ghost:hover { border-color: var(--orange-mid); color: var(--orange-deep); }
.sheet-done { text-align: center; margin: 0; color: var(--ink-soft); font-style: italic; }

/* ---------- modals ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(60, 60, 60, 0.35); display: flex; align-items: flex-start; justify-content: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); overflow-y: auto; }
.modal { position: relative; margin: auto; width: min(100%, 1040px); background: #fff; border: 2px solid var(--orange-mid); border-radius: 26px; box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22); padding: 26px clamp(16px, 2vw, 30px) 22px; display: grid; gap: 14px; animation: pop 0.16s ease-out; }
.modal.narrow { width: min(100%, 560px); }
.modal.quote { width: min(100%, 860px); border-color: #e2e2e2; border-radius: 6px; }
@keyframes pop { from { transform: scale(0.97); opacity: 0.6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }
.modal-x { position: absolute; top: 16px; right: 16px; border: 0; background: #fff; color: var(--orange); padding: 0; border-radius: 50%; }
.modal-x svg { width: 34px; height: 34px; }
.modal-title { margin: 0; text-align: center; color: var(--orange); font-size: clamp(22px, 2.2vw, 30px); font-weight: 700; padding-inline: 40px; }
.modal-kicker { margin: 0; color: #9a9a9a; font-size: 22px; font-weight: 500; }
.modal-sub { margin: -6px 0 0; text-align: center; color: var(--ink-soft); font-size: 13px; }
.modal-sub.left { text-align: left; margin: 0; font-size: 14px; font-weight: 600; color: #6a6a6a; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 8px; }
.foot-note { margin-right: auto; font-size: 12px; color: var(--ink-soft); }
.btn-ok { border: 0; border-radius: 6px; padding: 9px 30px; background: var(--grad-btn); color: #fff; font-size: 17px; font-weight: 600; box-shadow: 0 4px 10px rgba(240, 138, 36, 0.3); }
.btn-small { border: 1.5px solid var(--orange-soft); border-radius: 8px; padding: 10px 22px; background: var(--grad-btn); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.03em; }
.btn-small:disabled { background: #d9d9d9; border-color: #d9d9d9; cursor: default; }
.note-text { margin: 0; line-height: 1.7; color: #555; }
.info-table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.info-table th { background: var(--orange-soft); color: #fff; font-weight: 600; padding: 11px 8px; border: 1px solid #fff; letter-spacing: 0.02em; }
.info-table td { padding: 10px 8px; text-align: center; border: 1px solid #f6dcc0; color: #333; }
.info-table td .sub { margin-top: 2px; }
.info-table.mini { min-width: 760px; font-size: 11px; }
.info-table.mini th { padding: 7px 6px; background: var(--grad); }
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.stage { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; background: #ececec; border-radius: 10px; }
.stage.current { background: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16); }
.stage-name { display: inline-flex; align-items: center; gap: 14px; color: var(--tone); font-size: clamp(18px, 2vw, 25px); font-weight: 600; }
.stage-name i { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.stage .ok { background: var(--tone); color: #fff; font-size: 13px; font-weight: 700; border-radius: 3px; padding: 4px 18px; }
.stage.todo { opacity: 0.45; }
.stage.todo .ok { background: #bdbdbd; }
.edit-box { border: 2px solid var(--orange-mid); border-radius: 18px; padding: 14px 18px; display: grid; gap: 12px; }
.edit-head { display: flex; justify-content: center; position: relative; }
.edit-head h3 { margin: 0; color: var(--orange); font-size: 22px; font-weight: 600; }
.edit-head .pencil { position: absolute; right: 0; top: 0; color: var(--orange); }
.edit-head .pencil svg { width: 22px; height: 22px; }

/* quote document (page 2.3.2) */
.quote-doc { border: 1px solid #333; padding: 22px clamp(14px, 2.4vw, 30px); display: grid; gap: 14px; font-size: 11px; color: #333; margin-top: 30px; }
.q-brand { text-align: center; color: var(--orange); font-size: clamp(24px, 3vw, 36px); font-weight: 700; letter-spacing: 0.01em; line-height: 1.1; }
.q-title { text-align: center; font-size: clamp(16px, 1.8vw, 21px); font-weight: 600; color: #3a3a3a; margin-top: -8px; }
.q-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.q-contact, .q-meta { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.q-contact li { display: grid; gap: 1px; }
.q-contact b { color: var(--orange-deep); font-size: 10px; font-weight: 600; }
.q-meta { text-align: right; align-content: start; }
.q-meta li { color: var(--orange-deep); font-weight: 600; border-bottom: 1px solid #e0b98f; padding: 2px 0 3px 30px; }
.q-hi { margin: 6px 0 0; line-height: 1.6; }
.q-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 10px; font-variant-numeric: tabular-nums; }
.q-table th { background: var(--orange-soft); color: #4a3520; font-weight: 600; padding: 6px 4px; border: 1px solid #e7b88a; }
.q-table td { border: 1px solid #aaa; padding: 6px 4px; text-align: center; }
.q-terms h4 { margin: 8px 0 2px; font-size: 11px; }
.q-terms ul { margin: 0; padding-left: 16px; line-height: 1.6; }
.q-thanks { display: grid; gap: 4px; text-align: center; padding-top: 18px; }
.q-thanks b { font-size: 12px; }
.q-pay { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 10px; }
.q-pay i { font-style: normal; font-weight: 600; border: 1px solid #ccc; border-radius: 4px; padding: 3px 8px; color: #333; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: min(92vw, 560px); background: #3c3c3c; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 13px; line-height: 1.5; box-shadow: var(--shadow); transition: opacity 0.2s, transform 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: #b4380f; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .login-page { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .login-center { grid-column: 1; width: 100%; }
  .welcome-side { grid-column: 1; grid-row: 1; justify-items: center; padding: 0; text-align: center; }
  .welcome-side strong { font-size: 44px; }
  .welcome-side span { font-size: 20px; }
}
@media (max-width: 1500px) {
  .gtable.prod, .gtable.spec { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 1100px) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .sidebar { padding: 18px 16px 0; border-right: 0; }
  .side-nav { position: static; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
  .side-btn { flex: none; font-size: 14px; padding: 10px 14px; }
  .entries-bar { grid-template-columns: auto auto 1fr; }
  .entries-bar h2 { grid-column: 1 / -1; grid-row: 1; text-align: left; }
}
@media (max-width: 640px) {
  .shell { padding-block: 12px 24px; }
  .frame { border-radius: 18px; }
  .main { padding: 16px 12px 24px; }
  .entries-bar { grid-template-columns: 1fr; gap: 10px; }
  .bar-item.search input { width: 100%; }
  .bar-item.search { width: 100%; }
  .list-head { grid-template-columns: 1fr auto; }
  .list-head .panel-title { grid-column: 1 / -1; grid-row: 1; }
  .sheet-top { grid-template-columns: 1fr auto; }
  .sheet-top .back { grid-column: 1 / -1; }
  .sheet th[scope="row"] { width: 150px; min-width: 140px; font-size: 12px; padding: 0 8px; }
  .sheet td, .sheet thead th { min-width: 108px; }
  .ayah { font-size: 28px; }
  .bismillah { font-size: 24px; }
  .est-item { grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; }
  .est-item .est-meta { grid-column: 2; }
  .dot { width: 18px; height: 18px; }
  .stage { padding: 14px 14px; }
}

/* ---------- server app: loading, admin ---------- */
[hidden] { display: none !important; }
.loading { text-align: center; padding: 30vh 16px; color: var(--ink-soft); font-size: 15px; }
body.busy, body.busy button { cursor: progress; }
.badge.tone-grey { background: var(--grey-dot); }
.admin-section { display: grid; gap: 16px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-table { min-width: 900px; }
.admin-table td { text-align: left; }
.admin-table tr.inactive td { color: #a0a0a0; }
.modal.form { width: min(100%, 640px); }
.admin-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.admin-form label, .admin-form fieldset { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: #555; min-width: 0; }
.admin-form .span2 { grid-column: 1 / -1; }
.admin-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.admin-form legend { padding: 0 6px; }
.admin-form .opt { display: flex; font-weight: 400; }
.admin-form .check-line { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.admin-form .check-line input { accent-color: var(--orange); width: 16px; height: 16px; }
.field.left { text-align: left; text-align-last: auto; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.opt-field { display: grid; gap: 6px; }
.opt-field label { font-weight: 600; color: #555; }
.opt-field textarea { border: 1px solid var(--field-line); border-radius: 8px; background: var(--field); padding: 10px 12px; resize: vertical; line-height: 1.6; }
.opt-field small { color: var(--ink-soft); font-size: 12px; }
@media (max-width: 640px) { .admin-form { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.stat { display: grid; gap: 2px; text-align: left; border: 1.5px solid var(--line); border-left: 6px solid var(--tone); border-radius: 12px; background: #fff; padding: 14px 16px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); }
.stat:hover { border-color: var(--orange-soft); border-left-color: var(--tone); }
.stat-num { font-size: 34px; font-weight: 700; color: var(--ink-strong); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-weight: 600; color: var(--tone); }
.stat-hint { font-size: 12px; color: var(--ink-soft); }
.sub-title { margin: 8px 0 0; font-size: 18px; font-weight: 600; color: #5a5a5a; }
.admin-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.admin-filters label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: #555; min-width: 0; }
.row-actions { white-space: nowrap; }
.row-actions .pill-btn { padding: 6px 10px; font-size: 12px; margin-right: 6px; }

/* Login fits one screen on laptops: sizes follow the window height. */
.login-page { min-height: 100vh; min-height: 100dvh; padding-block: clamp(8px, 2.2vh, 28px); }
.login-center { gap: clamp(8px, 1.8vh, 22px); }
.verse { gap: 0; }
.bismillah { font-size: clamp(18px, 3.3vh, 30px); line-height: 1.5; }
.ayah { font-size: clamp(22px, 4.6vh, 38px); line-height: 1.5; padding-bottom: clamp(2px, 0.6vh, 6px); }
.urdu { font-size: clamp(13px, 2.3vh, 19px); line-height: 1.9; }
.login-card { padding: clamp(16px, 3.4vh, 32px) clamp(20px, 6vw, 62px) clamp(16px, 3.6vh, 40px); gap: clamp(4px, 0.8vh, 8px); }
.login-card h1 { font-size: clamp(20px, 3vh, 25px); margin-bottom: clamp(2px, 1.2vh, 14px); }
.login-card label { font-size: clamp(15px, 2.2vh, 18px); }
.input-icon { margin-bottom: clamp(8px, 1.8vh, 18px); }
.input-icon input { padding-block: clamp(8px, 1.5vh, 13px); }
.login-row { margin-top: clamp(-12px, -1vh, -4px); }
.btn-signin { margin-top: clamp(6px, 1.6vh, 18px); padding-block: clamp(8px, 1.4vh, 12px); font-size: clamp(18px, 2.6vh, 21px); }
.login-note { margin: clamp(6px, 1.4vh, 14px) 0 clamp(2px, 0.6vh, 6px); }
.btn-google { padding-block: clamp(6px, 1vh, 9px); }
.login-error { margin: 0; }
.login-center { grid-template-columns: minmax(0, 1fr); }
.login-card, .demo-box { min-width: 0; }
.input-icon input { width: 100%; }
@media (max-width: 1280px) and (max-height: 820px) { .welcome-side { display: none; } }
.admin-form .form-row { display: grid; gap: 6px; min-width: 0; }
.form-label { font-size: 13px; font-weight: 500; color: #555; }
.site-multi summary { justify-content: flex-start; }
.site-multi .multi-list { left: 0; right: 0; width: auto; max-height: 240px; overflow-y: auto; }
