/* SaaS module mockup — additions on top of the real clinic app.css */

:root {
    --neu-bg: #e2eaf4;
    --neu-surface: #f3f8fe;
    --neu-surface-alt: #e7eff9;
    --neu-shadow-light: #ffffff;
    --neu-shadow-dark: #b3c2d6;
    --shadow-card:
        7px 7px 16px rgba(155, 170, 194, .5),
        -7px -7px 16px rgba(255, 255, 255, .95);
    --shadow-soft:
        3px 3px 8px rgba(155, 170, 194, .45),
        -3px -3px 8px rgba(255, 255, 255, .95);
    --shadow-inset:
        inset 3px 3px 7px rgba(155, 170, 194, .5),
        inset -3px -3px 7px rgba(255, 255, 255, .9);

    --saas-tint-blue: #e7effd;
    --saas-tint-mint: #e5f5ec;
    --saas-tint-amber: #fdf3e1;
    --saas-tint-lilac: #efe9fb;
    --saas-tint-rose: #fdedec;
    --saas-dot-blue: #5b8def;
    --saas-dot-mint: #35a06a;
    --saas-dot-amber: #d9922b;
    --saas-dot-lilac: #7c5bd6;
    --saas-dot-rose: #d4555a;
}

body {
    background: var(--neu-bg);
    color: #2c3e50;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

a { text-decoration: none; }

/* ── App shell ───────────────────────────────────────────────────────── */

.saas-shell { display: flex; min-height: 100vh; }

.saas-sidebar {
    width: 264px;
    flex: 0 0 264px;
    padding: 18px 14px 26px;
    background: var(--neu-surface);
    box-shadow: var(--shadow-card);
    border-radius: 0 22px 22px 0;
}

.saas-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 16px;
    border-bottom: 1px solid rgba(91, 141, 239, .14);
    margin-bottom: 14px;
}

/* An uploaded logo stands in for the console's mark, above its two labels. */
.saas-brand.has-logo {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.saas-brand-logo {
    display: block;
    height: 48px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.saas-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #5b8def, #7c5bd6);
    box-shadow: var(--shadow-soft);
}

.saas-brand strong { display: block; font-size: .95rem; line-height: 1.1; }
.saas-brand span { font-size: .7rem; color: #6b7c93; }

.saas-nav { display: flex; flex-direction: column; gap: 4px; }

.saas-nav-label {
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8595ab;
    padding: 14px 10px 6px;
}

.saas-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    color: #43536a;
    font-size: .84rem;
    font-weight: 600;
}

.saas-nav a i { font-size: 1rem; opacity: .8; }
.saas-nav a:hover { background: var(--saas-tint-blue); color: #2f4f86; }
.saas-nav a.is-active {
    background: var(--saas-tint-blue);
    color: #2f4f86;
    box-shadow: var(--shadow-soft);
}
.saas-nav a.is-active i { opacity: 1; color: var(--saas-dot-blue); }

.saas-main { flex: 1 1 auto; padding: 20px 26px 40px; min-width: 0; }

.saas-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.saas-topbar .clinic-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--neu-surface);
    box-shadow: var(--shadow-inset);
    font-size: .82rem;
    font-weight: 600;
}

.saas-search {
    flex: 1 1 260px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--neu-surface);
    box-shadow: var(--shadow-inset);
    color: #7b8ca3;
    font-size: .82rem;
}

.saas-user {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 14px 7px 8px;
    border-radius: 999px;
    background: var(--neu-surface);
    box-shadow: var(--shadow-soft);
    font-size: .82rem;
    font-weight: 700;
    color: #35455c;
}

.saas-user .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .78rem;
    color: #fff;
    background: linear-gradient(135deg, #5b8def, #3f73d9);
}

.saas-user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.saas-user-text small {
    font-size: .72rem;
    font-weight: 500;
    color: #7b8ca3;
}

.saas-signout button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--neu-surface);
    box-shadow: var(--shadow-soft);
    color: #b23a3a;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
}

.saas-signout button:hover {
    box-shadow: var(--shadow-inset);
    color: #8f2a2a;
}

/* ── Cards, headers, tables ──────────────────────────────────────────── */

.saas-card {
    background: var(--neu-surface);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    padding: 20px 22px;
}

.saas-card + .saas-card { margin-top: 16px; }

/* A public form sits flat: no neumorphic highlight, just a hairline edge. */
.saas-card.is-plain {
    box-shadow: none;
    border: 1px solid #e2e8f1;
}

.saas-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.saas-card-head h2,
.saas-card-head h3 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.saas-card-head p {
    margin: 2px 0 0;
    font-size: .78rem;
    color: #6b7c93;
}

.saas-page-title { font-size: 1.35rem; font-weight: 800; margin: 0; }
.saas-page-sub { font-size: .82rem; color: #6b7c93; margin: 2px 0 0; }

.saas-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.saas-table th {
    font-size: .7rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #8595ab;
    font-weight: 700;
    padding: 0 12px 4px;
    text-align: left;
}
.saas-table td {
    background: var(--neu-surface-alt);
    padding: 12px;
    font-size: .82rem;
    vertical-align: middle;
}
.saas-table tr td:first-child { border-radius: 14px 0 0 14px; }
.saas-table tr td:last-child { border-radius: 0 14px 14px 0; }
.saas-table td .muted { color: #7b8ca3; font-size: .74rem; }
.saas-table td.is-code { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Chips, pills, badges ────────────────────────────────────────────── */

.saas-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    background: var(--saas-tint-blue);
    color: #2f4f86;
}
.saas-chip.is-mint { background: var(--saas-tint-mint); color: #237a4d; }
.saas-chip.is-amber { background: var(--saas-tint-amber); color: #96631a; }
.saas-chip.is-rose { background: var(--saas-tint-rose); color: #a13b3f; }
.saas-chip.is-lilac { background: var(--saas-tint-lilac); color: #5b3fa8; }
.saas-chip.is-grey { background: #eef2f8; color: #66768d; }

.saas-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--saas-dot-mint);
    display: inline-block;
}
.saas-dot.is-amber { background: var(--saas-dot-amber); }
.saas-dot.is-rose { background: var(--saas-dot-rose); }
.saas-dot.is-grey { background: #9aa8bb; }

/* ── KPI tiles ───────────────────────────────────────────────────────── */

.saas-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

.saas-kpi {
    background: var(--neu-surface);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: var(--shadow-soft);
}
.saas-kpi span { font-size: .72rem; color: #7b8ca3; display: block; }
.saas-kpi strong { font-size: 1.3rem; font-weight: 800; display: block; line-height: 1.2; }
.saas-kpi small { font-size: .7rem; color: #8595ab; }

/* ── Plan tiles ──────────────────────────────────────────────────────── */

.saas-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.saas-plan {
    background: var(--neu-surface);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}
.saas-plan.is-featured { outline: 2px solid rgba(91, 141, 239, .5); }
.saas-plan.is-featured::after {
    content: "Most clinics pick this";
    position: absolute;
    top: -11px;
    left: 20px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #5b8def, #7c5bd6);
}
.saas-plan h3 { font-size: .95rem; font-weight: 800; margin: 0; }
.saas-plan .price { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.saas-plan .price small { font-size: .72rem; font-weight: 600; color: #7b8ca3; }
.saas-plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.saas-plan li { font-size: .79rem; color: #4a5a70; display: flex; gap: 8px; }
.saas-plan li i { color: var(--saas-dot-mint); font-size: .9rem; margin-top: 1px; }
.saas-plan li.is-off { color: #9dabbd; }
.saas-plan li.is-off i { color: #b9c5d4; }

/* ── Buttons ─────────────────────────────────────────────────────────── */

.saas-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 12px;
    border: 0;
    font-size: .82rem;
    font-weight: 700;
    background: var(--neu-surface-alt);
    color: #35455c;
    box-shadow: var(--shadow-soft);
}
.saas-btn:hover { color: #22304a; }
.saas-btn.is-primary {
    color: #fff;
    background: linear-gradient(135deg, #5b8def, #3f73d9);
    box-shadow: 0 8px 18px rgba(91, 141, 239, .35);
}
.saas-btn.is-ghost { background: transparent; box-shadow: none; color: #4a5a70; }
.saas-btn.is-sm { padding: 6px 12px; font-size: .75rem; border-radius: 10px; }
/* A capsule is the one highlighted action on a page. */
.saas-btn.is-pill { border-radius: 999px; padding: 9px 20px; }
.saas-btn.is-danger { color: #a13b3f; }

/* ── Wizard sledge ───────────────────────────────────────────────────── */

.saas-steps { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.saas-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--neu-surface);
    box-shadow: var(--shadow-soft);
    font-size: .78rem;
    font-weight: 700;
    color: #6b7c93;
}
.saas-step .num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .7rem;
    background: #eef2f8;
    color: #6b7c93;
}
.saas-step.is-done .num { background: var(--saas-tint-mint); color: #237a4d; }
.saas-step.is-current { color: #2f4f86; }
.saas-step.is-current .num { background: #5b8def; color: #fff; }

/* ── Forms ───────────────────────────────────────────────────────────── */

.saas-field { margin-bottom: 12px; }
.saas-field label {
    display: block;
    font-size: .74rem;
    font-weight: 700;
    color: #55657c;
    margin-bottom: 5px;
}
.saas-field .req { color: #d4555a; }
.saas-input,
.saas-select,
.saas-textarea {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: .82rem;
    background: var(--neu-surface-alt);
    box-shadow: var(--shadow-inset);
    color: #2c3e50;
}
.saas-input::placeholder,
.saas-textarea::placeholder { color: #9dabbd; }
.saas-field small { font-size: .7rem; color: #8595ab; display: block; margin-top: 4px; }

/*
 * Console forms use the clinic app's neumorphic fields, not Bootstrap's white
 * flat box: the console has no pure white in it, and a control that arrives with
 * one (the demo-request approve strip did) reads as a different product.
 */
.saas-main .form-control,
.saas-main .form-select {
    border: 0;
    border-radius: 12px;
    background: var(--neu-surface-alt);
    box-shadow: var(--shadow-inset);
    color: #2c3e50;
    font-size: .82rem;
}

.saas-main .form-control-sm,
.saas-main .form-select-sm {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 10px;
    font-size: .78rem;
}

.saas-main .form-control::placeholder {
    color: #9dabbd;
}

.saas-main .form-control:focus,
.saas-main .form-select:focus {
    border: 0;
    background: var(--neu-surface-alt);
    color: #2c3e50;
    box-shadow:
        var(--shadow-inset),
        0 0 0 3px rgba(91, 141, 239, .18);
    outline: none;
}

.saas-main .form-control.is-invalid,
.saas-main .form-select.is-invalid {
    box-shadow:
        var(--shadow-inset),
        0 0 0 3px rgba(212, 85, 90, .22);
}

.saas-main .form-label {
    font-size: .74rem;
    font-weight: 700;
    color: #55657c;
}

.saas-upload {
    border: 1.5px dashed rgba(91, 141, 239, .45);
    border-radius: 16px;
    padding: 18px;
    text-align: center;
    color: #7b8ca3;
    font-size: .78rem;
    background: var(--neu-surface-alt);
}
.saas-upload i { font-size: 1.4rem; color: #5b8def; display: block; margin-bottom: 6px; }

/* ── Small helpers ───────────────────────────────────────────────────── */

.saas-list { display: flex; flex-direction: column; gap: 10px; }
.saas-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--neu-surface-alt);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: .82rem;
}
.saas-row .icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--saas-tint-blue);
    color: #2f4f86;
}
.saas-row strong { display: block; font-size: .83rem; line-height: 1.35; }
.saas-row span { display: block; font-size: .73rem; color: #7b8ca3; line-height: 1.45; }
.saas-row > div { min-width: 0; }
.saas-row .me-auto { min-width: 0; }

.saas-progress {
    height: 8px;
    border-radius: 999px;
    background: #dfe8f3;
    overflow: hidden;
}
.saas-progress span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #5b8def, #7c5bd6);
}
.saas-progress.is-warn span { background: linear-gradient(90deg, #e6a23c, #d9922b); }

.saas-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid rgba(91, 141, 239, .25); }
.saas-timeline li { position: relative; padding: 0 0 16px 16px; font-size: .79rem; color: #4a5a70; }
.saas-timeline li::before {
    content: "";
    position: absolute;
    left: -25px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--neu-surface-alt);
    border: 2px solid #5b8def;
}
.saas-timeline li strong { display: block; font-size: .82rem; color: #2c3e50; }
.saas-timeline li span { font-size: .72rem; color: #8595ab; }

.saas-split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.saas-split.is-even { grid-template-columns: 1fr 1fr; }

.saas-empty {
    text-align: center;
    padding: 26px 18px;
    color: #7b8ca3;
    font-size: .82rem;
}
.saas-empty i { font-size: 1.6rem; display: block; margin-bottom: 8px; color: #9dabbd; }

.saas-hero {
    background: linear-gradient(135deg, #5b8def, #7c5bd6);
    color: #fff;
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 14px 28px rgba(91, 141, 239, .35);
}
.saas-hero h1 { font-size: 1.45rem; font-weight: 800; margin: 6px 0 8px; }
.saas-hero p { font-size: .85rem; opacity: .92; margin: 0; }
.saas-hero .saas-chip { background: rgba(255, 255, 255, .22); color: #fff; }

@media (max-width: 1100px) {
    .saas-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .saas-plans { grid-template-columns: 1fr; }
    .saas-split, .saas-split.is-even { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .saas-shell { flex-direction: column; }
    .saas-sidebar { width: 100%; flex: 0 0 auto; border-radius: 0 0 22px 22px; }
    .saas-main { padding: 16px; }
}
