/* ══════════════════════════════════════════
   Adviso — GrowThere Theme v4
   Live reference: /design-system (Blazor)

   This file hosts shell, sidebar, forms, tables, cards, etc.
   Peeled-out modules (loaded alongside in App.razor):
     tokens.css         — palette, vars, base typography, dark theme
     auth.css           — login / logout / otp pages
     mud-overrides.css  — MudBlazor brand overrides (inputs, dialogs, popovers, ds-*)
   ══════════════════════════════════════════ */

/* ── App Shell ── */
.adviso-app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
    position: relative;
}

.adviso-right-edge {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 100%;
    background:
        linear-gradient(195deg, rgba(200,164,78,0.07) 0%, transparent 40%),
        linear-gradient(to bottom, #0d3d3c 0%, var(--teal-deeper) 35%, #0a2e2e 100%);
    clip-path: url(#right-edge-curve);
    -webkit-clip-path: url(#right-edge-curve);
    pointer-events: none;
    z-index: 3;
}

.adviso-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.adviso-topbar {
    flex-shrink: 0;
    height: 38px;
    background: var(--card-bg);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 20px 0 20px;
    z-index: 2;
}

html.theme-dark .adviso-topbar {
    border-bottom-color: rgba(255,255,255,0.06);
}

.adviso-topbar-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.topbar-tenant-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 15px;
    color: #1a2a2a;
    letter-spacing: 0.2px;
    padding-right: 12px;
    margin-right: 4px;
    border-right: 1px solid rgba(0,0,0,0.08);
}

.topbar-tenant-logo {
    height: 24px;
    width: auto;
    padding-right: 12px;
    margin-right: 4px;
    border-right: 1px solid rgba(0,0,0,0.08);
}

.theme-dark .topbar-tenant-name {
    color: rgba(255,255,255,0.9);
    border-right-color: rgba(255,255,255,0.12);
}

.theme-dark .topbar-tenant-logo {
    border-right-color: rgba(255,255,255,0.12);
}

.adviso-topbar .client-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}
.adviso-topbar .client-crumb__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
}
.adviso-topbar .client-crumb__link:hover { color: var(--gold, #c8a44e); }
.adviso-topbar .client-crumb__sep { color: rgba(0,0,0,0.25); }
.adviso-topbar .client-crumb__current {
    color: var(--text-primary);
    font-weight: 600;
}
html.theme-dark .adviso-topbar .client-crumb__sep { color: rgba(255,255,255,0.25); }

.adviso-topbar .icon-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    position: relative;
    transition: background 0.15s ease, color 0.15s ease;
}

.adviso-topbar .icon-btn:hover {
    background: var(--cream);
    color: var(--teal);
}

.adviso-topbar .notif-dot {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rose);
    border: 1.5px solid var(--card-bg);
}

.adviso-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 28px;
    background: var(--bg);
    min-height: 0;
}

.adviso-main-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Sidebar profile bottom ── */
.sidebar-profile-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 12px;
    text-align: left;
    border-bottom: none;
    border-top: none;
    margin-bottom: 6px;
}

.sidebar-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: 2px solid rgba(200,164,78,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.sidebar-profile-meta {
    flex: 1;
    min-width: 0;
}

.sidebar-profile-bottom .sidebar-profile-name {
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-profile-bottom .sidebar-profile-role {
    font-size: 11.5px;
}

.sidebar-logo-img {
    max-height: 32px;
    max-width: 160px;
    object-fit: contain;
}

/* ── Sidebar ── */
.adviso-sidebar {
    width: 230px;
    background:
        linear-gradient(195deg, rgba(200,164,78,0.07) 0%, transparent 40%),
        linear-gradient(to bottom, #0d3d3c 0%, var(--teal-deeper) 35%, #0a2e2e 100%);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-radius: 0;
    padding: 0;
    overflow: visible;
    position: relative;
    z-index: 4;
}

.adviso-sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 120% 80% at 20% 0%, rgba(200,164,78,0.06) 0%, transparent 60%),
        radial-gradient(ellipse 100% 60% at 80% 100%, rgba(26,107,106,0.12) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.adviso-sidebar > * {
    position: relative;
    z-index: 1;
}

.adviso-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: -24px;
    width: 24px;
    height: 100%;
    background: inherit;
    clip-path: url(#sidebar-curve);
    -webkit-clip-path: url(#sidebar-curve);
    pointer-events: none;
}

.sidebar-logo {
    padding: 22px 20px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo img {
    height: 32px;
}

.sidebar-logo-fallback {
    font-family: var(--font-body);
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-logo-fallback span {
    color: var(--gold);
}

.sidebar-profile {
    padding: 22px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: 3px solid rgba(200,164,78,0.3);
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 21px;
    color: #fff;
}

.sidebar-profile-name {
    font-family: var(--font-display);
    font-size: 16px;
    color: #fff;
    margin-bottom: 2px;
}

.sidebar-profile-role {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    font-weight: 500;
}

.sidebar-nav {
    padding: 14px 12px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-section-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: rgba(255,255,255,0.25);
    padding: 8px 12px 6px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-size: 14.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1px;
    text-decoration: none;
}

.sidebar-item:hover {
    color: rgba(255,255,255,0.8);
    background: var(--sidebar-hover);
}

.sidebar-logout-form {
    margin: 0;
}

/* Logout is a <form><button> (needs server POST) while other items are <NavLink>
   anchors. <button> brings user-agent padding (1px 6px), text-indent, center
   text-align, and its own font. Fully reset so it renders identical to the
   .sidebar-item anchor siblings. !important forced because MudBlazor's bundled
   min.css ships a bare `button { ... }` reset that otherwise wins on specificity
   (both are 0,1,1). */
button.sidebar-item {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 9px 12px !important;
    border: 0 !important;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-align: left !important;
    text-indent: 0 !important;
    cursor: pointer;
    box-sizing: border-box !important;
    justify-content: flex-start !important;
}

.sidebar-item.active {
    color: var(--sidebar-text-active);
    background: rgba(200,164,78,0.12);
    font-weight: 600;
}

.sidebar-item.active .sidebar-icon-wrap {
    color: var(--gold);
}

.sidebar-icon-wrap {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
}

.sidebar-item.active .sidebar-badge {
    background: rgba(200,164,78,0.2);
    color: var(--gold-muted);
}

/* Nested System Admin: Platform (Agencies, Users) + System (Design System) */
.sidebar-nav-nest {
    margin: 6px 0 8px 0;
    padding: 2px 0 4px 10px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.sidebar-nav-nest + .sidebar-nav-nest {
    margin-top: 2px;
}

.sidebar-subsection-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: rgba(255, 255, 255, 0.22);
    padding: 6px 8px 8px 4px;
}

.sidebar-item-nested {
    padding-left: 10px;
    font-size: 14px;
}

.sidebar-bottom {
    padding: 10px 12px 18px;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-item.muted {
    color: rgba(255,255,255,0.25);
    font-size: 14px;
}

.sidebar-item.muted:hover {
    color: rgba(255,255,255,0.5);
}

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.82rem;
    color: var(--text-primary);
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-wrap {
    position: relative;
}

.search-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box {
    padding: 10px 16px 10px 40px;
    border: 1.5px solid #e0dbd2;
    border-radius: 12px;
    background: var(--card-bg);
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--text-primary);
    width: 260px;
    outline: none;
    transition: var(--transition);
}

.search-box:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(26,107,106,0.1);
}

.search-box::placeholder {
    color: var(--text-muted);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1.5px solid #e0dbd2;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

.icon-btn:hover {
    border-color: #c8c2b8;
    background: #faf8f5;
}

.icon-btn .notif-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    border: 2px solid var(--bg);
}

/* ── Buttons ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    background: var(--teal);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
    box-shadow: 0 2px 8px rgba(26,107,106,0.25);
}

.btn-primary:hover {
    background: var(--teal-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26,107,106,0.3);
}

.btn-gold {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    background: var(--gold);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
    box-shadow: 0 2px 8px rgba(200,164,78,0.3);
}

.btn-gold:hover {
    background: var(--gold-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    padding: 9px 18px;
    border: 1.5px solid #dad4c8;
    border-radius: 10px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
}

.btn-secondary:hover {
    background: var(--cream);
}

/* ── Stats Row ── */
.stats-row {
    display: flex;
    gap: 14px;
}
.stats-row--compact .stat-card {
    flex: 0 1 220px;
    padding: 12px 16px;
}
.stats-row--compact .stat-value {
    font-size: 1.41rem;
}
.stats-row--compact .stat-label {
    font-size: 0.65rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    flex: 1;
    transition: var(--transition);
    cursor: default;
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.stat-card .stat-stripe {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-label {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.71rem;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
}

.stat-change.up {
    color: var(--sage);
}

.stat-change.down {
    color: var(--rose);
}

/* ── Content Layout ── */
.content-area {
    flex: 1;
    display: flex;
    gap: 20px;
    overflow: hidden;
}

.content-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-right {
    width: 360px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ── Table Card ── */
.table-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.03);
}

.table-header {
    display: flex;
    align-items: center;
    padding: 16px 22px;
    gap: 12px;
}

.table-title {
    font-family: var(--font-display);
    font-size: 1.12rem;
}

.table-count {
    font-size: 0.71rem;
    font-weight: 700;
    color: var(--teal);
    background: var(--teal-light);
    padding: 3px 10px;
    border-radius: 20px;
}

.table-filters {
    margin-left: auto;
    display: flex;
    gap: 3px;
    background: var(--cream);
    padding: 3px;
    border-radius: 10px;
}

.filter-pill {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
}

.filter-pill:hover {
    color: var(--text-secondary);
}

.filter-pill.active {
    background: var(--card-bg);
    color: var(--teal);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    font-weight: 600;
}

.table-wrap {
    flex: 1;
    overflow-y: auto;
}

/* ── Table styling overrides for MudTable inside table-card ── */
.table-card .mud-table {
    box-shadow: none !important;
    background: transparent !important;
}

.table-card .mud-table-head th,
.table-card .mud-table-cell {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--text-muted);
    padding: 10px 18px;
    border-bottom: 1.5px solid var(--cream-dark);
}

.table-card .mud-table-body .mud-table-row {
    border-bottom: 1px solid #f2efe8;
    transition: var(--transition);
    cursor: pointer;
}

.table-card .mud-table-body .mud-table-row:hover {
    background: #faf8f4 !important;
}

.table-card .mud-table-body td {
    padding: 13px 18px;
    font-size: 14px;
    vertical-align: middle;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-primary);
}

/* ── Client Cell ── */
.client-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.client-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0;
    object-fit: cover;
    background: var(--cream-dark);
}

.client-name {
    font-weight: 600;
}

.client-id {
    font-size: 0.71rem;
    color: var(--text-muted);
    margin-top: 1px;
}

/* ── Status Badge ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 600;
}

.status-badge.pending {
    background: var(--teal-light);
    color: var(--teal);
}

.status-badge.in-progress {
    background: var(--gold-light);
    color: var(--gold-dark);
}

.status-badge.completed {
    background: var(--sage-light);
    color: var(--sage);
}

.status-badge.blocked {
    background: var(--rose-light);
    color: var(--rose);
}

.status-badge.review {
    background: var(--steel-light);
    color: var(--steel);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ── Step Progress ── */
.step-progress {
    display: flex;
    gap: 4px;
}

.step-bar {
    width: 20px;
    height: 5px;
    border-radius: 3px;
    background: var(--cream-dark);
}

.step-bar.done {
    background: var(--teal);
}

.step-bar.active {
    background: var(--gold);
}

.step-bar.blocked {
    background: var(--rose);
}

/* ── Info Card / Activity ── */
.info-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    border: 1px solid rgba(0,0,0,0.03);
}

.info-card-title {
    font-family: var(--font-display);
    font-size: 0.94rem;
    margin-bottom: 14px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 9px 0;
    position: relative;
}

.activity-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 14px;
    top: 36px;
    bottom: -9px;
    width: 1.5px;
    background: var(--cream-dark);
}

.activity-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
}

.activity-dot.teal {
    background: var(--teal-light);
    color: var(--teal);
}

.activity-dot.gold {
    background: var(--gold-light);
    color: var(--gold-dark);
}

.activity-dot.rose {
    background: var(--rose-light);
    color: var(--rose);
}

.activity-text {
    font-size: 0.79rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.activity-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-time {
    font-size: 0.71rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Modules Bar ── */
.modules-bar {
    background: var(--teal-deeper);
    border-radius: var(--radius);
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: auto;
    flex-shrink: 0;
}

.modules-bar-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    min-width: fit-content;
}

.modules-bar-label span {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255,255,255,0.35);
}

.module-chips {
    display: flex;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.module-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(4px);
    cursor: default;
    transition: var(--transition);
    min-width: 85px;
    border: 1px solid rgba(255,255,255,0.06);
}

.module-chip:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.module-chip-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.module-chip-icon.teal {
    background: rgba(26,107,106,0.3);
    color: #5cc5c3;
}

.module-chip-icon.gold {
    background: rgba(200,164,78,0.3);
    color: var(--gold-muted);
}

.module-chip-icon.steel {
    background: rgba(184,200,216,0.2);
    color: var(--steel);
}

.module-chip-icon.sage {
    background: rgba(106,154,106,0.3);
    color: #8ac48a;
}

.module-chip-name {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
}

.module-chip-stat {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
}

.module-chip-full {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 12px;
    background: var(--gold);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(200,164,78,0.3);
    transition: var(--transition);
    min-width: 70px;
    text-align: center;
    line-height: 1.3;
    text-decoration: none;
}

.module-chip-full:hover {
    background: var(--gold-dark);
    transform: translateY(-2px);
}

/* ── Form Panel ── */
.form-panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    border: 1px solid rgba(0,0,0,0.03);
}

.form-panel-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 10px;
    background: var(--teal-deeper);
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
}

.form-panel-title {
    font-family: var(--font-display);
    font-size: 18px;
    color: #fff;
}

.form-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--teal);
    padding-top: 4px;
    margin-bottom: -2px;
}

/* Stronger subsection titles — distinct from field labels (sans 12px) */
.form-section-heading {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    margin: 18px 0 0 0;
    padding: 0 0 10px 0;
    border-bottom: 1px solid var(--cream-dark);
    line-height: 1.3;
}

.form-body > .form-section-heading:first-of-type,
.create-form-split:first-child .create-form-split-main > .form-section-heading:first-of-type {
    margin-top: 0;
}

.create-form-split + .create-form-split .create-form-split-main > .form-section-heading:first-of-type {
    margin-top: 0;
}

.form-section-heading-note {
    display: block;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0;
    text-transform: none;
}

/* Create template: full-width panel; each section row = main + sticky point-at rail */
.create-form-layout {
    width: 100%;
    max-width: none;
}

/* Dashed demo: modest horizontal pad (16px) so .form-body 20px does not stack with a second 20px outer layer */
.create-template-demo {
    background: var(--bg);
    border: 2px dashed var(--cream-dark);
    border-radius: var(--radius);
    padding: 12px 16px 18px;
    width: 100%;
    box-sizing: border-box;
}

/* Sticky callouts need visible overflow on ancestors (not hidden) */
.form-panel.create-form-panel--full {
    overflow: visible;
}

.form-panel.create-form-panel--full .form-body {
    overflow: visible;
    /* Same horizontal rhythm as .form-panel-header (20px) */
    padding: 18px 20px 20px;
    gap: 18px;
}

/* Create template: vertical rhythm — labels, subheaders, rows */
.form-panel.create-form-panel--full .form-group {
    gap: 10px;
}

.form-panel.create-form-panel--full .form-row {
    gap: 14px;
}

.form-panel.create-form-panel--full .create-form-split-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-panel.create-form-panel--full .create-form-split-main > .form-section-heading {
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: 12px;
}

.create-form-split {
    display: grid;
    width: 100%;
    /* ~60% form / ~40% tips (3fr : 2fr) */
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 16px 24px;
    align-items: start;
}

.create-form-split-main {
    min-width: 0;
}

.create-form-split-rail {
    position: sticky;
    top: 16px;
    align-self: start;
    min-width: 0;
}

/* Point-at callouts: in-flow column so tails read toward the form (not fixed over sidebar) */
.create-point-bubble {
    display: flex;
    align-items: flex-start;
    gap: 0;
    max-width: 100%;
}

.create-point-bubble-pointer {
    position: relative;
    flex: 0 0 18px;
    width: 18px;
    min-height: 48px;
    align-self: stretch;
}

.create-point-bubble-pointer-outer {
    position: absolute;
    right: -1px;
    top: 32px;
    width: 0;
    height: 0;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-right: 14px solid var(--cream-dark);
}

.create-point-bubble-pointer-inner {
    position: absolute;
    right: 0;
    top: 33px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 12px solid var(--card-bg);
}

.create-point-bubble-panel {
    flex: 1;
    min-width: 0;
    background: var(--card-bg);
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius);
    padding: 14px 16px 16px;
    box-shadow: var(--shadow-hover);
}

.create-point-bubble-kicker {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--teal);
    margin-bottom: 2px;
}

.create-point-bubble-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.2;
}

.create-point-bubble-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.create-point-bubble-list li {
    margin-bottom: 6px;
}

.create-point-bubble-list li:last-child {
    margin-bottom: 0;
}

@media (max-width: 1100px) {
    .create-form-split {
        grid-template-columns: 1fr;
    }

    .create-form-split-rail {
        position: static;
    }

    .create-point-bubble-pointer-outer,
    .create-point-bubble-pointer-inner {
        display: none;
    }

    .create-point-bubble-pointer {
        display: none;
    }
}

.form-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group.full {
    grid-column: 1 / -1;
}

/* Note: .form-input / .form-label / select.form-input were retired in Phase 5
   of the form-styling consolidation. App pages use MudBlazor inputs instead
   (see mud-overrides.css). Keep .form-body / .form-row / .form-group / .form-section-heading
   as pure layout wrappers — safe to nest MudTextField inside. */

.form-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--cream);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Page breadcrumb — clearer than a lone “Back to …” link */
.page-crumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 0.76rem;
    line-height: 1.4;
    margin-bottom: 10px;
    font-family: var(--font-body);
}

.page-crumb-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--teal);
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    padding: 6px 10px 6px 8px;
    margin: -6px -10px -6px -8px;
    transition: var(--transition);
}

.page-crumb-link:hover {
    background: var(--teal-light);
    text-decoration: none;
}

.page-crumb-link:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

.page-crumb-sep {
    color: var(--text-muted);
    font-weight: 500;
    user-select: none;
}

.page-crumb-current {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Client detail — header row with title on left, stats on right */
.detail-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.detail-header-left {
    flex: 1 1 auto;
    min-width: 320px;
}
.detail-stats {
    flex: 0 0 auto;
    align-self: flex-start;
    margin-top: 8px;
}

/* Detail title — avatar + name */
.detail-title {
    display: flex;
    align-items: center;
    gap: 14px;
}
.detail-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--teal);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: var(--cream-dark);
}

/* Meta chips — informational pills used under page headers */
.meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--card-bg);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 999px;
    font-size: 0.71rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.4;
}
.meta-chip svg {
    color: var(--teal);
    flex-shrink: 0;
}
.meta-chip strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Client detail — layout utilities */
.meta-chips--spaced {
    margin-top: 6px;
}
.detail-tabs {
    display: flex;
    gap: 3px;
    background: var(--cream);
    padding: 3px;
    border-radius: 10px;
    margin-top: 16px;
    width: fit-content;
}
.detail-tabs__count {
    opacity: 0.6;
}
.detail-content {
    margin-top: 16px;
}
.detail-profile-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 16px;
    align-items: start;
}
.detail-profile-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-body--inset {
    padding: 12px 0 0;
}
.activity-empty {
    color: var(--text-muted);
    font-size: 0.82rem;
    padding-top: 8px;
}
.activity-list {
    padding-top: 8px;
}
.btn-icon-inline {
    vertical-align: middle;
    margin-right: 4px;
}

/* Settings — practice logo preview & starter tiles (design system) */
.settings-logo-preview {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.settings-logo-preview--sm {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    box-shadow: none;
    border: none;
}

.settings-logo-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: var(--card-bg);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
}

.settings-logo-tile:hover {
    border-color: var(--cream-dark);
}

.settings-logo-tile.active {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(26, 107, 106, 0.12);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d8d2c6;
    border-radius: 3px;
}

.policy-count {
    font-weight: 700;
}

/* ── Date styling ── */
.date-cell {
    color: var(--text-secondary);
    font-size: 0.79rem;
}

.date-overdue {
    color: var(--rose) !important;
    font-weight: 600;
}

/* ── Empty state ── */
.empty-state {
    padding: 48px 28px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    color: var(--text-muted);
}

.empty-state-title {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state-hint {
    font-size: 14px;
    max-width: 320px;
    margin: 0 auto 16px;
    line-height: 1.45;
}

/* ── Inline alerts (Adviso.Web.Components.Shared.Notifications.InlineAlert) ── */
.inline-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border-left: 4px solid var(--text-muted);
    background: var(--cream);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

.inline-alert--success { border-left-color: var(--sage); background: var(--sage-light); }
.inline-alert--info    { border-left-color: var(--steel); background: var(--steel-light); }
.inline-alert--warning { border-left-color: var(--gold);  background: var(--gold-light); }
.inline-alert--error   { border-left-color: var(--rose);  background: var(--rose-light); }

.inline-alert-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--text-muted);
    font-family: var(--font-body);
}

.inline-alert--success .inline-alert-icon { background: var(--sage); }
.inline-alert--info    .inline-alert-icon { background: var(--steel); color: var(--text-primary); }
.inline-alert--warning .inline-alert-icon { background: var(--gold); }
.inline-alert--error   .inline-alert-icon { background: var(--rose); }

.inline-alert-body { flex: 1; min-width: 0; }
.inline-alert-title { font-weight: 700; margin-bottom: 2px; }
.inline-alert-content { color: var(--text-secondary); }

.inline-alert-dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
}
.inline-alert-dismiss:hover { background: rgba(0,0,0,0.06); color: var(--text-primary); }

/* Data grid pager — left group (rows-per-page + count), right group (paging arrows) */
.adviso-pager {
    padding: 8px 18px;
    font-size: 13px;
    color: var(--text-muted);
}
.adviso-pager .mud-table-pagination-toolbar {
    padding-left: 0;
    padding-right: 0;
    border-top: none;
}
.adviso-pager .mud-table-pagination,
.adviso-pager .mud-table-pagination-display {
    border-top: none;
}
.adviso-pager .mud-table-pagination-spacer { display: none; }
.adviso-pager .mud-table-pagination-actions { margin-left: auto; }
/* Pager rows-per-page select: shrink anchor so the relative-width popover follows */
.adviso-pager .mud-table-pagination-select.mud-input-control.mud-select {
    min-width: 0 !important;
    width: 80px !important;
    flex: 0 0 80px !important;
}
.adviso-pager .mud-table-pagination-select .mud-input-slot { padding-right: 0 !important; }

/* =========================================================
   Client-scoped shell (ClientLayout)
   ========================================================= */

/* Topbar: constrain to same 1440 column as main content */
.adviso-topbar--client {
    justify-content: center;
    height: 44px;
    padding: 0;
    background:
        linear-gradient(195deg, rgba(200,164,78,0.06) 0%, transparent 40%),
        linear-gradient(to bottom, #0d3d3c 0%, #0f4544 100%);
    border-bottom: 1px solid rgba(0,0,0,0.25);
    overflow: visible;
    position: relative;
    z-index: 1;
}
.adviso-topbar--client .icon-btn {
    color: rgba(255,255,255,0.75);
}
.adviso-topbar--client .icon-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}
.adviso-topbar--client .topbar-row {
    width: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.adviso-topbar--client .client-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}
.adviso-topbar--client .client-crumb__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
}
.adviso-topbar--client .client-crumb__link:hover { color: var(--gold); }
.adviso-topbar--client .client-crumb__sep { color: rgba(255,255,255,0.3); }
.adviso-topbar--client .client-crumb__current {
    color: #fff;
    font-weight: 600;
}
.adviso-topbar--client .topbar-tenant-name {
    color: rgba(255,255,255,0.9);
    border-right-color: rgba(255,255,255,0.15);
}
.adviso-topbar--client .topbar-tenant-logo {
    border-right-color: rgba(255,255,255,0.15);
}

/* Sticky client header strip below topbar — full-bleed bg, constrained content */
.client-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background:
        linear-gradient(195deg, rgba(200,164,78,0.07) 0%, transparent 40%),
        linear-gradient(to bottom, #0d3d3c 0%, var(--teal-deeper, #0a2e2e) 100%);
    border-bottom: 1px solid rgba(0,0,0,0.3);
    flex-shrink: 0;
    padding: 0;
}
.client-header {
    overflow: visible !important;
}
.client-header__row {
    width: 100%;
    padding: 16px 24px 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 28px;
    position: relative;
}
.client-header__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}
.client-header__name {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 32px;
    color: #fff;
    line-height: 1;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.client-header__avatar-big {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(200,164,78,0.45);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    filter: grayscale(100%);
    margin-top: -50px;
    margin-bottom: 4px;
}
.client-header__avatar-big--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #fff;
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 700;
    letter-spacing: 1px;
    filter: none;
}
.client-header__side {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.client-header__side--left { align-items: flex-end; }
.client-header__side--right { align-items: flex-start; }
.client-header__chiprow {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.client-header__side--left .client-header__chiprow { justify-content: flex-end; }
.client-header__identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-shrink: 0;
}
.client-header__chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.client-header .meta-chip {
    white-space: nowrap;
    flex-shrink: 0;
}
.client-header .meta-chip__label {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    margin-right: 2px;
}
.client-header .meta-chip--action {
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.client-header .meta-chip--action:hover {
    background: rgba(200,164,78,0.15);
    border-color: rgba(200,164,78,0.4);
}
.client-header .meta-chip--flag-ok {
    background: rgba(106,154,106,0.15);
    border-color: rgba(106,154,106,0.35);
}
.client-header .meta-chip--flag-ok svg { color: #8bc48b; }
.client-header .meta-chip--flag-warn {
    background: rgba(200,164,78,0.18);
    border-color: rgba(200,164,78,0.4);
}
.client-header .meta-chip--flag-err {
    background: rgba(184,96,96,0.2);
    border-color: rgba(184,96,96,0.4);
}
.client-header__identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.client-header__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}
.client-header__avatar {
    border-color: rgba(200,164,78,0.4);
}
.client-header .meta-chip {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
}
.client-header .meta-chip strong { color: #fff; }
.client-header .meta-chip svg { color: rgba(200,164,78,0.9); }
.client-header__chips {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Body: main (constrained 1440) + right nav pinned to viewport edge */
.adviso-app-shell--client {
    align-items: stretch;
    min-height: 100vh;
}
.adviso-app-shell--client .adviso-sidebar {
    min-height: 100vh;
}
.adviso-app-shell--client .client-body {
    flex: 1;
    min-height: 0;
    display: flex;
    position: relative;
}
.adviso-app-shell--client .client-body > .adviso-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding-right: 230px;
}

/* Right client nav — pinned to viewport edge */
.adviso-app-shell--client .client-nav {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 230px;
    background:
        linear-gradient(165deg, rgba(200,164,78,0.07) 0%, transparent 40%),
        linear-gradient(to bottom, #0d3d3c 0%, var(--teal-deeper) 35%, #0a2e2e 100%);
    padding: 20px 16px;
    overflow-y: auto;
    z-index: 4;
}
/* Wavy bleed on the nav's left edge — attached to parent .client-body so overflow doesn't clip it */
.adviso-app-shell--client .client-body::after {
    content: '';
    position: absolute;
    top: 0;
    right: 230px;
    width: 44px;
    height: 100%;
    background:
        linear-gradient(165deg, rgba(200,164,78,0.07) 0%, transparent 40%),
        linear-gradient(to bottom, #0d3d3c 0%, var(--teal-deeper) 35%, #0a2e2e 100%);
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 100' preserveAspectRatio='none'><path d='M44,0 C26,5 4,8 13,15 C31,22 18,30 7,38 C0,42 22,50 31,55 C40,60 13,68 4,75 C0,80 26,88 22,93 C20,96 31,100 44,100 Z' fill='black'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 100' preserveAspectRatio='none'><path d='M44,0 C26,5 4,8 13,15 C31,22 18,30 7,38 C0,42 22,50 31,55 C40,60 13,68 4,75 C0,80 26,88 22,93 C20,96 31,100 44,100 Z' fill='black'/></svg>");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    pointer-events: none;
    z-index: 4;
}
.adviso-app-shell--client .client-nav > * {
    position: relative;
    z-index: 1;
}
.client-nav::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 120% 80% at 80% 0%, rgba(200,164,78,0.06) 0%, transparent 60%),
        radial-gradient(ellipse 100% 60% at 20% 100%, rgba(26,107,106,0.12) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}
.client-nav > * { position: relative; z-index: 1; }

.client-nav__section { margin-bottom: 20px; }
.client-nav__label {
    font-size: 10px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: rgba(200,164,78,0.85);
    padding: 0 10px 8px;
    font-weight: 600;
}
.client-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: rgba(255,255,255,0.78);
    font-size: 13px;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.client-nav__item:hover {
    background: rgba(255,255,255,0.06);
    color: #ffffff;
}
.client-nav__item.active {
    background: rgba(200,164,78,0.18);
    color: #ffffff;
    font-weight: 600;
}
.client-nav__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.45;
    flex-shrink: 0;
}
.client-nav__item.active .client-nav__dot {
    opacity: 1;
    background: var(--gold);
}

/* Dashboard placeholder grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
}
@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* Profile page stats row + actions */
.detail-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.detail-stats-row__actions {
    display: flex;
    gap: 8px;
}

/* Profile page: edit actions + columns + read-only vs editable fields */
.profile-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}
.profile-actions .btn-primary {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.profile-actions .btn-icon-inline { flex-shrink: 0; }

.profile-split {
    display: grid;
    grid-template-columns: 60fr 40fr;
    gap: 18px 28px;
    align-items: start;
}
@media (max-width: 1100px) {
    .profile-split { grid-template-columns: 1fr; }
}
.profile-split__card { align-self: start; }
.profile-split__tip {
    align-self: center;
    position: relative;
}
.profile-tip {
    background: var(--surface, #fff);
    border: 1px solid var(--border, rgba(0,0,0,0.08));
    border-left: 3px solid var(--gold, #c8a44e);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.profile-split__tip::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: var(--gold, #c8a44e);
    border-radius: 2px;
}
.profile-tip__title {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 15px;
    color: var(--text, #1a2a2a);
    margin-bottom: 6px;
}
.profile-tip__body {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted, #4a5e5e);
}

/* Edit mode: highlight the active card */
.profile-split.is-editing .profile-split__card {
    box-shadow: 0 0 0 2px var(--gold-soft), 0 2px 8px rgba(0,0,0,0.04);
}

/* ========== Send Communication Modal ========== */
.comms-modal {
    border-radius: 16px;
    overflow: hidden;
    max-width: 1040px;
}

.comms-modal .mud-dialog-title {
    background: linear-gradient(135deg, #0f4544 0%, #1a6b6a 100%);
    color: #fff;
    padding: 20px 28px;
    margin: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.comms-modal .mud-dialog-content {
    padding: 28px;
    background: #faf8f4;
}

.comms-modal .mud-dialog-actions {
    padding: 16px 28px;
    background: #fff;
    border-top: 1px solid #ece7df;
    gap: 8px;
}

.comms-modal__header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.comms-modal__header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.comms-modal__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    line-height: 1.2;
    color: #fff;
}

.comms-modal__subtitle {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

.comms-modal__grid {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 28px;
    align-items: stretch;
}

.comms-modal__divider {
    background: linear-gradient(to bottom, transparent, #d9d2c4, transparent);
    width: 1px;
}

.comms-modal__channel {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ece7df;
    border-radius: 12px;
    overflow: hidden;
}

.comms-modal__channel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #ece7df;
    background: #f5f2ed;
}

.comms-modal__channel-head--email {
    background: linear-gradient(90deg, rgba(26,107,106,0.08), transparent);
    border-bottom-color: rgba(26,107,106,0.2);
}

.comms-modal__channel-head--sms {
    background: linear-gradient(90deg, rgba(200,164,78,0.12), transparent);
    border-bottom-color: rgba(200,164,78,0.25);
}

.comms-modal__channel-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #ece7df;
    color: #1a6b6a;
    flex-shrink: 0;
}

.comms-modal__channel-head--sms .comms-modal__channel-icon {
    color: #a8872f;
}

.comms-modal__channel-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a2a2a;
    letter-spacing: 0.2px;
    flex: 1;
}

.comms-modal__channel-badge {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 999px;
    background: #ece7df;
    color: #4a5e5e;
}

.comms-modal__channel-badge--muted { background: #ece7df; color: #6a7272; }
.comms-modal__channel-badge--warn  { background: #f5d9a8; color: #7a5a12; }
.comms-modal__channel-badge--sent  { background: #d6ebd6; color: #2d5a2d; }

.comms-modal__channel-body {
    padding: 16px;
    flex: 1;
}

/* ========== Client header CTA chip (must come last to win) ========== */
.client-header .meta-chip.meta-chip--cta {
    cursor: pointer;
    background: rgba(200,164,78,0.95);
    border: 1px solid rgba(200,164,78,0.95);
    color: #0f2a2a;
    font-family: inherit;
    font-size: 0.71rem;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
}
.client-header .meta-chip.meta-chip--cta svg { color: #0f2a2a; }
.client-header .meta-chip.meta-chip--cta strong { color: #0f2a2a; font-weight: 600; }
.client-header .meta-chip.meta-chip--cta:hover {
    background: #b8923d;
    border-color: #b8923d;
    color: #000;
}
.client-header .meta-chip.meta-chip--cta:hover svg,
.client-header .meta-chip.meta-chip--cta:hover strong {
    color: #000;
}

/* ══════════════════════════════════════════
   Cases — lanes view (Kanban by CaseStatus)
   ══════════════════════════════════════════ */
.lanes-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(280px, 1fr));
    gap: 16px;
    padding: 4px 22px 22px;
    overflow-x: auto;
    align-items: start;
}

.lane-column {
    background: var(--cream-dark);
    border-radius: 12px;
    padding: 14px 12px 16px;
    display: flex;
    flex-direction: column;
    min-width: 280px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.03);
}

.lane-stripe {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--text-muted);
}

.lane-column.lane-open      .lane-stripe { background: var(--teal); }
.lane-column.lane-onhold    .lane-stripe { background: var(--gold); }
.lane-column.lane-completed .lane-stripe { background: var(--sage); }
.lane-column.lane-cancelled .lane-stripe { background: var(--steel); }

.lane-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 10px;
}

.lane-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-primary);
}

.lane-count {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--card-bg);
    padding: 2px 9px;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.05);
}

.lane-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lane-empty {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 18px 6px;
    text-align: center;
    font-style: italic;
}

.case-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.03);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.case-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.case-card:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

.case-card-client {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: break-word;
}

.case-card-workflow {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* Workflow pill — icon + label inside the same tinted chip, colored by the workflow's own color. */
.wf-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.3;
    align-self: flex-start;
    max-width: 100%;
}
.wf-pill .mud-icon-root { color: currentColor; flex-shrink: 0; }
.wf-pill > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Larger variant for page-header use */
.wf-pill--lg {
    font-size: 0.95rem;
    padding: 5px 14px 5px 11px;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
}

/* Subtitle variant — compact, sits under the page title */
.wf-pill--subtitle {
    font-size: 0.72rem;
    padding: 2px 10px 2px 8px;
    gap: 5px;
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Two-line case page title: serif client name (matches .page-title) + muted workflow pill under it */
.case-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.case-title__name {
    font-family: var(--font-display);
    font-size: 1.82rem;
    color: var(--text-primary);
    line-height: 1.1;
}

.case-card-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.case-card-progress-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 34px;
}

.case-card-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--teal-light);
    border-radius: 999px;
    overflow: hidden;
}

.case-card-progress-fill {
    height: 100%;
    background: var(--teal);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.case-card-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.case-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

@media (max-width: 1100px) {
    .lanes-board {
        grid-template-columns: repeat(4, 280px);
    }
}

/* ══════════════════════════════════════════
   Workflow badge (icon + color chip)
   ══════════════════════════════════════════ */
.wf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    flex-shrink: 0;
    line-height: 0;
}
.wf-badge .mud-icon-root { color: currentColor; }

/* Color picker field used in workflow editor */
.color-field { display: flex; flex-direction: column; gap: 6px; }
.color-field__label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}
.color-field__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid rgba(0,0,0,0.12);
    border-radius: 9px;
    background: var(--card-bg);
}
.color-field__swatch {
    appearance: none;
    -webkit-appearance: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}
.color-field__swatch::-webkit-color-swatch-wrapper { padding: 0; border-radius: 7px; }
.color-field__swatch::-webkit-color-swatch { border: none; border-radius: 7px; }
.color-field__hex {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    text-transform: uppercase;
}

/* ══════════════════════════════════════════
   SLA badge
   ══════════════════════════════════════════ */
.sla-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.sla-badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.sla-badge--ontrack  { background: var(--sage-light);  color: #4a7a4a; }
.sla-badge--atrisk   { background: var(--gold-light);  color: var(--gold-dark); }
.sla-badge--breached { background: var(--rose-light);  color: #8a4040; }
.sla-badge--met      { background: var(--teal-light);  color: var(--teal); }


