/* Mindolo CRM — brand red + greys, Century Gothic */

/* Century Gothic is used when installed (most PCs/Macs with Microsoft Office).
   Otherwise this bundled look-alike, TeX Gyre Adventor (GUST Font License), is used. */
@font-face { font-family: "Mindolo Gothic"; src: local("Century Gothic"), url("../fonts/adventor-regular.woff2") format("woff2"); font-weight: 100 549; font-style: normal; font-display: swap; }
@font-face { font-family: "Mindolo Gothic"; src: local("Century Gothic Bold"), local("CenturyGothic-Bold"), url("../fonts/adventor-bold.woff2") format("woff2"); font-weight: 550 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Mindolo Gothic"; src: local("Century Gothic Italic"), url("../fonts/adventor-italic.woff2") format("woff2"); font-weight: 100 549; font-style: italic; font-display: swap; }
@font-face { font-family: "Mindolo Gothic"; src: local("Century Gothic Bold Italic"), url("../fonts/adventor-bolditalic.woff2") format("woff2"); font-weight: 550 900; font-style: italic; font-display: swap; }
:root {
  --brand: #F0281D;
  --brand-dark: #C91F15;
  --brand-soft: #FDECEB;
  --ink: #2B1E1D;      /* text: near-black with a red undertone, not grey */
  --ink-2: #4A3533;
  --muted: #8A6763;    /* secondary text: warm rose-brown */
  --muted-2: #B8958F;
  --line: #F2E1DF;     /* hairlines: white tinted with the logo red */
  --line-2: #F8EDEC;
  --bg: #FDF8F7;       /* page background: white, just toned down */
  --tint: #FDF0EF;     /* hover / panels */
  --panel: #FFFFFF;
  --side: #FFFFFF;
  --side-2: #FDF0EF;
  --green: #1E8E5A; --green-soft: #E3F4EB;
  --amber: #B7791F; --amber-soft: #FBF1DE;
  --blue:  #2F6FBF; --blue-soft:  #E5EEF9;
  --red:   #D2281E; --red-soft:   #FCE7E6;
  --radius: 10px;
  --scale: 1.07;   /* text & control size; grows with screen width below */
  --side-w: calc(236px * var(--scale));
  --shadow: 0 1px 2px rgba(120,20,12,.04), 0 1px 3px rgba(120,20,12,.05);
  --font: "Century Gothic", CenturyGothic, "Mindolo Gothic", AppleGothic, sans-serif;
}
@media (min-width: 1500px) { :root { --scale: 1.14; } }
@media (min-width: 1800px) { :root { --scale: 1.22; } }
@media (min-width: 2300px) { :root { --scale: 1.32; } }
* { box-sizing: border-box; }
button, input, select, textarea { font-family: inherit; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: calc(14px * var(--scale)); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--ink); }
h1 { font-size: calc(22px * var(--scale)); font-weight: 650; }
h2 { font-size: calc(17px * var(--scale)); font-weight: 650; }
h3 { font-size: calc(15px * var(--scale)); font-weight: 650; }
p { margin: 0 0 10px; }
small, .muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); background: var(--side); color: var(--ink-2); border-right: 1px solid var(--line); flex-shrink: 0; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transition: transform .2s; }
.side-brand { display: block; padding: 22px 22px 4px; }
.side-brand img { width: calc(150px * var(--scale)); display: block; }
.brand-sub { padding: 0 22px 18px; font-size: calc(11px * var(--scale)); letter-spacing: .18em; text-transform: uppercase; color: var(--muted-2); border-bottom: 1px solid var(--line); }
.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 7px; color: var(--ink-2); text-decoration: none; font-weight: 500; margin-bottom: 2px; position: relative; }
.nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav a:hover { background: var(--side-2); color: var(--brand-dark); }
.nav a.active { background: var(--brand); color: #fff; }
.nav a.active .nav-count { background: #fff; color: var(--brand); }
.nav a.active::before { display: none; content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; background: var(--brand); border-radius: 0 3px 3px 0; }
.nav a.active svg { color: #fff; opacity: 1; }
.nav-label { font-size: calc(10.5px * var(--scale)); letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); padding: 16px 12px 6px; }
.nav-count { margin-left: auto; font-style: normal; background: var(--brand); color: #fff; font-size: calc(11px * var(--scale)); font-weight: 700; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.sidebar-foot { padding: 12px 22px; font-size: calc(11px * var(--scale)); color: var(--muted-2); }
.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { height: calc(60px * var(--scale)); background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 30; }
.content { padding: clamp(20px, 2vw, 40px); max-width: 1880px; width: 100%; margin: 0 auto; }
/* Form pages: a centred column that grows with the text, not a narrow strip on the left */
.content:has(> form.card[style*="max-width"]), .content:has(> .grid[style*="max-width"]) { max-width: calc(1120px * var(--scale)); }
.content > [style*="max-width"] { max-width: none !important; }
.topbar { padding-left: clamp(20px, 2vw, 40px) !important; padding-right: clamp(20px, 2vw, 40px) !important; }
.search { max-width: calc(560px * var(--scale)) !important; }
.topbar .menu-btn { display: none; }
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; background: var(--tint); border: 1px solid transparent; border-radius: 8px; padding: 0 12px; height: calc(38px * var(--scale)); }
.search:focus-within { border-color: var(--line); background: #fff; }
.search svg { width: 16px; height: 16px; color: var(--muted-2); flex-shrink: 0; }
.search input, .search input[type=search] { border: 0; background: transparent; outline: 0; width: 100%; font: inherit; color: var(--ink); height: calc(36px * var(--scale)); padding: 0; box-shadow: none; }
.usermenu { position: relative; margin-left: auto; }
.avatar { width: calc(36px * var(--scale)); height: calc(36px * var(--scale)); border-radius: 50%; background: var(--brand); color: #fff; border: 0; font-weight: 700; font-size: calc(13px * var(--scale)); cursor: pointer; }
.avatar-sm { width: calc(28px * var(--scale)); height: calc(28px * var(--scale)); border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: inline-flex; align-items: center; justify-content: center; font-size: calc(11px * var(--scale)); font-weight: 700; flex-shrink: 0; }
.dropdown { display: none; position: absolute; right: 0; top: 44px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(120,20,12,.12); min-width: 240px; overflow: hidden; }
[data-dropdown].open .dropdown { display: block; }
.dropdown-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.dropdown-head span { color: var(--muted); font-size: calc(12.5px * var(--scale)); }
.role-pill { align-self: flex-start; margin-top: 6px; background: var(--brand-soft); color: var(--brand-dark) !important; font-weight: 600; font-size: calc(11px * var(--scale)) !important; padding: 1px 8px; border-radius: 10px; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 10px 16px; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: none; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--bg); color: var(--ink); }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: calc(12.5px * var(--scale)); color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: calc(15px * var(--scale)); }
.card-body { padding: 20px; }
.stack > * + * { margin-top: 20px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) calc(360px * var(--scale)); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h2 { margin-bottom: 8px; }

/* ---------- KPI tiles ---------- */
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .label { font-size: calc(12px * var(--scale)); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { font-size: calc(24px * var(--scale)); font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi .value small { font-size: calc(13px * var(--scale)); color: var(--muted); font-weight: 500; }
.kpi .foot { font-size: calc(12.5px * var(--scale)); color: var(--muted); margin-top: 6px; }
.kpi.accent { border-top: 3px solid var(--brand); }
.kpi .value .multi { font-size: calc(18px * var(--scale)); display: block; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: calc(38px * var(--scale)); padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--tint); color: var(--brand-dark); border-color: #F3C3C0; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-dark { background: #fff; border-color: var(--brand); color: var(--brand); }
.btn-dark:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: #F2C4C1; color: var(--red); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: calc(32px * var(--scale)); padding: 0 12px; font-size: calc(13px * var(--scale)); }
.btn-xs { height: calc(26px * var(--scale)); padding: 0 9px; font-size: calc(12px * var(--scale)); border-radius: 6px; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: calc(36px * var(--scale)); border: 0; background: none; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--bg); }
.icon-btn svg { width: 20px; height: calc(20px * var(--scale)); }
.inline { display: inline; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label-txt { font-size: calc(12.5px * var(--scale)); font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: calc(12px * var(--scale)); color: var(--muted); }
.req { color: var(--brand); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=url], input[type=search], select, textarea {
  width: 100%; height: calc(40px * var(--scale)); padding: 0 12px; border: 1px solid #EBD3D0; border-radius: 8px; background: #fff; font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input, select, textarea { min-width: 0; }
textarea { height: auto; min-height: calc(90px * var(--scale)); padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(240,40,29,.12); }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand); flex-shrink: 0; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; }
.section-title { font-size: calc(12px * var(--scale)); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 6px 0 -4px; grid-column: 1 / -1; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.filters input, .filters select { height: calc(36px * var(--scale)); width: auto; min-width: 150px; }
.filters input[type=search] { min-width: 220px; }
.filters input[type=checkbox] { width: 17px; height: 17px; min-width: 0; margin: 0; }
.seg { display: inline-flex; background: var(--tint); border-radius: 8px; padding: 3px; }
.seg a { padding: 5px 12px; border-radius: 6px; text-decoration: none; font-weight: 600; color: var(--muted); font-size: calc(13px * var(--scale)); }
.seg a.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: calc(11.5px * var(--scale)); text-transform: uppercase; letter-spacing: .06em; color: #fff; font-weight: 700; padding: 11px 16px; border-bottom: 1px solid var(--brand-dark); background: var(--brand); white-space: nowrap; }
.table th a { color: #fff !important; }
.card > .table-wrap:first-child, .card > .table-wrap:first-child .table { border-top-left-radius: calc(var(--radius) - 1px); border-top-right-radius: calc(var(--radius) - 1px); overflow: hidden; }
@media print { .table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--tint); }
.table .t-main { font-weight: 600; text-decoration: none; color: var(--ink); }
.table .t-main:hover { color: var(--brand); }
.table .t-sub { font-size: calc(12.5px * var(--scale)); color: var(--muted); }
.table tfoot td { font-weight: 700; background: var(--tint); border-top: 1px solid var(--line); }
.row-late td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: calc(11.5px * var(--scale)); font-weight: 650; white-space: nowrap; }
.badge-grey { background: var(--line-2); color: var(--ink-2); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-red { background: var(--red-soft); color: var(--red); }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; border: 1px solid; }
.alert-success { background: var(--green-soft); border-color: #BFE3CF; color: #155F3D; }
.alert-error { background: var(--red-soft); border-color: #F3C3C0; color: #9B1C14; }
.alert-warning { background: var(--amber-soft); border-color: #EFD9A9; color: #7D5212; }
.alert-info { background: var(--blue-soft); border-color: #C7D9F0; color: #1F4E8A; }

/* ---------- Pipeline (kanban) ---------- */
.board { display: grid; grid-template-columns: repeat(7, minmax(calc(220px * var(--scale)), 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--tint); border-radius: 10px; display: flex; flex-direction: column; min-height: calc(300px * var(--scale)); }
.col-head { padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 2px; border-top: 3px solid #F3B6B1; border-radius: 10px 10px 0 0; }
.col-head .t { display: flex; justify-content: space-between; font-weight: 700; font-size: calc(13px * var(--scale)); }
.col-head .t span { color: var(--muted); font-weight: 600; }
.col-head .v { font-size: calc(12px * var(--scale)); color: var(--muted); }
.col[data-stage=negotiation] .col-head, .col[data-stage=proposal] .col-head { border-top-color: #F4908A; }
.col[data-stage=won] .col-head { border-top-color: var(--green); }
.col[data-stage=lost] .col-head { border-top-color: var(--brand); }
.col-body { padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.col-body.drag-over { background: rgba(240,40,29,.06); border-radius: 0 0 10px 10px; }
.deal { background: #fff; border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow); border: 1px solid var(--line); cursor: grab; text-decoration: none; color: var(--ink); display: block; }
.deal:hover { border-color: #F3B6B1; color: var(--ink); }
.deal.dragging { opacity: .5; }
.deal .d-co { font-weight: 650; font-size: calc(13px * var(--scale)); }
.deal .d-ti { font-size: calc(12.5px * var(--scale)); color: var(--muted); margin: 1px 0 8px; }
.deal .d-ft { display: flex; justify-content: space-between; align-items: center; font-size: calc(12px * var(--scale)); }
.deal .d-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.deal .late { color: var(--brand); font-weight: 600; }

/* ---------- Stage stepper ---------- */
.stepper { display: flex; gap: 4px; flex-wrap: wrap; }
.stepper form { flex: 1; min-width: 90px; }
.stepper button { width: 100%; border: 0; background: var(--line-2); color: var(--muted); font: inherit; font-size: calc(12.5px * var(--scale)); font-weight: 650; padding: 9px 6px; cursor: pointer; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); }
.stepper form:first-child button { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.stepper button:hover { background: var(--brand-soft); color: var(--brand-dark); }
.stepper .done button { background: #F8CFCB; color: var(--brand-dark); }
.stepper .current button { background: var(--brand); color: #fff; }
.stepper .current.won button { background: var(--green); }
.stepper .current.lost button { background: var(--brand); }

/* ---------- Detail lists ---------- */
.dl { display: grid; grid-template-columns: calc(130px * var(--scale)) 1fr; gap: 9px 12px; font-size: calc(13.5px * var(--scale)); }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.timeline li:last-child { border-bottom: 0; }
.tl-icon { width: calc(30px * var(--scale)); height: calc(30px * var(--scale)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: calc(11px * var(--scale)); font-weight: 700; flex-shrink: 0; background: #ECEEF1; color: var(--ink-2); text-transform: uppercase; }
.tl-icon.call, .tl-icon.whatsapp { background: var(--green-soft); color: var(--green); }
.tl-icon.email { background: var(--blue-soft); color: var(--blue); }
.tl-icon.meeting, .tl-icon.demo { background: var(--amber-soft); color: var(--amber); }
.tl-icon.stage, .tl-icon.system { background: var(--brand-soft); color: var(--brand-dark); }
.tl-meta { font-size: calc(12px * var(--scale)); color: var(--muted); margin-bottom: 2px; }
.tl-body { white-space: pre-wrap; word-break: break-word; }

/* ---------- Bars (reports) ---------- */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: calc(140px * var(--scale)) 1fr auto; gap: 12px; align-items: center; font-size: calc(13px * var(--scale)); }
.bar-track { background: var(--line-2); border-radius: 4px; height: 12px; overflow: hidden; }
.bar-fill { background: #F4908A; height: 100%; border-radius: 4px; }
.bar-fill.brand { background: var(--brand); }
.bar-fill.green { background: var(--green); }
.colchart { display: flex; align-items: flex-end; gap: 6px; height: calc(200px * var(--scale)); padding-top: 10px; }
.colchart .c { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.colchart .c .b { width: 100%; max-width: 44px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.colchart .c .b:hover { background: var(--brand-dark); }
.colchart .c .l { font-size: calc(11px * var(--scale)); color: var(--muted); white-space: nowrap; }
.colchart .c .tip { font-size: calc(10.5px * var(--scale)); color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.funnel .bar-fill { background: linear-gradient(90deg, var(--brand-dark), var(--brand)); }

/* ---------- Line items ---------- */
.items-table td { padding: 8px 6px; vertical-align: top; }
.items-table th { padding: 8px 6px; }
.items-table input, .items-table select, .items-table textarea { height: calc(36px * var(--scale)); }
.items-table textarea { min-height: calc(36px * var(--scale)); height: calc(36px * var(--scale)); padding: 7px 10px; }
.items-table .c-qty { width: 80px; } .items-table .c-price { width: 150px; } .items-table .c-disc { width: 80px; } .items-table .c-total { width: 150px; text-align: right; } .items-table .c-x { width: 40px; }
.totals { margin-left: auto; width: calc(340px * var(--scale)); max-width: 100%; }
.totals .r { display: flex; justify-content: space-between; padding: 6px 0; }
.totals .grand { border-top: 2px solid var(--brand); margin-top: 6px; padding-top: 10px; font-size: calc(18px * var(--scale)); font-weight: 700; }

/* ---------- Document preview ---------- */
.doc-paper { background: #fff; padding: 44px; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }

/* ---------- Pager ---------- */
.pager { display: flex; gap: 4px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager a, .pager span { min-width: 32px; height: calc(32px * var(--scale)); display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; text-decoration: none; color: var(--ink-2); font-weight: 600; }
.pager a:hover { background: var(--bg); }
.pager a.active { background: var(--brand); color: #fff; }

/* ---------- Mini list ---------- */
.mini { list-style: none; margin: 0; padding: 0; }
.mini li { display: flex; justify-content: space-between; gap: 10px; padding: 11px 20px; border-bottom: 1px solid var(--line-2); align-items: center; }
.mini li:last-child { border-bottom: 0; }
.mini a { text-decoration: none; font-weight: 600; }
.mini .s { font-size: calc(12.5px * var(--scale)); color: var(--muted); }
.days-chip { font-size: calc(12px * var(--scale)); font-weight: 700; padding: 3px 9px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.days-chip.hot { background: var(--brand-soft); color: var(--brand-dark); }
.days-chip.warm { background: var(--amber-soft); color: var(--amber); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(60,12,8,.35); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: 12px; width: calc(520px * var(--scale)); max-width: 100%; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(120,20,12,.22); }
.modal-box .card-head { position: sticky; top: 0; background: #fff; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { background: var(--brand); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art img { width: 210px; }
.auth-art h2 { color: #fff; font-size: calc(30px * var(--scale)); font-weight: 650; max-width: 420px; line-height: 1.25; }
.auth-art h2 em { font-style: normal; color: #fff; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.auth-art p { color: rgba(255,255,255,.88); max-width: 400px; margin-top: 14px; }
.auth-art .stripes { position: absolute; right: -80px; bottom: -80px; width: 340px; height: calc(340px * var(--scale)); border-radius: 50%; border: 46px solid #fff; opacity: .12; }
.auth-art .foot { color: rgba(255,255,255,.75); font-size: calc(12px * var(--scale)); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.auth-box { width: calc(400px * var(--scale)); max-width: 100%; }
.auth-box h1 { font-size: calc(26px * var(--scale)); margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); margin-bottom: 28px; }
.auth-box .field { margin-bottom: 16px; }
.auth-box .btn { height: calc(44px * var(--scale)); font-size: calc(15px * var(--scale)); }
.auth-logo-sm { display: none; width: 160px; margin-bottom: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-side { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(60,12,8,.35); z-index: 35; }
  .sidebar.open + .sidebar-backdrop { display: block; }
  .main { margin-left: 0; }
  .topbar .menu-btn { display: inline-flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; } .auth-logo-sm { display: block; }
}
@media (max-width: 640px) {
  .content { padding: 16px; } .topbar { padding: 0 12px; gap: 8px; }
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  .kpi .value { font-size: calc(19px * var(--scale)); }
  .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 8px; }
  .bar-row { grid-template-columns: 90px 1fr auto; }
  .doc-paper { padding: 18px; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .alert { display: none !important; }
  .main { margin: 0; } .content { padding: 0; max-width: none; }
  .doc-paper { border: 0; box-shadow: none; padding: 0; }
  @page { size: A4; margin: 11mm 12mm; }
}

/* ---------- OTP / password ---------- */
.otp-input { font-family: var(--font); font-weight: 700; font-size: calc(24px * var(--scale)) !important; letter-spacing: 10px; text-align: center; height: calc(52px * var(--scale)) !important; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.linkish:hover { color: var(--brand); }
.method-tabs { display: flex; gap: 4px; background: var(--bg); padding: 3px; border-radius: 8px; margin-bottom: 16px; }
.method-tabs a { flex: 1; text-align: center; padding: 7px 10px; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: calc(13px * var(--scale)); color: var(--muted); }
.method-tabs a.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.pw-meter { height: 4px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.pw-meter span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }
input:disabled, textarea:disabled, select:disabled { background: var(--bg); color: var(--muted); }

/* ---------- SweetAlert2 theme (Mindolo red + greys) ---------- */
.swal2-container { font-family: var(--font); z-index: 2000; }
.swal2-popup.mswal { border-radius: 14px; padding: 26px 24px 22px; width: calc(30em * var(--scale)); max-width: calc(100vw - 32px); color: var(--ink); }
.mswal .swal2-title { font-size: calc(20px * var(--scale)); font-weight: 650; color: var(--ink); padding: 8px 0 0; }
.mswal .swal2-html-container { font-size: calc(14.5px * var(--scale)); color: var(--muted); line-height: 1.55; margin: 10px 8px 0; }
.mswal .swal2-icon { transform: scale(.78); margin: 0 auto 2px; }
.mswal .swal2-actions { gap: 10px; margin-top: 22px; }
.mswal .swal2-actions .btn { height: calc(40px * var(--scale)); padding: 0 20px; margin: 0; }
.mswal .swal2-input.mswal-input, .mswal .swal2-input { height: calc(42px * var(--scale)); margin: 14px 0 0; width: 100%; box-sizing: border-box; border: 1px solid #EBD3D0; border-radius: 8px; font: inherit; font-size: calc(14px * var(--scale)); box-shadow: none; }
.mswal .swal2-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(240,40,29,.12); }
.mswal .swal2-validation-message { background: var(--red-soft); color: var(--red); border-radius: 8px; margin: 12px 0 0; font-size: calc(13px * var(--scale)); }
.mswal .swal2-validation-message::before { background: var(--brand); }
.mswal-sub { margin: 0 0 12px; }
.mswal-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mswal-chips .chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 12px; font: inherit; font-size: calc(13px * var(--scale)); color: var(--ink-2); cursor: pointer; }
.mswal-chips .chip:hover { border-color: #C8CCD2; background: var(--bg); }
.mswal-chips .chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.swal2-popup.mswal-toast { border-radius: 10px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(20,22,26,.16); border: 1px solid var(--line); }
.mswal-toast .swal2-title { font-size: calc(14px * var(--scale)); font-weight: 600; color: var(--ink); margin: 0 4px; }
.mswal-toast .swal2-timer-progress-bar { background: var(--brand); opacity: .55; }
.swal2-icon.swal2-success [class^=swal2-success-line] { background-color: var(--green); }
.swal2-icon.swal2-success .swal2-success-ring { border-color: rgba(30,142,90,.3); }
.swal2-icon.swal2-question { border-color: #F3B6B1; color: var(--brand); }
.swal2-icon.swal2-info { border-color: #C7D9F0; color: var(--blue); }
@keyframes mswalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.mswal-in { animation: mswalIn .18s ease-out; }
@media print { .swal2-container { display: none !important; } }
.mswal .btn:focus { outline: none; }
.mswal .btn:focus-visible { box-shadow: 0 0 0 3px rgba(240,40,29,.25); }

/* Keep brand colours (red table heads, shaded boxes) when printing / saving as PDF */
.doc-paper, .doc-paper * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* Printed quotes/invoices: footer sits at the bottom of the page (or after the content on longer documents) */
@media print {
  .doc { display: flex; flex-direction: column; min-height: 268mm; }
  .doc > * { flex-shrink: 0; }
  .doc > .doc-footer { margin-top: auto !important; }
  .doc-footer { padding-top: 10px; }
}
.doc-paper { overflow-x: auto; }

/* ---------- Client portal ---------- */
.portal-wrap { width: 100%; max-width: calc(1180px * var(--scale)); margin: 0 auto; padding: 0 clamp(16px, 2.5vw, 40px); }
.portal-top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.portal-top::before { content: ""; display: block; height: 4px; background: var(--brand); }
.portal-top-row { display: flex; align-items: center; gap: 18px; height: calc(68px * var(--scale)); }
.portal-logo img { width: calc(140px * var(--scale)); display: block; }
.portal-tag { font-size: calc(12px * var(--scale)); font-weight: 700; color: var(--brand-dark); background: var(--brand-soft); padding: 3px 10px; border-radius: 20px; }
.portal-nav { display: flex; gap: 4px; margin-left: auto; }
.portal-nav a { text-decoration: none; font-weight: 600; color: var(--ink-2); padding: 8px 14px; border-radius: 7px; font-size: calc(14.5px * var(--scale)); }
.portal-nav a:hover { background: var(--tint); color: var(--brand-dark); }
.portal-nav a.active { background: var(--brand); color: #fff; }
.portal-main { padding-top: clamp(24px, 3vw, 40px); padding-bottom: 48px; }
.portal-help { margin-top: 24px; font-size: calc(13.5px * var(--scale)); }
@media (max-width: 720px) {
  .portal-top-row { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 8px; }
  .portal-tag { display: none; }
  .portal-nav { order: 3; width: 100%; margin-left: 0; }
  .portal-nav a { flex: 1; text-align: center; }
  .portal-signout { margin-left: auto; }
}
.table th.text-right { text-align: right; }

/* Client documents upload row */
.doc-upload { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px 16px; align-items: end; border-bottom: 1px solid var(--line); }
.doc-upload .doc-notes { grid-column: 1 / 3; }
.doc-upload .doc-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.doc-upload .doc-actions .hint { font-size: calc(12px * var(--scale)); color: var(--muted); }
.doc-upload input[type=file] { height: auto; padding: 8px; background: var(--tint); border-style: dashed; cursor: pointer; }
@media (max-width: 900px) { .doc-upload { grid-template-columns: 1fr; } .doc-upload .doc-notes { grid-column: auto; } }
