/* Customer portal (self-service AI assistant). Builds on site.css and admin.css. */

/* ---------- Sign-up and log-in pages ---------- */
.portal-badge { background: rgba(242, 169, 59, .16); color: #f6c35b; border: 1px solid rgba(242, 169, 59, .4); }
.auth-card.auth-card-wide { max-width: 760px; }
.auth-steps { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; font-size: .85rem; color: var(--obt-muted); margin: -0.75rem 0 1.5rem; }
.auth-steps span { display: inline-flex; align-items: center; gap: .35rem; }

.plan-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; }
.plan-option { position: relative; display: block; cursor: pointer; margin: 0; }
.plan-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.plan-option .plan-box { display: block; height: 100%; border: 2px solid var(--obt-line); border-radius: 14px; padding: .9rem 1rem; background: #fff; transition: border-color .15s, box-shadow .15s; }
.plan-option input:checked + .plan-box { border-color: #f2a93b; box-shadow: 0 0 0 4px rgba(242, 169, 59, .18); }
.plan-option input:focus-visible + .plan-box { outline: 3px solid var(--obt-ink); outline-offset: 2px; }
.plan-name { font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.plan-price { font-size: 1.35rem; font-weight: 800; margin: .15rem 0; }
.plan-price small { font-size: .8rem; font-weight: 600; color: var(--obt-muted); }
.plan-popular { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: #fff4dc; color: #6b4300; border-radius: 999px; padding: .15rem .5rem; }
.password-hint { font-size: .85rem; color: var(--obt-muted); }

/* ---------- App frame: sidebar + top bar ---------- */
.portal-app { background: #f6f5f1; }
.portal-shell { display: flex; min-height: 100vh; }
.portal-sidebar { width: 264px; flex: none; background: linear-gradient(180deg, #0b0e13 0%, #12161d 100%); color: rgba(255, 255, 255, .78); }
@media (min-width: 992px) {
    .portal-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
@media (max-width: 991.98px) {
    .portal-sidebar.offcanvas-lg { width: 280px; }
}
.portal-sidebar-inner { display: flex; flex-direction: column; gap: 1.25rem; padding: 1.25rem 1rem; min-height: 100%; }
.portal-brand img { height: 30px; width: auto; }
.portal-account-card { display: flex; gap: .75rem; align-items: center; padding: .75rem; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); }
.portal-account-name { display: block; color: #fff; font-weight: 700; font-size: .95rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-avatar { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: .95rem;
    background: var(--obt-gradient); color: #17120a; }
.portal-avatar-sm { width: 2rem; height: 2rem; border-radius: 50%; font-size: .78rem; }
.min-w-0 { min-width: 0; }
.flex-none { flex: none; }
.portal-status { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; margin-top: .15rem; }
.portal-dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.portal-status.is-live { color: #4ade80; }
.portal-status.is-live .portal-dot { box-shadow: 0 0 0 3px rgba(74, 222, 128, .2); }
.portal-status.is-off { color: #cbd5e1; }

.portal-nav-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .42); margin: 0 0 .35rem .6rem; }
.portal-nav-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px; color: rgba(255, 255, 255, .78); text-decoration: none; font-weight: 600; font-size: .93rem;
    transition: background-color .15s, color .15s; }
.portal-nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .85; }
.portal-nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.portal-nav-link.active { background: rgba(242, 169, 59, .16); color: #ffd98f; box-shadow: inset 3px 0 0 #f2a93b; }
.portal-nav-link:focus-visible { outline: 2px solid #f6b94a; outline-offset: 1px; }
.portal-nav-badge { min-width: 1.4rem; padding: .05rem .45rem; border-radius: 999px; font-size: .72rem; font-weight: 800; text-align: center; background: rgba(255, 255, 255, .12); color: #fff; }
.portal-nav-badge.is-alert { background: #ef4444; }
.portal-nav-link.active .portal-nav-badge { background: #f2a93b; color: #17120a; }
.portal-sidebar-help { margin-top: auto; padding: .9rem; border-radius: 14px; background: rgba(242, 169, 59, .08); border: 1px solid rgba(242, 169, 59, .22); font-size: .85rem; }
.portal-sidebar-help .fw-semibold { color: #ffd98f; }

.portal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.portal-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem; padding: .7rem clamp(1rem, 3vw, 2rem);
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--obt-line); }
.portal-topbar-title { font-weight: 800; font-size: 1.05rem; color: var(--obt-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-menu-btn { font-size: 1.5rem; line-height: 1; padding: .2rem .45rem; border: 1px solid var(--obt-line); border-radius: 10px; }
.portal-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border-radius: 999px; font-size: .82rem; font-weight: 700; text-decoration: none;
    background: #f1eee8; color: var(--obt-ink); white-space: nowrap; }
.portal-chip:hover { background: #e8e3d9; color: var(--obt-ink); }
.portal-chip.is-trial { background: #fff4dc; color: #6b4300; }
.portal-chip.is-alert { background: #fee2e2; color: #991b1b; }
@media (max-width: 575.98px) { .portal-chip { font-size: .75rem; padding: .3rem .6rem; } }
.portal-user-btn { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--obt-line); border-radius: 999px; padding: .2rem .7rem .2rem .25rem; font-weight: 600; background: #fff; }
.portal-content { padding: clamp(1rem, 3vw, 2rem); max-width: 1320px; width: 100%; }
.portal-content .admin-page-head { margin-bottom: 1.5rem; }
.portal-content .admin-title { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
.portal-content .admin-card { border-radius: 16px; }

/* ---------- Home dashboard ---------- */
.portal-welcome { position: relative; overflow: hidden; border-radius: 20px; padding: clamp(1.25rem, 3vw, 2rem); color: rgba(255, 255, 255, .82);
    background: radial-gradient(ellipse 80% 140% at 100% 0%, #3a2c14 0%, #171b22 55%, #0b0e13 100%); box-shadow: var(--obt-shadow); }
.portal-welcome h1 { color: #fff; font-weight: 800; font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: .35rem; }
.portal-welcome .portal-welcome-next { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 700; color: #ffd98f; text-transform: uppercase; letter-spacing: .06em; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1199.98px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-card { background: #fff; border: 1px solid var(--obt-line); border-radius: 16px; padding: 1.1rem 1.15rem; box-shadow: var(--obt-shadow-sm); display: flex; flex-direction: column; gap: .35rem; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kpi-label { font-size: .85rem; font-weight: 600; color: var(--obt-muted); }
.kpi-icon { width: 2.25rem; height: 2.25rem; border-radius: 10px; display: grid; place-items: center; font-size: 1.1rem; }
.kpi-icon.gold { background: #fff4dc; color: #9a5a00; }
.kpi-icon.blue { background: #e8f0ff; color: #1f5bff; }
.kpi-icon.green { background: #def7ea; color: #127a44; }
.kpi-icon.grey { background: #f1eee8; color: #5c6370; }
.kpi-value { font-size: 1.75rem; font-weight: 800; color: var(--obt-ink); line-height: 1.1; }
.kpi-value small { font-size: .9rem; font-weight: 600; color: var(--obt-muted); }
.kpi-foot { font-size: .8rem; color: var(--obt-muted); }
.kpi-foot a { font-weight: 600; }
.kpi-bar { height: 6px; border-radius: 999px; background: #f1eee8; overflow: hidden; }
.kpi-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--obt-gradient); }
.kpi-bar.is-high > span { background: #ef4444; }

.progress-ring-label { font-size: .85rem; font-weight: 700; color: var(--obt-muted); }
.setup-bar { height: 8px; border-radius: 999px; background: #f1eee8; overflow: hidden; }
.setup-bar > span { display: block; height: 100%; background: var(--obt-gradient); border-radius: 999px; }
.setup-list { list-style: none; padding: 0; margin: 0; }
.setup-list li { display: flex; gap: .9rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--obt-line); }
.setup-list li:last-child { border-bottom: 0; }
.setup-list .step-dot { flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #f1eee8; color: #5c6370; }
.setup-list li.done .step-dot { background: #def7ea; color: #127a44; }
.setup-list li.current .step-dot { background: #f2a93b; color: #17120a; }
.setup-list .step-title { font-weight: 700; display: block; color: var(--obt-ink); }
.setup-list li.done .step-title { color: var(--obt-muted); }

.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 575.98px) { .quick-actions { grid-template-columns: 1fr; } }
.quick-action { display: flex; gap: .75rem; align-items: center; padding: .9rem; border-radius: 14px; border: 1px solid var(--obt-line); background: #fff; text-decoration: none; color: var(--obt-ink);
    transition: border-color .15s, box-shadow .15s, transform .15s; }
.quick-action:hover { border-color: #f2a93b; box-shadow: 0 6px 18px -10px rgba(242, 169, 59, .6); transform: translateY(-1px); color: var(--obt-ink); }
.quick-action .kpi-icon { flex: none; }
.quick-action strong { display: block; font-size: .95rem; }
.quick-action span.small { color: var(--obt-muted); }

.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li { padding: .7rem 0; border-bottom: 1px solid var(--obt-line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { font-weight: 600; text-decoration: none; color: var(--obt-ink); }
.mini-list a:hover { color: #9a5a00; text-decoration: underline; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.card-head .admin-card-title { margin-bottom: 0; }
.card-link-sm { font-size: .85rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.empty-mini { text-align: center; padding: 1.25rem .5rem; color: var(--obt-muted); font-size: .9rem; }
.empty-mini i { display: block; font-size: 1.6rem; margin-bottom: .35rem; color: #c9b48a; }

/* ---------- Shared helpers ---------- */
.help-note { display: flex; gap: .75rem; align-items: flex-start; background: #f2f7ff; border: 1px solid #d6e4ff; border-radius: 12px; padding: .85rem 1rem; font-size: .92rem; color: #1e3a6b; }
.help-note > i { font-size: 1.15rem; line-height: 1.3; color: #1f5bff; }
.help-note p:last-child { margin-bottom: 0; }

/* Setup guide tabs and the older checklist (setup page) */
.setup-steps { list-style: none; padding: 0; margin: 0; }
.setup-steps li { display: flex; gap: .85rem; align-items: flex-start; padding: .85rem 0; border-bottom: 1px solid var(--obt-line); }
.setup-steps li:last-child { border-bottom: 0; }
.step-dot { flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #f1eee8; color: #5c6370; }
.setup-steps li.done .step-dot { background: #def7ea; color: #127a44; }
.setup-steps li.current .step-dot { background: #f2a93b; color: #17120a; }
.setup-steps .step-title { font-weight: 700; display: block; }

/* Admin area: same frame, a little wider for tables. */
.admin-app .portal-content.admin-content { max-width: 1560px; }
.attention-list { list-style: none; padding: 0; margin: 0; }
.attention-list li { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem 0; border-bottom: 1px solid var(--obt-line); }
.attention-list li:last-child { border-bottom: 0; }
.attention-list .att-dot { flex: none; width: .6rem; height: .6rem; border-radius: 50%; margin-top: .45rem; background: #f2a93b; }
.attention-list .att-dot.urgent { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
