/*
 * App-specific overrides on top of the vendored Admina theme.
 *
 * [x-cloak]: Admina's own style.css doesn't define this (same gap the
 * previous Nilova theme had) - needed so Alpine.js (bundled via
 * @livewireScripts) can hide element trees until it has initialized them.
 */
[x-cloak] {
    display: none !important;
}

/*
 * Admina's own style.css points --bg-color at --neutral-50 (#F5F6FA), which
 * is also reused for badges/input backgrounds elsewhere - redefining
 * --neutral-50 itself would shift those too. Overriding --bg-color alone
 * here only changes the page background, to a slightly cooler/whiter tone.
 */
:root {
    --bg-color: #F8F9FB;
}

/*
 * Livewire's WithPagination trait renders its own fixed Bootstrap markup
 * (livewire.pagination_theme = bootstrap, set in AppServiceProvider) that we
 * can't swap for Admina's own pagination markup without publishing and
 * hand-maintaining Livewire's pagination view. Restyle the standard
 * .pagination/.page-link output to roughly match Admina's rounded look
 * instead.
 */
.pagination .page-link {
    border: 0;
    border-radius: 8px;
    margin: 0 2px;
    color: var(--text-secondary-light);
    background: var(--neutral-200);
}

.pagination .page-item.active .page-link {
    background: var(--primary-600);
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    background: transparent;
    color: var(--neutral-400);
}

/*
 * .bordered-table (x-ui.data-table's row style) ships with no :hover rule at
 * all in Admina's own style.css, unlike .table-style which does - every data
 * table in the app used the bordered variant, so rows gave zero hover
 * feedback even when clickable (recovery-cases-index's whole-row wire:click).
 */
.bordered-table tbody tr {
    transition: background-color 0.15s ease;
}

.bordered-table tbody tr:hover td {
    background-color: var(--neutral-50);
}

.bordered-table tbody tr[wire\:click] {
    cursor: pointer;
}

/* A whole list-group-item wrapped in a link (e.g. dashboard "Top Review
   Sources" rows) - light hover feedback so it reads as clickable. */
.list-row-link {
    transition: background-color 0.15s ease;
}

.list-row-link:hover {
    background-color: var(--neutral-50);
}

/* Scan-friendly hover for plain (non-link) list rows inside cards -
   Recent Feedback / Top Doctors / Alerts / recovery-case rows previously
   gave zero visual feedback as the cursor moved down the list. Scoped to
   `.card .list-group-item` so unrelated list-groups elsewhere (if any)
   aren't affected. */
.card .list-group-item {
    border-color: var(--neutral-100);
    transition: background-color 0.15s ease;
}

.card .list-group-item:hover {
    background-color: var(--neutral-50);
}

/*
 * Shared control-width utilities so search/filter inputs across index pages
 * (patients, users, reviews) stop reaching for one-off inline max-width
 * styles that drift between pages (260px vs 200px vs 220px etc.).
 */
.search-input-sm {
    max-width: 240px;
}

.filter-select-sm {
    max-width: 180px;
}

.chart-donut-sm {
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
}

/*
 * Navbar "switch clinic" trigger. Previously `btn-outline-secondary bg-base`:
 * Bootstrap's own .btn-outline-secondary:hover (no !important) lost its
 * background-color to .bg-base's `!important` white fill, but its `color:
 * #fff` still won - so on hover the icon/text turned white against a
 * background that stayed white, i.e. they visually vanished. Dedicated class
 * here keeps a light, on-brand hover instead of relying on that combination.
 */
.clinic-switcher-btn {
    background-color: var(--white);
    border: 1px solid var(--neutral-200);
    color: var(--text-primary-light);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.clinic-switcher-btn:hover,
.clinic-switcher-btn:focus {
    background-color: var(--lilac-50);
    border-color: var(--lilac-200);
    color: var(--lilac-600);
}

/*
 * Dashboard stat-card row (5 x-ui.stat-card siblings next to the fixed-width
 * reputation hero card). Bootstrap's unnumbered .col-xxl is flex-basis:0 but
 * keeps min-width:auto, so the cards overflow onto a new line instead of
 * shrinking to share the row - min-width:0 lets them actually fit.
 */
.stat-col {
    min-width: 0;
}

.stat-col .stat-card-value {
    white-space: nowrap;
}

.stat-col .card-body > .d-flex > p {
    min-width: 0;
}

/*
 * Patient Journey Funnel (dashboard) - a graphic column of tapered trapezoid
 * shapes (clip-path, width computed per-stage in Blade) paired with a stats
 * column of label/value text. Both columns share the same fixed row height
 * (--funnel-row-h) so a shape and its label line up without extra JS.
 */
.funnel-chart {
    --funnel-row-h: 56px;
    display: flex;
    align-items: stretch;
    gap: 20px;
}

.funnel-graphic {
    flex: 0 0 150px;
    display: flex;
    flex-direction: column;
}

.funnel-shape-row {
    height: var(--funnel-row-h);
    display: flex;
    align-items: center;
}

.funnel-shape {
    width: 100%;
    height: 40px;
    border-radius: 6px;
}

.funnel-stats {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.funnel-stat-row {
    height: var(--funnel-row-h);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

/*
 * Recent Appointments (dashboard) - lighter, uppercase column labels instead
 * of bordered-table's default bold 1rem header text. Scoped to this one
 * table via an extra class rather than changing .bordered-table itself,
 * since that class is shared by every other data table in the app.
 */
.table-head-plain thead tr th {
    color: var(--neutral-500) !important;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Numbered rank circle - Top Doctors list (dashboard). */
.rank-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--neutral-100);
    color: var(--neutral-600);
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* x-ui.stat-card: only lift/shadow on hover when it links somewhere (href set) */
.stat-card-linked {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card-linked:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(13, 12, 32, 0.08);
}

/*
 * Kanban board (Recovery Cases board view) - SortableJS drags .kanban-card
 * elements between .kanban-dropzone columns (see RecoveryCasesKanban docblock
 * for why the JS itself isn't touched here). Cards/columns previously had no
 * dedicated hover/drag-affordance CSS at all.
 */
.kanban-column {
    width: 280px;
}

.kanban-dropzone {
    min-height: 80px;
}

.kanban-card {
    cursor: grab;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(13, 12, 32, 0.08);
    border-color: var(--primary-200);
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-ghost {
    opacity: 0.4;
    border: 1px dashed var(--primary-300) !important;
    box-shadow: none !important;
    transform: none !important;
}

/*
 * fs-NN pixel font-size utilities: a leftover convention from the previous
 * (Nilova) theme's own stylesheet, used throughout the app's Blade views for
 * fine-grained text sizing (badges, table cells, list secondary text).
 * Admina's own scale only goes down to named tokens (--font-xxs etc.) and
 * Bootstrap's built-in .fs-1..fs-6 utilities are too coarse, so these are
 * kept as plain px utilities rather than rewriting every view to a
 * differently-grained scale.
 */
.fs-10 { font-size: 10px !important; }
.fs-11 { font-size: 11px !important; }
.fs-12 { font-size: 12px !important; }
.fs-13 { font-size: 13px !important; }
.fs-14 { font-size: 14px !important; }
.fs-16 { font-size: 16px !important; }
.fs-18 { font-size: 18px !important; }
.fs-20 { font-size: 20px !important; }
.fs-22 { font-size: 22px !important; }

/*
 * WhatsApp Templates flow diagram (Integration Settings page) - a small,
 * self-contained flowchart visualizing the real feedback pipeline (see
 * CLAUDE.md's "feedback pipeline" section: request -> classified reply ->
 * positive/negative branch). Built with plain CSS connectors rather than
 * SVG/canvas so it needs no extra chart library and degrades gracefully.
 */
.wa-flow-node {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--neutral-200);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.wa-flow-node:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(13, 12, 32, 0.08);
    border-color: var(--primary-200);
}

.wa-flow-node.is-active {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-600) 18%, transparent);
}

.wa-flow-node + .wa-flow-node {
    margin-top: 14px;
}

.wa-flow-node--root {
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.wa-flow-node__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

/* Animated "flowing" gradient - a subtle traveling pulse standing in for a
   directional arrow, without needing an SVG marker/animation. */
.wa-flow-connector {
    width: 2px;
    height: 28px;
    margin: 2px auto;
    background: linear-gradient(180deg, transparent 0%, var(--primary-300) 35%, var(--primary-600) 50%, var(--primary-300) 65%, transparent 100%);
    background-size: 100% 220%;
    animation: waFlowPulse 2.6s linear infinite;
    border-radius: 2px;
}

.wa-flow-connector--sm {
    height: 20px;
}

@keyframes waFlowPulse {
    0% { background-position: 0 0; }
    100% { background-position: 0 -220%; }
}

.wa-flow-fork {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary-light);
    background: var(--neutral-50);
    border: 1px dashed var(--neutral-300);
    border-radius: 999px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: fit-content;
}

.wa-flow-branch {
    display: flex;
    gap: 24px;
    margin-top: 20px;
    position: relative;
}

.wa-flow-branch::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--neutral-300);
    border-radius: 2px;
}

.wa-flow-branch__col {
    flex: 1;
    min-width: 0;
    position: relative;
}

.wa-flow-branch__col::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    width: 2px;
    height: 20px;
    background: var(--neutral-300);
    transform: translateX(-50%);
}

.wa-flow-branch__label {
    display: block;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.wa-flow-panel {
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: 16px;
    padding: 20px;
    height: 100%;
}

.wa-flow-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary-light);
    background: var(--primary-50);
    border-radius: 10px;
    padding: 10px 12px;
}

@media (prefers-reduced-motion: reduce) {
    .wa-flow-connector {
        animation: none;
    }
}

/* ============================================================
 * Premium SaaS visual layer (Stripe / Linear / Vercel-style polish)
 *
 * Purely additive on top of Admina's own tokens/components above -
 * no markup, route, or Livewire behavior changes ride on this section.
 * Because it targets Admina's existing class names (.card, .twin-menu,
 * .bordered-table, .badge, .dropdown-menu, .navbar-search, ...) the
 * effect cascades to every page that already uses those components,
 * not just the Agency Dashboard this pass started from.
 * ============================================================ */

:root {
    --premium-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --premium-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.04);
    --premium-shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.05);
    --premium-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Admina's default .dashboard-main uses a diagonal purple-tinted
   gradient; the premium spec calls for a single calm, near-white
   canvas so cards/shadows read as the focal point instead. */
.dashboard-main {
    background: var(--bg-color);
}

@media (min-width: 1400px) {
    .dashboard-main-body {
        padding: 24px 32px;
    }
}

/* Keyboard-accessible focus ring - Bootstrap/Admina don't define one,
   so keyboard users previously got no visible focus indicator at all
   on buttons/links/inputs/dropdown items. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.dropdown-item:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-600);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Cards ----------
 * border-radius here isn't just a style choice - Admina's own style.css
 * defines `.radius-20` BEFORE `.card`, so on equal specificity `.card`'s
 * own 8px radius was winning the cascade and silently overriding the
 * `radius-20` class every x-ui.card already adds. Setting it here (this
 * file loads after style.css) fixes every card in the app at once. */
.card {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 8px 24px rgba(15, 23, 42, 0.05);
}

.card .card-header {
    border-color: rgba(15, 23, 42, 0.06) !important;
}

/* Opt-in hover lift for small, purely-informational cards (KPI tiles).
   Deliberately NOT applied to .card in general - a large table/content
   card lifting under the cursor while someone scans rows inside it
   reads as jittery rather than premium. */
.card-hover {
    transition: transform 0.2s var(--premium-ease), box-shadow 0.2s var(--premium-ease);
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--premium-shadow-lg);
}

.stat-card-icon {
    transition: transform 0.2s var(--premium-ease);
}

.card-hover:hover .stat-card-icon {
    transform: scale(1.08);
}

/* KPI value - Admina's .text-2xl token (20px) reads as too small for a
   hero dashboard number; bumped up and tightened without touching the
   shared --font-2xl token other, non-KPI usages also rely on. */
.stat-card-value {
    font-size: 30px !important;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

/* ---------- Selectable option cards (e.g. Bulk Feedback Request's
   "how do you want to bring in patients?" cards) - plain bordered divs,
   not .card, so they need their own hover/selected-state motion. ---------- */
.method-select-card {
    transition: transform 0.18s var(--premium-ease), box-shadow 0.18s var(--premium-ease), border-color 0.18s var(--premium-ease);
}

.method-select-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--premium-shadow-md);
}

/* ---------- Empty states ---------- */
.empty-state-icon {
    box-shadow: 0 0 0 8px color-mix(in srgb, currentColor 6%, transparent);
}

/* ---------- Page head typography ---------- */
.app-page-head h4 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary-light);
}

.app-page-head p {
    font-size: 15px;
}

/* ---------- Buttons ---------- */
.btn {
    transition: transform 0.15s var(--premium-ease), box-shadow 0.2s var(--premium-ease),
        background-color 0.15s var(--premium-ease), border-color 0.15s var(--premium-ease), color 0.15s var(--premium-ease);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--premium-shadow-md);
}

/* ---------- Badges ----------
 * x-ui.badge itself hard-codes `border-radius: 5px` inline, which wins
 * the cascade over any class-based radius rule - every status/impact/
 * priority pill in the app (Responded/Pending, High Impact, etc.) needs
 * the fully-rounded "pill" look, so it's overridden here by targeting
 * the component's own root classes instead of relying on .rounded-pill
 * being added at each call site. */
.badge.rounded-pill,
span.badge.text-sm.fw-medium {
    border-radius: 999px !important;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* ---------- Tables ---------- */
.bordered-table thead th {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--text-secondary-light);
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-100) !important;
    padding-block: 14px;
}

/* Sticky header - a no-op unless a table's own container also sets a
   max-height/overflow-y (kanban-style fixed panes); harmless elsewhere. */
.table-responsive.scroll-sm thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* ---------- Sidebar ---------- */
.twin-sidebar {
    box-shadow: 1px 0 0 var(--neutral-100), var(--premium-shadow-sm);
}

.rail-icon {
    transition: background 0.2s var(--premium-ease), color 0.2s var(--premium-ease), transform 0.15s var(--premium-ease);
}

.rail-icon:hover {
    transform: translateY(-1px);
}

.twin-menu a {
    transition: background 0.18s var(--premium-ease), color 0.18s var(--premium-ease), padding-left 0.18s var(--premium-ease);
}

.twin-menu a:hover {
    padding-left: 18px;
}

.twin-menu li.active a {
    background: var(--primary-600);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--premium-shadow-sm);
}

.twin-menu li.active a:hover {
    background: var(--primary-600);
    color: #fff;
}

/* ---------- Auth screens ----------
 * Admina's own `.auth-left` is a light lilac gradient with a static
 * illustration. Recolored to dark navy (matching the app's dark sidebar
 * decision) with a feature list instead, purely via CSS + the markup
 * change in login.blade.php - no auth/session logic touched. */
.auth-left {
    background: radial-gradient(120% 120% at 0% 0%, #16213A 0%, #0B1220 55%, #070B14 100%);
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(79, 70, 229, 0.25) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(37, 99, 235, 0.2) 0%, transparent 45%);
    pointer-events: none;
}

.auth-feature-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.auth-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.auth-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.04);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.38);
}

/* ---------- Auth hero illustration ---------- */
.auth-wave-bg {
    position: absolute;
    inset-inline-start: 0;
    inset-block-end: 0;
    width: 55%;
    height: auto;
    z-index: 1;
    pointer-events: none;
}

.auth-illustration {
    position: relative;
    min-height: 440px;
}

.auth-float-card {
    position: absolute;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 230px;
    z-index: 3;
}

.auth-float-card--review-1 {
    top: 0;
    right: 0;
}

.auth-float-card--review-2 {
    bottom: 0;
    left: -12px;
}

.auth-avatar-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.auth-mock {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 20px;
    color: #fff;
    backdrop-filter: blur(6px);
    max-width: 340px;
    margin: 56px auto 0;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.auth-mock-topbar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
}

.auth-mock-topbar span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

.auth-mock-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.auth-mock-tile {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-mock-chart {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.auth-recovered-pill {
    position: absolute;
    bottom: 108px;
    right: -8px;
    background: var(--success-600);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.4);
    z-index: 4;
}

@media (max-width: 1399px) {
    .auth-float-card,
    .auth-recovered-pill {
        max-width: 200px;
        font-size: 0.9em;
    }
}

/* ---------- Dark sidebar theme ----------
 * The rail + panel are already fully driven by the --ts-* custom
 * properties declared in Admina's own style.css (see the `:root` block
 * right before `.twin-sidebar`), so re-pointing those four tokens - plus
 * the two things that don't read them (the sidebar's own white
 * background and the version/footer text color) - recolors every
 * descendant (rail icons, menu links, hover/active states, tooltips)
 * without touching any markup or JS. */
.twin-sidebar {
    --ts-text: #94A3B8;
    --ts-heading: #F1F5F9;
    --ts-border: rgba(255, 255, 255, 0.08);
    --ts-hover: rgba(255, 255, 255, 0.06);
    background: #0B1220;
}

/* Flat sidebar: no icon-rail, single always-expanded panel. Zeroing
   --ts-rail-w keeps the existing rail+panel width/margin math (used by
   .dashboard-main etc., a SIBLING of .twin-sidebar not a descendant, so
   this has to live on :root to actually reach it) correct without
   editing every rule that reads it. */
:root {
    --ts-rail-w: 0px;
    --ts-panel-w: 272px;
}

.twin-sidebar--flat .twin-panel {
    width: var(--ts-panel-w);
    opacity: 1;
    pointer-events: auto;
}

.twin-section-label {
    display: block;
    padding: 16px 14px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748B;
}

.twin-version {
    color: #64748B;
}

.twin-panel__logo {
    color: #fff;
}

.twin-mobile-toggle {
    background: #0B1220;
    color: #F1F5F9;
}

/* Reputation gauge widget in the sidebar footer (replaces the old
   text-only upgrade-card) - dark surface to match the sidebar, its own
   border since it sits on an already-dark background. */
.sidebar-reputation-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px 16px;
}

.sidebar-reputation-card .btn-light {
    background: rgba(255, 255, 255, 0.92);
    border: none;
}

.sidebar-reputation-card .btn-light:hover {
    background: #fff;
}

/* ---------- Navbar ---------- */
.navbar-search input {
    box-shadow: var(--premium-shadow-sm);
    transition: box-shadow 0.2s var(--premium-ease);
}

.navbar-search input:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-600) 16%, transparent);
}

/*
 * Navbar "Search pages" results list is Alpine x-show driven, not the usual
 * Bootstrap-JS-driven .dropdown-menu (no .show class ever gets added here).
 * Bootstrap's own base rule for .dropdown-menu is `display: none` with no
 * !important, and Alpine's x-show, when true, just clears any inline style
 * rather than forcing `display: block` - so with nothing else in the cascade
 * to override it, Bootstrap's rule always won and the list never rendered
 * (only the keyboard-Enter / search-icon "jump to first match" shortcuts
 * worked, which read as the box "redirecting directly" with no dropdown).
 * This selector is more specific than the bare `.dropdown-menu` rule, so it
 * wins once Alpine clears the inline `display: none` it sets while closed.
 */
.navbar-search .dropdown-menu {
    display: block;
}

.dropdown-menu {
    border: 1px solid var(--neutral-100);
    box-shadow: var(--premium-shadow-lg);
    border-radius: 14px;
    padding: 8px;
}

.dropdown-item {
    border-radius: 8px;
    transition: background-color 0.15s var(--premium-ease);
}

/* ---------- Global Livewire request indicator ----------
 * A slim top progress bar (Vercel/Linear-style) that appears for the
 * duration of ANY Livewire request app-wide, giving visible feedback
 * for actions that used to update silently (period/granularity toggles,
 * table sorts, form submits, etc). Purely presentational: driven by
 * Livewire's own wire:loading directive, no new JS/state added. */
.premium-progress-bar {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    height: 3px;
    z-index: 2000;
    opacity: 0;
    background: transparent;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.premium-progress-bar.is-active {
    opacity: 1;
    background: linear-gradient(90deg, var(--primary-600), color-mix(in srgb, var(--primary-600) 55%, #8B5CF6));
    background-size: 200% 100%;
    animation: premiumProgress 1.1s ease-in-out infinite;
}

@keyframes premiumProgress {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .premium-progress-bar.is-active {
        animation: none;
        opacity: 0.6;
    }
}

/* ---------- Skeleton loader (for future wire:loading placeholders) ---------- */
@keyframes premiumShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--neutral-100) 25%, var(--neutral-50) 37%, var(--neutral-100) 63%);
    background-size: 400% 100%;
    animation: premiumShimmer 1.4s ease infinite;
    border-radius: 8px;
    color: transparent !important;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
    }
}

/* ---------- Entrance animation ----------
 * Opt-in via .animate-stagger on a row wrapper; subtle, one-time fade-up
 * with a slight stagger across direct children. Not applied globally. */
.animate-stagger > * {
    animation: premiumFadeUp 0.4s var(--premium-ease) both;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.02s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.06s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.10s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.14s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.18s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.22s; }

@keyframes premiumFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .animate-stagger > * {
        animation: none;
    }
}

/*
 * .section-label - referenced across several views (reviews-analytics,
 * reviews-overview, owner-dashboard, super-admin dashboard,
 * integration-settings, the admin layout) as a small eyebrow-style label
 * above a value/paragraph, but no rule for it exists anywhere in Admina's
 * style.css or previously in this file - it has been rendering as
 * unstyled plain text everywhere it's used. Defined once here so all of
 * those call sites pick up real styling at once.
 */
.section-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary-light);
}

/* ============================================================
 * AI Review Analysis tab (Reviews > AI Review Analysis)
 *
 * Admina's own --lilac token (also this app's unrelated "Analytics" tab
 * color) is actually a rose/pink hex (#e11d48), not purple, and --purple
 * (#8252E9) has no scaled 50..700 ramp the way --primary/--success/etc do -
 * so a small dedicated "ai" ramp lives here for this tab's purple AI
 * accent (banner, badges, icon chips, confidence ring, suggested actions).
 * ============================================================ */
:root {
    --ai-50: #F5F3FF;
    --ai-100: #EDE9FE;
    --ai-200: #DDD6FE;
    --ai-600: #7C3AED;
    --ai-700: #6D28D9;
}

.bg-ai { background-color: var(--ai-600) !important; }
.bg-ai-50 { background-color: var(--ai-50) !important; }
.bg-ai-100 { background-color: var(--ai-100) !important; }
.bg-ai-200 { background-color: var(--ai-200) !important; }
.bg-ai-600 { background-color: var(--ai-600) !important; }
.text-ai-600 { color: var(--ai-600) !important; }
.text-ai-700 { color: var(--ai-700) !important; }
.border-ai-100 { border-color: var(--ai-100) !important; }
.border-ai-200 { border-color: var(--ai-200) !important; }

/* "Analyzing feedback from..." banner above the AI cards */
.ai-banner {
    background: var(--ai-100);
    border: 1px solid var(--ai-100);
    border-radius: 16px;
    padding: 16px 20px;
}

.ai-banner-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--ai-600);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.28);
}

/* Confidence radialBar gauge (AI Analysis Confidence card) */
.ai-confidence-ring {
    width: 168px;
    height: 168px;
    margin: 0 auto;
}

/* Slim rounded progress bars (What Patients Love / Needs Improvement) */
.progress-thin {
    height: 8px;
    border-radius: 999px;
    background: var(--neutral-100);
    overflow: hidden;
}

.progress-thin .progress-bar {
    border-radius: 999px;
    transition: width 0.6s var(--premium-ease);
}

/* Segmented control (Detailed AI Insights sub-tabs) - replaces bare
   nav-pills btn-primary/btn-outline-primary toggling with a single
   pill-shaped track, Linear/Stripe-style, instead of separate buttons. */
.segmented-control {
    background: var(--neutral-100);
    border-radius: 10px;
    padding: 4px;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
}

.segmented-control .btn {
    border: 0;
    background: transparent;
    color: var(--text-secondary-light);
    font-weight: 500;
}

.segmented-control .btn.is-active {
    background: #fff;
    color: var(--text-primary-light);
    font-weight: 600;
    box-shadow: var(--premium-shadow-sm);
}

/* Small icon chip in front of each AI Suggested Action row */
.ai-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--ai-100);
    color: var(--ai-600);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

/* ============================================================
 * Table toolbars (All Reviews, and reusable anywhere a list has
 * search + select filters) - pill-style icon selects and a leading-
 * icon search input, replacing plain Bootstrap form-select/form-control
 * chrome.
 * ============================================================ */
.filter-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.filter-pill > i {
    position: absolute;
    left: 14px;
    font-size: 14px;
    color: var(--text-secondary-light);
    pointer-events: none;
}

.filter-pill select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    border: 1px solid var(--neutral-200);
    border-radius: 10px;
    padding: 8px 30px 8px 36px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary-light);
    min-width: 152px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 8 10 13 15 8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-pill select:hover {
    border-color: var(--neutral-300);
}

.filter-pill select:focus {
    outline: none;
    border-color: var(--primary-600);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-600) 14%, transparent);
}

.table-search {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.table-search > i {
    position: absolute;
    left: 14px;
    font-size: 14px;
    color: var(--text-secondary-light);
    pointer-events: none;
}

.table-search input {
    padding-left: 36px !important;
    border-radius: 10px;
}

/* Square icon-only button (table row actions) - Admina's own .btn-sm
   keeps rectangular text padding even with just an <i> child, so icon
   buttons ended up visibly wider than tall. */
.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ============================================================
 * Permission-matrix toggle switch (Roles & Permissions page) -
 * a plain <button>, not a checkbox, since the click handler is a
 * wire:click toggle rather than a form-bound value.
 * ============================================================ */
.perm-toggle {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: var(--neutral-200);
    position: relative;
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.15s var(--premium-ease);
    flex-shrink: 0;
}

.perm-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
    transition: transform 0.15s var(--premium-ease);
}

.perm-toggle.is-on {
    background: var(--success-600);
}

.perm-toggle.is-on::after {
    transform: translateX(16px);
}

.perm-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.perm-toggle:focus-visible {
    outline: 2px solid var(--primary-600);
    outline-offset: 2px;
}
