/* Printsale.lv client portal v2 */
:root {
    --ink: #212326;
    --ink-soft: #5b6169;
    --bg: #f2f3f5;
    --card: #ffffff;
    --line: #e3e5e8;
    --line-soft: #eceef1;
    --accent: #ff4365;
    --accent-strong: #d12a4c;
    --accent-strong-hover: #a81f3b;
    --info: #1672b0; --info-bg: #e7f2fb;
    --success: #2e7d46; --success-bg: #e8f5ec;
    --warning: #8a5a00; --warning-bg: #fff4d6;
    --danger: #b3203d; --danger-bg: #fde8ec;
    --muted-bg: #eef0f2;
    --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font-family: Inter, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 1.5;
}
a { color: var(--accent-strong); }
a:hover { color: var(--accent-strong-hover); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.4px; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }

/* Preview bar */
.preview-bar { background: #fff4d6; color: #5a3b00; padding: 10px 16px; font-size: 14px; text-align: center; border-bottom: 1px solid #f0d98c; }
.preview-bar a { margin-left: 12px; font-weight: 600; color: #5a3b00; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    flex: 0 0 248px; background: var(--ink); color: #fff; padding: 28px 18px;
    display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.brand-name { font-weight: 700; font-size: 18px; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px;
    color: #d5d8dc; text-decoration: none; font-size: 15px;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-link.active { background: rgba(255,255,255,0.1); color: #fff; font-weight: 600; }
.nav-label { flex: 1; }
.nav-count { background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.sidebar-caption { font-size: 12px; color: #a1a6ad; padding: 0 12px; text-transform: uppercase; letter-spacing: 0.6px; }
.company-static, .company-switch summary {
    display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14); border-radius: 10px; padding: 12px; color: #fff;
}
.company-static { flex-direction: column; align-items: flex-start; gap: 2px; }
.company-static span, .company-text span { font-size: 12px; color: #a1a6ad; }
.company-text { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.company-switch summary { cursor: pointer; list-style: none; }
.company-switch summary::-webkit-details-marker { display: none; }
.company-switch ul { list-style: none; margin: 6px 0 0; padding: 6px; background: #2c2f33; border-radius: 10px; }
.company-switch li a { display: block; padding: 10px; border-radius: 6px; color: #fff; text-decoration: none; font-size: 14px; }
.company-switch li a:hover, .company-switch li a[aria-current] { background: rgba(255,255,255,0.1); }

.main { flex: 1; min-width: 0; padding: 24px 24px 56px; display: flex; flex-direction: column; gap: 24px; }
.tabbar { display: none; }

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.page-head .grow { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; }
.lead { margin: 0; color: var(--ink-soft); font-size: 15px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500; }
.back:hover { color: var(--ink); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.card-head h2 { flex: 1; }
.card-head a { font-size: 14px; font-weight: 600; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.todo { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.todo-top { display: flex; align-items: center; gap: 8px; }
.todo-top .when { margin-left: auto; font-size: 13px; color: var(--ink-soft); }
.todo-title { font-weight: 600; font-size: 16px; }
.todo-sub { font-size: 14px; color: var(--ink-soft); }
.amount { font-size: 22px; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-main { flex: 999 1 520px; min-width: 0; }
.col-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.empty { color: var(--ink-soft); font-size: 15px; padding: 8px 0; }
.empty-card { text-align: center; padding: 32px 24px; color: var(--ink-soft); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
    border-radius: 9px; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
    border: 1px solid transparent; white-space: nowrap;
}
.btn-primary { background: var(--accent-strong); color: #fff; }
.btn-primary:hover { background: var(--accent-strong-hover); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: #d5d8dc; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-block { flex: 1; }
.btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* Badges */
.badge { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 4px 8px; white-space: nowrap; }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-success { color: var(--success); background: var(--success-bg); }
.badge-warning { color: var(--warning); background: var(--warning-bg); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-muted { color: var(--ink-soft); background: var(--muted-bg); }

/* Order steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.step { display: flex; flex-direction: column; gap: 6px; }
.step-bar { height: 6px; border-radius: 3px; background: var(--line); }
.step-done .step-bar { background: var(--ink); }
.step-current .step-bar { background: var(--accent); }
.step-label { font-size: 12px; color: var(--ink-soft); }
.step-done .step-label { color: var(--ink); font-weight: 600; }
.step-current .step-label { color: var(--ink); font-weight: 700; }
.steps-compact { gap: 4px; }
.steps-compact .step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Lists */
.rows { display: flex; flex-direction: column; }
.row { border-top: 1px solid var(--line-soft); padding: 18px 0; display: flex; flex-direction: column; gap: 12px; }
.row:first-child { border-top: 0; }
.row-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.row-id { font-weight: 700; }
.row-title { font-weight: 600; flex: 1 1 200px; color: var(--ink); text-decoration: none; }
a.row-title:hover { color: var(--accent-strong); }
.row-meta { font-size: 13px; color: var(--ink-soft); }

.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-soft); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 14px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list .num { text-align: right; white-space: nowrap; }
table.list .nowrap { white-space: nowrap; }
table.list a.strong { font-weight: 600; color: var(--ink); text-decoration: none; }
table.list a.strong:hover { color: var(--accent-strong); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #d5d8dc; background: #fff; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* PM card */
.pm { display: flex; align-items: center; gap: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex: 0 0 52px; }
.pm-name { font-weight: 600; font-size: 16px; }
.pm-sub { font-size: 13px; color: var(--ink-soft); }

/* Messages */
.msg { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.msg:first-child { border-top: 0; }
.msg-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: 0 0 8px; background: #d5d8dc; }
.msg-dot.new { background: var(--accent); }
.msg-meta { font-size: 13px; color: var(--ink-soft); }
.msg-text { font-size: 14px; line-height: 1.45; }

/* Stats */
.stats { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-end; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 13px; color: var(--ink-soft); }
.stat-value { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; }
.stat-delta { font-size: 13px; font-weight: 600; }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--ink-soft); }
.bars { flex: 1 1 360px; min-width: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 124px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar { width: 100%; max-width: 28px; border-radius: 4px 4px 0 0; background: var(--ink); min-height: 2px; }
.bar.current { background: var(--accent); }
.bar.future { background: var(--line); }
.bar-label { font-size: 11px; color: var(--ink-soft); }
.products { border-top: 1px solid var(--line-soft); margin-top: 20px; }
.products-caption { font-size: 13px; color: var(--ink-soft); padding: 14px 0 6px; }
.product { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 0; }
.product-name { flex: 1 1 220px; font-weight: 600; }
.product-meta { font-size: 14px; color: var(--ink-soft); }

/* Detail pages */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px 24px; }
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv dt { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.4px; }
.kv dd { margin: 0; font-weight: 600; }
.items td.desc small { display: block; color: var(--ink-soft); font-weight: 400; margin-top: 2px; white-space: pre-line; }
.totals { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-top: 16px; font-size: 15px; }
.totals .grand { font-size: 22px; font-weight: 700; }

.flash { padding: 12px 16px; border-radius: 10px; font-size: 14px; }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.flash-ok { background: var(--success-bg); color: var(--success); }
.note { font-size: 13px; color: var(--ink-soft); }

/* Phone */
@media (max-width: 860px) {
    .sidebar { display: none; }
    .main { padding: 20px 16px 110px; gap: 22px; }
    h1 { font-size: 24px; }
    .card { padding: 16px; }
    .stat-value { font-size: 26px; }
    .tabbar {
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0;
        background: #fff; border-top: 1px solid var(--line); padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); z-index: 50;
    }
    .tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; min-height: 44px; color: var(--ink-soft); text-decoration: none; font-size: 11px; }
    .tab.active { color: var(--accent-strong); font-weight: 700; }
    .tab-count { position: absolute; top: 0; left: 50%; margin-left: 6px; background: var(--accent-strong); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 6px; }
    .mobile-company { display: block !important; }
    table.list .hide-sm { display: none; }
}
.mobile-company { display: none; font-size: 13px; color: var(--ink-soft); }

/* ---- Messages (phase 2) ---- */
.thread-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.thread-row:first-child { border-top: 0; }
.thread-row:hover .thread-subject { color: var(--accent-strong); }
.thread-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.thread-top { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.thread-subject { font-weight: 600; flex: 1 1 200px; }
.thread-row.unread .thread-preview { color: var(--ink); font-weight: 600; }
.thread-preview { font-size: 14px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; }
.conversation { display: flex; flex-direction: column; gap: 14px; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble { max-width: min(640px, 88%); background: var(--bg); border-radius: 14px 14px 14px 4px; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.bubble-row.mine .bubble { background: var(--ink); color: #fff; border-radius: 14px 14px 4px 14px; }
.bubble-meta { font-size: 12px; color: var(--ink-soft); }
.bubble-row.mine .bubble-meta { color: #c9ccd1; }
.bubble-body { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.files { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.files a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.bubble-row.mine .files a { color: #fff; }
.bubble-row.mine .files .note { color: #c9ccd1; }
.form { display: flex; flex-direction: column; gap: 8px; }
.form label { font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 6px; }
.form input[type="text"], .form select, .form textarea {
    font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid #8a9099; border-radius: 9px; background: #fff; color: var(--ink); width: 100%;
}
.form textarea { resize: vertical; min-height: 110px; }
.form input[type="file"] { font: inherit; font-size: 14px; }
.form .btn { align-self: flex-start; margin-top: 8px; }

/* ---- Notifications (phase 3) ---- */
.main { position: relative; }
.topbar { display: flex; justify-content: flex-end; margin-bottom: -20px; }
.bell { position: relative; width: 44px; height: 44px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--ink); text-decoration: none; }
.bell:hover, .bell.active { border-color: var(--ink); color: var(--ink); }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent-strong); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li + li .notif { border-top: 1px solid var(--line-soft); }
.notif { display: flex; align-items: flex-start; gap: 14px; padding: 14px 4px; text-decoration: none; color: var(--ink); }
.notif:hover .notif-title { color: var(--accent-strong); }
.notif-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--muted-bg); color: var(--ink); }
.notif-invoice, .notif-reminder { background: var(--warning-bg); color: var(--warning); }
.notif-payment, .notif-order { background: var(--success-bg); color: var(--success); }
.notif-shipping, .notif-proposal { background: var(--info-bg); color: var(--info); }
.notif-message { background: var(--danger-bg); color: var(--danger); }
.notif-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-title { font-weight: 600; }
.notif.unread .notif-title { font-weight: 700; }
.notif-body { font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere; }
.notif-time { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400 !important; font-size: 15px !important; margin-top: 8px !important; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); flex: 0 0 20px; }
@media (max-width: 860px) {
    .topbar { margin-bottom: -50px; }
    .page-head { padding-right: 56px; }
    .back + .page-head { padding-right: 0; }
    .notif-time { display: none; }
}

/* ---- Analytics (phase 4) ---- */
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--ink-soft); margin: 4px 0 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.key-cur, .vbar-cur { background: #ff4365; }
.key-prev, .vbar-prev { background: #198fd9; }
.chart { position: relative; height: 240px; padding-left: 64px; }
.chart-grid { position: absolute; inset: 0 0 24px 64px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid span { border-top: 1px solid var(--line-soft); position: relative; height: 0; }
.chart-grid span::before { content: attr(data-v); position: absolute; right: calc(100% + 8px); top: -8px; font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.chart-cols { position: relative; height: 100%; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.chart-col { display: flex; flex-direction: column; min-width: 0; }
.chart-pair { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.bar-hit { flex: 1; max-width: 22px; height: 100%; display: flex; align-items: flex-end; background: none; border: 0; padding: 0; cursor: default; }
.bar-hit:hover .vbar, .bar-hit:focus-visible .vbar { filter: brightness(1.12); outline: 2px solid var(--ink); outline-offset: 1px; }
.vbar { display: block; width: 100%; border-radius: 4px 4px 0 0; min-height: 0; }
.chart-x { height: 24px; line-height: 24px; text-align: center; font-size: 11px; color: var(--ink-soft); }
.table-view { margin-top: 14px; font-size: 14px; }
.table-view summary { cursor: pointer; color: var(--accent-strong); font-weight: 600; }
.tip { position: absolute; z-index: 60; background: var(--ink); color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,0.18); }
.tip[hidden] { display: none; }
.tip strong { font-size: 15px; }
.tip span { color: #c9ccd1; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.hbar-label { font-weight: 600; font-size: 14px; }
.hbar-track { height: 14px; }
.hbar-fill { display: block; height: 100%; background: #9aa0a8; border-radius: 0 4px 4px 0; }
.hbar-fill.sel { background: #ff4365; }
.hbar-fill.prev { background: #198fd9; }
.hbar-value { font-size: 14px; font-weight: 600; white-space: nowrap; }
.share { display: inline-block; width: 90px; height: 8px; background: var(--muted-bg); border-radius: 4px; vertical-align: middle; margin-right: 6px; overflow: hidden; }
.share-fill { display: block; height: 100%; background: #198fd9; border-radius: 4px; }
@media (max-width: 860px) {
    .chart { height: 200px; padding-left: 52px; }
    .chart-grid { left: 52px; }
    .chart-cols { gap: 2px; }
    .chart-pair { gap: 1px; }
    .chart-x { font-size: 9.5px; letter-spacing: -0.2px; }
}

/* ---- Sign-in pages (login, register, password) ---- */
.auth-page { background: var(--bg); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); }
.auth-brand { background: var(--ink); color: #fff; padding: 48px 44px; display: flex; flex-direction: column; gap: 40px; }
.auth-logo img { display: block; width: 200px; height: auto; }
.auth-pitch { margin-top: auto; margin-bottom: auto; }
.auth-kicker { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: #ff8aa0; }
.auth-claim { margin: 0 0 24px; font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -0.4px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { position: relative; padding-left: 26px; color: #d5d8dc; font-size: 15px; }
.auth-points li::before { content: ""; position: absolute; left: 0; top: 6px; width: 12px; height: 7px; border-left: 2px solid #ff4365; border-bottom: 2px solid #ff4365; transform: rotate(-45deg); }
.auth-copy { margin: 0; font-size: 13px; color: #a1a6ad; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 32px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { font-size: 26px; }
.auth-card .lead { margin-top: -8px; }
.auth-card .form { gap: 6px; }
.auth-card .form .btn { align-self: stretch; margin-top: 14px; min-height: 48px; font-size: 15px; }
.auth-card .form input[type="email"], .auth-card .form input[type="password"] {
    font: inherit; font-size: 15px; padding: 11px 12px; border: 1px solid #8a9099; border-radius: 9px; background: #fff; color: var(--ink); width: 100%;
}
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 6px; }
.label-row label { margin-top: 0 !important; }
.label-row a { font-size: 13px; font-weight: 600; }
.pw-field { position: relative; }
.pw-field input { padding-right: 76px !important; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: var(--muted-bg); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pw-toggle:hover { background: #e3e5e8; }
.auth-foot { margin: 4px 0 0; padding-top: 16px; border-top: 1px solid var(--line-soft); text-align: center; font-size: 14px; color: var(--ink-soft); }
.auth-foot a { font-weight: 600; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; border: 0; padding: 0; }
.segmented legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.segmented label { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid #8a9099; border-radius: 9px; font-size: 14px !important; font-weight: 600 !important; margin: 0 !important; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:checked + span { color: #fff; }
.segmented label:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--info); outline-offset: 2px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.two-col > div { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-brand { padding: 22px 20px; gap: 0; flex-direction: row; align-items: center; justify-content: space-between; }
    .auth-logo img { width: 150px; }
    .auth-pitch, .auth-copy { display: none; }
    .auth-main { align-items: flex-start; padding: 24px 16px 40px; }
    .auth-card { padding: 24px 20px; }
    .two-col { grid-template-columns: 1fr; }
}

/* Portal sidebar logo */
.brand-logo { display: block; width: 168px; height: auto; }
.auth-card .forgot { align-self: flex-end; font-size: 13px; font-weight: 600; margin-top: 2px; }
.auth-page [hidden] { display: none !important; }

/* ---- Full-width tweaks, search, focus (round 2) ---- */
.shell { align-items: flex-start; }
.topbar { gap: 10px; align-items: center; }
.search { position: relative; flex: 0 1 380px; }
.search input { width: 100%; height: 44px; padding: 0 14px 0 40px; font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; }
.search-group { display: flex; flex-direction: column; }
.search-hit { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 14px 0; border-top: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.search-hit:first-of-type { border-top: 0; }
.search-hit:hover .row-title { color: var(--accent-strong); }
mark { background: #ffe1e7; color: inherit; border-radius: 3px; padding: 0 2px; }

/* Brand focus ring for fields (replaces browser default / extension colours) */
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
    outline: none; border-color: var(--ink) !important; box-shadow: 0 0 0 3px rgba(255, 67, 101, 0.28);
}
/* Neutralise browser autofill tint (yellow, blue or green depending on browser / password manager) */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, textarea:-webkit-autofill, select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important; -webkit-text-fill-color: var(--ink) !important; caret-color: var(--ink); transition: background-color 9999s ease-in-out 0s;
}
input:autofill { background-color: #ffffff !important; }
input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px #ffffff inset, 0 0 0 3px rgba(255, 67, 101, 0.28) !important; }
@media (max-width: 860px) {
    .topbar { margin-bottom: 0 !important; }
    .page-head { padding-right: 0 !important; }
    .search { flex: 1 1 auto; }
}

/* Hidden honeypot field for bots (kept out of view and out of the tab order) */
.hp-field { position: absolute !important; left: -10000px !important; top: auto !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

/* ---- Invoice view and profile edit (round 3) ---- */
.form input[type="email"], .form input[type="tel"], .form input[type="password"] {
    font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid #8a9099; border-radius: 9px; background: #fff; color: var(--ink); width: 100%;
}
.form input:disabled, .form select:disabled, .form textarea:disabled { background: var(--muted-bg); color: var(--ink-soft); border-color: var(--line); }
.form .two-col, .form .three-col { display: grid; gap: 0 14px; }
.form .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form .three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form .two-col > div, .form .three-col > div { display: flex; flex-direction: column; gap: 6px; }
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.edit-grid .edit-wide { grid-column: 1 / -1; }
.pay-mode { padding: 14px 0; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; }
.pay-mode h3 { font-size: 15px; }
.pay-details { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.copy-btn { position: static !important; transform: none !important; margin-left: 8px; vertical-align: middle; }
@media (max-width: 1100px) {
    .edit-grid { grid-template-columns: 1fr; }
    .form .three-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .main { padding: 16px 14px 104px; }
    .form .two-col, .form .three-col { grid-template-columns: 1fr; }
}
.qty-input { width: 120px; font: inherit; font-size: 15px; padding: 9px 10px; border: 1px solid #8a9099; border-radius: 9px; text-align: right; background: #fff; color: var(--ink); }

/* ---- Suggestions page ---- */
.segmented.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segmented.three label { padding: 6px 8px; text-align: center; line-height: 1.25; }
.fb-history { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
.fb-history h3 { font-size: 15px; margin-bottom: 6px; }
.fb-item { padding: 12px 0; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; }
.fb-item:first-of-type { border-top: 0; }
.fb-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fb-text { font-size: 15px; overflow-wrap: anywhere; }
.fb-reply { font-size: 14px; background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.review-card { display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: center; }
.review-card .btn { align-self: stretch; }
.stars { display: flex; gap: 4px; }
@media (max-width: 860px) { .segmented.three { grid-template-columns: 1fr; } }
