/*
 * 750AD brand theme, shared by the guest and panel layouts.
 * Tokens come from 750adhealthcare.com. The site's accent teal (#35b0b9) is too
 * light for white text, so --brand is its darker sibling and the accent is kept
 * for rings, dots and other decoration.
 */
:root {
    --brand:         #2a8180;
    --brand-dark:    #1f6766;
    --brand-accent:  #35b0b9;
    --brand-tint:    #edf7f8;
    --brand-wash:    #f2feff;
    --brand-line:    #b9e3e6;
    --forest:        #0a2c0f;
    --gold:          #b8923f;
    --ink:           #2a3b3d;
    --muted:         #5d7173;
    --line:          #e1ecec;
    --page:          #f6fbfb;
    --font-sans:     'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    --font-accent:   'Lora', Georgia, serif;
    --ring:          0 0 0 .2rem rgba(53,176,185,.25);

    --bs-primary: #2a8180;
    --bs-primary-rgb: 42,129,128;
    --bs-info: #35b0b9;
    --bs-info-rgb: 53,176,185;
    --bs-body-font-family: var(--font-sans);
    --bs-body-color: #2a3b3d;
    --bs-body-color-rgb: 42,59,61;
    --bs-secondary-color: #5d7173;
    --bs-border-color: #e1ecec;
    --bs-link-color: #2a8180;
    --bs-link-color-rgb: 42,129,128;
    --bs-link-hover-color: #1f6766;
    --bs-link-hover-color-rgb: 31,103,102;
    --bs-focus-ring-color: rgba(53,176,185,.25);
}

/* Bootstrap paints .text-muted with its own grey, which is colder than the palette. */
.text-muted { color: var(--muted) !important; }

/* ---------- Buttons: the site's pill shape ---------- */
.btn { border-radius: 999px; font-weight: 600; }
.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: 53,176,185;
}
.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-color: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: 53,176,185;
}

.btn-info {
    --bs-btn-color: #06282a;
    --bs-btn-bg: var(--brand-accent);
    --bs-btn-border-color: var(--brand-accent);
    --bs-btn-hover-color: #06282a;
    --bs-btn-hover-bg: #5cc2c9;
    --bs-btn-hover-border-color: #5cc2c9;
    --bs-btn-active-color: #06282a;
    --bs-btn-active-bg: #5cc2c9;
    --bs-btn-active-border-color: #5cc2c9;
    --bs-btn-focus-shadow-rgb: 53,176,185;
}

/* ---------- Forms ---------- */
.form-control, .form-select { border-color: var(--line); border-radius: 10px; }
.form-control:focus, .form-select:focus { border-color: var(--brand-accent); box-shadow: var(--ring); }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { box-shadow: 0 0 0 .2rem rgba(220,53,69,.2); }
.form-control::placeholder { color: #93a5a7; }
.form-check-input { border-color: #bdd0d1; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: var(--brand-accent); box-shadow: var(--ring); }
.form-label { font-weight: 600; font-size: .875rem; }

/* ---------- Eyebrow: the site's "• Our Brand" section label ---------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-accent);
    font-style: italic;
    font-size: .9rem;
    color: var(--forest);
}
.eyebrow::before {
    content: '';
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--brand-accent);
}

/* ==========================================================================
   Guest screens (login, password reset)
   ========================================================================== */
.auth-body { margin: 0; min-height: 100vh; background: #fff; }
.auth-shell { display: flex; min-height: 100vh; }

.auth-brand {
    flex: 0 0 46%;
    position: relative;
    overflow: hidden;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    background: linear-gradient(160deg, var(--brand-wash) 0%, #dcf3f5 100%);
}
/* The lotus mark as a faded watermark, the way the site sits it behind headings. */
.auth-brand::after {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    right: -50px;
    bottom: -40px;
    background: url('../images/750ad-mark.png') center / contain no-repeat;
    opacity: .1;
    pointer-events: none;
}
.auth-brand > * { position: relative; z-index: 1; }

.auth-logo { display: block; align-self: flex-start; height: 62px; width: auto; }

.brand-copy h1 {
    font-size: clamp(2rem, 3.2vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
    margin: 14px 0 18px;
    color: var(--forest);
}
.brand-copy h1 em {
    display: block;
    font-family: var(--font-accent);
    font-weight: 500;
    letter-spacing: -.01em;
}
.brand-copy p { margin: 0; max-width: 38ch; color: var(--ink); font-size: 1.02rem; line-height: 1.65; }

.brand-tags { display: flex; flex-wrap: wrap; gap: 12px 26px; font-size: .9rem; color: var(--ink); }
.brand-tags span { display: inline-flex; align-items: center; gap: 8px; }
.brand-tags i { color: var(--brand-accent); }

.auth-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card-logo { display: none; height: 50px; width: auto; margin-bottom: 28px; }

.auth-title { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; color: var(--forest); }
.auth-subtitle { color: var(--muted); font-size: .95rem; margin: 0 0 32px; }

.auth-card .form-control { border-radius: 12px; padding: 13px 16px; font-size: .95rem; }
.auth-card .btn-primary { padding: 13px; font-weight: 700; font-size: .97rem; }
.auth-card .form-check-label { font-size: .9rem; color: var(--muted); }
.auth-card .invalid-feedback { font-size: .82rem; }
.auth-card .alert { border-radius: 12px; border: none; font-size: .9rem; }
.auth-card .alert-success { background: var(--brand-tint); color: var(--brand-dark); }

/* input with a trailing icon button (password toggle) */
.field { position: relative; }
.field .field-action {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    border: 0;
    background: none;
    color: #7f9496;
    padding: 8px 10px;
    border-radius: 8px;
    line-height: 1;
    cursor: pointer;
}
.field .field-action:hover { color: var(--brand); }
.field:has(.field-action) .form-control { padding-right: 46px; }
/* The error text is a sibling of the input, so it would drag the icon's centre down. */
.field:has(.is-invalid) .field-action { top: 25px; }
.field .form-control.is-invalid { background-image: none; }

.link-brand { color: var(--brand); font-size: .875rem; font-weight: 600; text-decoration: none; }
.link-brand:hover { color: var(--brand-dark); text-decoration: underline; }

.auth-link-button { border: 0; background: none; padding: 0; }

@media (max-width: 991.98px) {
    .auth-brand { display: none; }
    .auth-card-logo { display: block; }
    .auth-panel { padding: 32px 20px; align-items: flex-start; }
}

/* ==========================================================================
   Panel shell (sidebar + top bar)
   ========================================================================== */
.panel-body { background-color: var(--page); }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 260px;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid var(--line);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.sidebar-brand {
    display: block;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}
.sidebar-brand img { display: block; height: 46px; width: auto; }

.sidebar .nav { padding: 6px 12px 16px; }
.sidebar .nav-label { margin: 16px 10px 6px; }
.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 10px;
    color: var(--ink);
    font-size: .9rem;
    font-weight: 500;
    transition: background-color .15s, color .15s;
}
.sidebar .nav-link i { width: 18px; text-align: center; color: var(--brand-accent); transition: color .15s; }
.sidebar .nav-link:hover { background: var(--brand-tint); color: var(--forest); }
.sidebar .nav-link.active { background: var(--brand); color: #fff; font-weight: 600; }
.sidebar .nav-link.active i { color: #fff; }
.sidebar .nav-link:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.nav-count { margin-left: auto; color: #3d2e00; }

.sidebar-user { padding: 14px 16px; border-top: 1px solid var(--line); }
.sidebar-user-link { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; text-decoration: none; }
.sidebar-user-name { color: var(--ink); font-size: .875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    object-fit: cover;
    background: var(--brand);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
}

.main-content { margin-left: 260px; min-width: 0; min-height: 100vh; }

.top-bar {
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.top-bar-title { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; color: var(--forest); }
.top-bar .eyebrow { font-size: .8rem; }
.top-bar-meta { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.role-chip { background: var(--brand-tint); color: var(--brand-dark); }

.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--brand);
}
.sidebar-backdrop { display: none; }

.page-body { padding: 24px; }

@media (max-width: 991.98px) {
    .sidebar {
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar.is-open { transform: none; box-shadow: 0 10px 40px rgba(10,44,15,.2); }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1039;
        background: rgba(10,44,15,.4);
    }
    .sidebar.is-open + .sidebar-backdrop { display: block; }
    .sidebar-toggle { display: inline-grid; place-items: center; }
    .main-content { margin-left: 0; }
    .top-bar { padding: 10px 16px; }
    .top-bar-date { display: none; }
    .page-body { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar, .stat-tile { transition: none; }
}

/* ---------- Bootstrap components inside the panel ---------- */
.card { border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(10,44,15,.04); border-radius: 16px; }
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    color: var(--forest);
    font-weight: 600;
    border-radius: 16px 16px 0 0 !important;
    padding: 16px 20px;
}
.table { --bs-table-hover-bg: var(--brand-wash); }
.table th {
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    background: #f7fbfb;
    border: none;
}
.table td { vertical-align: middle; border-color: #edf4f4; }
.table .btn { white-space: nowrap; }
.badge { font-size: .78rem; padding: 5px 10px; border-radius: 20px; font-weight: 600; }
/* Bootstrap's badge text stays white on yellow unless a page adds .text-dark. */
.badge.bg-warning { color: #3d2e00; }
.modal-content { border: none; border-radius: 16px; }
.alert { border-radius: 12px; }
.pagination {
    --bs-pagination-color: var(--brand);
    --bs-pagination-hover-color: var(--brand-dark);
    --bs-pagination-hover-bg: var(--brand-tint);
    --bs-pagination-focus-color: var(--brand-dark);
    --bs-pagination-focus-bg: var(--brand-tint);
    --bs-pagination-focus-box-shadow: var(--ring);
    --bs-pagination-active-bg: var(--brand);
    --bs-pagination-active-border-color: var(--brand);
}
.nav-pills { --bs-nav-pills-link-active-bg: var(--brand); }
.nav-tabs { --bs-nav-tabs-link-active-color: var(--brand-dark); }
.nav { --bs-nav-link-color: var(--brand); --bs-nav-link-hover-color: var(--brand-dark); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--brand); }
.progress, .progress-stacked { --bs-progress-bar-bg: var(--brand); }
.list-group { --bs-list-group-active-bg: var(--brand); --bs-list-group-active-border-color: var(--brand); }

/* ---------- Dashboard ---------- */
.welcome-card {
    position: relative;
    overflow: hidden;
    padding: 22px 26px;
    border: 1px solid var(--brand-line);
    border-radius: 16px;
    background: linear-gradient(120deg, var(--brand-wash) 0%, #dcf3f5 100%);
}
.welcome-card::after {
    content: '';
    position: absolute;
    width: 170px;
    height: 170px;
    right: 18px;
    top: -18px;
    background: url('../images/750ad-mark.png') center / contain no-repeat;
    opacity: .14;
    pointer-events: none;
}
.welcome-card h2 { margin: 6px 0 2px; font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; color: var(--forest); }
.welcome-card p { margin: 0; color: var(--ink); }

.stat-tile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    height: 100%;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    text-decoration: none;
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.stat-tile:hover { transform: translateY(-2px); border-color: var(--brand-accent); box-shadow: 0 8px 20px rgba(42,129,128,.12); }
.stat-tile:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.stat-tile-label { color: var(--muted); font-size: .85rem; font-weight: 500; }
.stat-tile-value { color: var(--forest); font-size: 2rem; font-weight: 800; line-height: 1.2; }
.stat-tile-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-tint);
    color: var(--brand);
    font-size: 1.05rem;
}
.stat-tile-icon.is-pending { background: #fdf4dc; color: #93700f; }

@media (max-width: 575.98px) {
    .welcome-card::after { right: -40px; opacity: .1; }
}

/* ---------- Searchable dropdowns (Tom Select): line them up with form-select ---------- */
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; }
.ts-control { border-radius: 10px; border-color: var(--line); }
.ts-wrapper.form-select-sm .ts-control { min-height: 31px; padding: .15rem .5rem; font-size: .875rem; }
.ts-wrapper.focus .ts-control { border-color: var(--brand-accent); box-shadow: var(--ring); }
/* Menus can be parented to <body> to escape a scrolling table, so they
   have to clear the sidebar and Bootstrap's modal. */
.ts-dropdown { border-radius: 10px; box-shadow: 0 4px 14px rgba(10,44,15,.1); z-index: 1080; }
.ts-dropdown .active { background: var(--brand-tint); color: var(--brand-dark); }
.ts-dropdown .no-results { padding: .5rem .75rem; color: #7f9496; font-size: .85rem; }
/* Second line under an option, for selects that pass data-data='{"subtitle":…}' */
.ts-sub { display: block; font-size: .7rem; color: #7f9496; line-height: 1.25; }
/* Multi-select: every pick becomes a chip at the top of the box, so what is
   already chosen reads at a glance instead of hiding inside a scrolling list. */
.ts-wrapper.multi .ts-control { gap: 3px; }
.ts-wrapper.multi .ts-control > div { background: var(--brand-tint); color: var(--brand-dark); border: 1px solid var(--brand-line); border-radius: 6px; padding: 1px 4px 1px 7px; font-size: .78rem; }
.ts-wrapper.multi .ts-control > div.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.ts-wrapper.multi .ts-control > div .remove { border-left: 1px solid var(--brand-line); color: var(--brand-dark); padding: 0 5px; }
.ts-wrapper.multi .ts-control > div.active .remove { border-left-color: rgba(255,255,255,.45); color: #fff; }
.ts-wrapper.multi.disabled .ts-control > div { background: #f1f5f9; border-color: #e2e8f0; color: #94a3b8; }
.ts-wrapper.multi.disabled .ts-control > div .remove { display: none; }
/* Hidden, not removed: a disabled picker must not invite a search it will
   refuse, but the box has to keep its height so the row stays aligned. */
.ts-wrapper.disabled .items-placeholder { visibility: hidden; }
/* Search box pinned at the top of the opened menu, with a magnifier icon */
.ts-dropdown .dropdown-input-wrap { position: relative; padding: 8px; border-bottom: 1px solid var(--line); }
.ts-dropdown .dropdown-input-wrap::before {
    content: "\f002"; font-family: "Font Awesome 6 Free"; font-weight: 900;
    position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
    color: #7f9496; font-size: .8rem; pointer-events: none;
}
.ts-dropdown .dropdown-input {
    width: 100%; padding: .4rem .6rem .4rem 2rem;
    border: 1px solid var(--line); border-radius: 8px; box-shadow: none; outline: none;
}
.ts-dropdown .dropdown-input:focus { border-color: var(--brand-accent); box-shadow: var(--ring); }

.min-w-0 { min-width: 0; }
