*,
*::before,
*::after {
    box-sizing: border-box;
}

@font-face {
    font-family: "InterVariable";
    src: url("/assets/fonts/Inter-roman.var.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "InterVariable";
    src: url("/assets/fonts/Inter-italic.var.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

:root {
    color-scheme: light;
    --ink-900: #1b1f2a;
    --ink-700: #2b3345;
    --mist-50: #f5f6fb;
    --mist-100: #eef1f8;
    --glass: rgba(255, 255, 255, 0.8);
    --stroke: rgba(148, 163, 184, 0.3);
    --blue: #83a2db;
    --rose: #fd8e8c;
    --peach: #ffd08a;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    --font-sans: "InterVariable", "Inter", "SF Pro Display", system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, SFMono, Menlo, Consolas, "Liberation Mono", monospace;
}

html,
body {
    height: 100%;
}

body {
    position: relative;
    background: #f6f7fb;
    color: var(--ink-900);
    font-family: var(--font-sans);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    letter-spacing: -0.02em;
    line-height: 1.15;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at top left, rgba(131, 162, 219, 0.3), transparent 45%),
        radial-gradient(circle at 20% 80%, rgba(253, 142, 140, 0.18), transparent 40%),
        radial-gradient(circle at 85% 15%, rgba(255, 208, 138, 0.25), transparent 45%),
        #f6f7fb;
    background-size: cover;
    background-position: center;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR (STRATUS-LIKE) + THEME TOGGLES
   - Este bloque estandariza el sidebar a “pill” flotante tipo Stratus.
   - Soporta DOS implementaciones de markup:
     1) Legacy: <aside class="sidebar"> ... .sidebar-nav/.sidebar-link/.sidebar-icon ...
     2) New:    <aside class="sbar"><div class="sbar-pill"> ... .sbar-nav/.sbar-item ... </div></aside>
   ============================================================ */

/* LEGACY SIDEBAR (si tu layout aún usa .sidebar) */
.sidebar {
    position: fixed;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 72px;
    padding: 14px 10px;
    border-radius: 999px;
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    box-shadow: var(--sidebar-shadow);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1040;
    transition: background-color var(--transition-theme), border-color var(--transition-theme), box-shadow var(--transition-theme);
}

/* Oculta branding dentro del pill (Stratus no muestra texto/brand en sidebar) */
.sidebar-brand { display: none !important; }

/* Items */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* El link envuelve el ícono (hit-area consistente) */
.sidebar-link {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    text-decoration: none;
    color: inherit;
    padding: 0;
}

/* El círculo (ícono) */
.sidebar-icon,
.sidebar-iconbrand {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    border: 1px solid var(--sidebar-icon-border);
    background: var(--sidebar-icon-bg);
    color: var(--sidebar-icon-color);
    transition: background-color var(--transition-theme), border-color var(--transition-theme), color var(--transition-theme), transform var(--transition-theme), box-shadow var(--transition-theme);
}

.sidebar-icon svg { width: 20px; height: 20px; }

/* Hover (sutil) */
.sidebar-link:hover .sidebar-icon {
    background: var(--surface-3);
    border-color: var(--border-strong);
    color: var(--text-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

/* Active (como Stratus: marcado limpio) */
.sidebar-link.is-active .sidebar-icon,
.sidebar-link.active .sidebar-icon,
.sidebar-icon.is-active,
.sidebar-icon.active {
    background: var(--sidebar-icon-active-bg);
    border-color: var(--sidebar-icon-active-border);
    color: var(--sidebar-icon-active-color);
    box-shadow: var(--shadow-soft);
}

/* THEME TOGGLES (usado en sidebar legacy o en cualquier UI) */
.theme-switch {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
}

.theme-btn {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--theme-btn-border);
    background: var(--theme-btn-bg);
    color: var(--theme-btn-color);
    transition: background-color var(--transition-theme), border-color var(--transition-theme), color var(--transition-theme), transform var(--transition-theme), box-shadow var(--transition-theme);
}

.theme-btn svg { width: 20px; height: 20px; display: block; }

.theme-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.theme-btn.is-active {
    background: var(--theme-btn-active-bg);
    border-color: var(--theme-btn-active-border);
    color: var(--theme-btn-active-color);
    box-shadow: var(--shadow-soft);
}

.theme-btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus), var(--shadow-soft);
}


/* CONTENIDO PRINCIPAL */
.content {
    flex: 1;
    margin-left: 104px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: visible;
}

.topbar {
    margin: 1.5rem 2rem 0;
    padding: 1rem 1.5rem;
    border-radius: 24px;
    background: var(--glass);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.topbar-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.app-shell {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem clamp(1.125rem, 2.4vw, 1.75rem) 3rem;
    min-width: 0;
}

.row > [class*="col"] {
    min-width: 0;
}

.surface-card,
.card,
.table-responsive {
    max-width: 100%;
}

.surface-card {
    min-width: 0;
    overflow: hidden;
}

.client-card,
.client-card.surface-card {
    overflow: visible !important;
}

.client-card .dropdown-menu {
    z-index: 2000;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.num,
table,
th,
td {
    font-variant-numeric: tabular-nums;
}

.table-responsive table {
    width: 100%;
    min-width: 640px;
}

.table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--glass);
    backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 rgba(148, 163, 184, 0.35);
}

.num {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* ============================================
   ACCESSIBILITY - FOCUS STATES
   ============================================ */

*:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
    border-radius: 4px;
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 0;
    box-shadow: 0 0 0 5px rgba(131, 162, 219, 0.25);
    border-color: var(--blue);
}

a:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
    text-decoration: underline;
}

.table tbody tr:focus-within {
    background: rgba(131, 162, 219, 0.15);
    box-shadow: inset 4px 0 0 var(--blue);
}

.report-link-card:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 4px;
    transform: translateY(-2px);
    box-shadow: 0 32px 64px rgba(15, 23, 42, 0.18);
}

.skip-to-main {
    position: absolute;
    left: -9999px;
    top: 20px;
    z-index: 9999;
    padding: 1rem 1.5rem;
    background: var(--ink-900);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
}

.skip-to-main:focus {
    left: 20px;
}

/* ============================================
   TABLE SORTING STYLES
   ============================================ */

.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.75rem !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sortable:hover {
    background: rgba(131, 162, 219, 0.12);
}

.sortable:active {
    background: rgba(131, 162, 219, 0.2);
}

.sort-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.35;
    font-size: 0.7rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--ink-700);
}

.sortable:hover .sort-icon {
    opacity: 0.7;
}

.sortable.sort-asc .sort-icon {
    transform: translateY(-50%) rotate(180deg);
    opacity: 1;
    color: var(--blue);
}

.sortable.sort-desc .sort-icon {
    transform: translateY(-50%) rotate(0deg);
    opacity: 1;
    color: var(--blue);
}

.sortable.sort-asc,
.sortable.sort-desc {
    background: rgba(131, 162, 219, 0.08);
    font-weight: 600;
}

/* ============================================
   TABLE CONTROLS & SEARCH
   ============================================ */

.table-controls {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.table-controls .input-group-text {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: rgba(27, 31, 42, 0.6);
}

.table-controls input[type="search"] {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-left: none;
}

.table-controls input[type="search"]:focus {
    box-shadow: 0 0 0 4px rgba(131, 162, 219, 0.15);
    border-color: var(--blue);
}

.table-result-count {
    color: var(--blue);
    font-size: 1.1rem;
}

tr.hidden-by-search {
    display: none !important;
}

.table-no-results {
    padding: 2rem;
    text-align: center;
    color: rgba(27, 31, 42, 0.6);
    font-size: 0.95rem;
}

.surface-card {
    background: var(--glass);
    border: 1px solid var(--stroke);
    border-radius: 24px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.09);
}

.glass-card {
    background: var(--glass);
    border: 1px solid var(--stroke);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.card-soft {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
}

.surface-card .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    font-weight: 600;
}

.card-header-clean {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.card-header-clean > :first-child {
    min-width: 0;
}

.card-header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.icon-pill {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.72);
    color: rgba(27, 31, 42, 0.72);
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.icon-pill:hover {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(131, 162, 219, 0.45);
    color: #2f4f89;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.icon-pill:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(131, 162, 219, 0.28), 0 10px 20px rgba(15, 23, 42, 0.08);
}

.icon-pill i {
    line-height: 1;
}

.card-icon-circle {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: var(--ink-900);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.card-icon-circle--sm {
    width: 40px;
    height: 40px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.card-icon-circle i {
    line-height: 1;
}

.stat-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(251, 252, 255, 0.76));
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.stat-card.stat-mini {
    padding: 1rem;
    border-radius: 18px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.stat-card.stat-mini:hover {
    border-color: rgba(131, 162, 219, 0.38);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.dashboard-summary-card {
    padding: 1.7rem !important;
}

.dashboard-summary-header {
    min-height: 100%;
    align-items: center;
    gap: 1.25rem;
}

.dashboard-summary-card--today .dashboard-summary-header--today {
    min-height: auto;
}

.dashboard-summary-chip {
    margin: 0 0 0.72rem;
}

.dashboard-hero-title {
    font-size: clamp(1.7rem, 2.1vw, 2.2rem);
    line-height: 1.08;
    margin: 0 0 0.52rem !important;
}

.dashboard-summary-copy {
    max-width: 42ch;
    font-size: 0.94rem;
    margin: 0;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-left: auto;
}

.hero-action-btn {
    min-height: 44px;
    border-radius: 999px !important;
    padding: 0.5rem 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.dashboard-today-date {
    font-size: clamp(1.2rem, 1.6vw, 1.48rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0;
}

.dashboard-summary-meta {
    display: inline-block;
    margin-top: 0.22rem;
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dashboard-today-meta {
    gap: 1.25rem !important;
    padding-top: 0.2rem;
}

.dashboard-today-meta small {
    letter-spacing: 0.06em;
    font-size: 0.7rem;
}

.dashboard-kpi-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.dashboard-kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.28rem;
}

.dashboard-kpi-value {
    margin-bottom: 0.1rem !important;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.dashboard-kpi-meta {
    margin-top: auto;
    font-size: 0.84rem;
    line-height: 1.42;
}

.activity-icon-cell {
    width: 56px;
}

.activity-meta {
    font-size: 0.8rem;
}

.report-hero {
    position: relative;
    overflow: hidden;
}

.report-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(131, 162, 219, 0.18), transparent 50%),
        radial-gradient(circle at 10% 70%, rgba(253, 142, 140, 0.12), transparent 55%);
    pointer-events: none;
}

.report-eyebrow {
    letter-spacing: 0.18em;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(27, 31, 42, 0.6);
}

.report-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--ink-700);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.report-chip--blue {
    background: rgba(131, 162, 219, 0.2);
    color: #2f4f89;
}

.report-chip--rose {
    background: rgba(253, 142, 140, 0.2);
    color: #a84947;
}

.report-chip--peach {
    background: rgba(255, 208, 138, 0.35);
    color: #7a4a0f;
}

.report-chip--ink {
    background: rgba(27, 31, 42, 0.12);
    color: #1b1f2a;
}

.report-metric-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.kpi-card {
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
}

.kpi-card.is-active {
    border-color: rgba(127, 161, 220, 0.6);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.16), 0 0 0 2px rgba(127, 161, 220, 0.35);
}

.kpi-card:focus-visible {
    outline: 2px solid rgba(127, 161, 220, 0.6);
    outline-offset: 4px;
}

.kpi-delta {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.report-metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #1b1f2a;
    background: rgba(27, 31, 42, 0.08);
    flex-shrink: 0;
}

.report-metric-icon svg {
    width: 22px;
    height: 22px;
}

.report-metric-icon--blue {
    background: rgba(131, 162, 219, 0.2);
    color: #2f4f89;
}

.report-metric-icon--rose {
    background: rgba(253, 142, 140, 0.2);
    color: #a84947;
}

.report-metric-icon--peach {
    background: rgba(255, 208, 138, 0.25);
    color: #9a5f14;
}

.report-metric-icon--ink {
    background: rgba(27, 31, 42, 0.14);
    color: #1b1f2a;
}

.report-metric-meta {
    font-size: 0.75rem;
    color: rgba(27, 31, 42, 0.6);
}

.report-chart-wrap {
    background: rgba(255, 255, 255, 0.65);
    border-radius: 20px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.report-chart--trend {
    position: relative;
    min-height: 320px;
}

.report-chart--trend > canvas {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 991.98px) {
    .report-chart--trend {
        min-height: 240px;
    }
}

.report-chart-wrap--center {
    display: grid;
    place-items: center;
}

.report-legend {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
}

.report-filter-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.report-filter-reset {
    padding: 0;
    font-size: 0.75rem;
}

.day-filter.is-active {
    background: rgba(131, 162, 219, 0.2);
    border-color: rgba(131, 162, 219, 0.6);
    color: #2f4f89;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.report-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: rgba(27, 31, 42, 0.7);
}

/* AUTH SCREENS */
.auth-shell {
    max-width: 520px;
    margin: 4rem auto;
    padding: 0 1.5rem;
}

.auth-card {
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.auth-header {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.auth-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(131, 162, 219, 0.2);
    color: #2f4f89;
    font-size: 1.4rem;
}

.auth-footer {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(27, 31, 42, 0.65);
}

.report-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.report-legend-dot--blue {
    background: #7fa1dc;
}

.report-legend-dot--rose {
    background: #f08b89;
}

.report-legend-dot--peach {
    background: #f5c47b;
}

.report-legend-dot--ink {
    background: #1b1f2a;
}

.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.report-kpi-caption {
    font-size: 0.75rem;
    color: rgba(27, 31, 42, 0.6);
}

.report-highlight {
    padding: 1rem 1.25rem;
    border-radius: 20px;
    background: rgba(131, 162, 219, 0.15);
    border: 1px solid rgba(131, 162, 219, 0.2);
}

.report-client-list {
    display: grid;
    gap: 0.75rem;
}

.report-client-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.report-client-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: rgba(27, 31, 42, 0.12);
    color: rgba(27, 31, 42, 0.8);
    font-weight: 600;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.report-client-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.report-client-avatar-fallback {
    display: inline-flex;
}

.report-client-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    object-fit: cover;
    background: rgba(27, 31, 42, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(27, 31, 42, 0.8);
}

.report-client-avatar-sm--fallback {
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.report-client-rank {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(27, 31, 42, 0.12);
    font-weight: 600;
    font-size: 0.75rem;
}

.chip,
.stat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 1.75rem;
    padding: 0.28rem 0.78rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
}

.chip i,
.stat-badge i {
    font-size: 0.82rem;
}

.badge-blue {
    background: rgba(131, 162, 219, 0.2);
    color: #3b5b99;
}

.badge-rose {
    background: rgba(253, 142, 140, 0.18);
    color: #b44a48;
}

.badge-peach {
    background: rgba(255, 208, 138, 0.25);
    color: #a06317;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge-status--success {
    background: rgba(34, 197, 94, 0.18);
    color: #166534;
}

.badge-status--warning {
    background: rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.badge-status--danger {
    background: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

.badge-status--secondary {
    background: rgba(148, 163, 184, 0.22);
    color: #475569;
}

.quick-link {
    background: #fff;
    border-radius: 18px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.table-clean tbody tr {
    border-color: rgba(148, 163, 184, 0.2);
}

.table-clean tbody tr:hover {
    background: rgba(131, 162, 219, 0.08);
}

.actions-table-wrap {
    max-height: 340px;
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.56);
}

.actions-table thead th {
    padding: 0.65rem 0.75rem;
    font-size: 0.73rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(27, 31, 42, 0.68);
}

.actions-table tbody td {
    padding: 0.72rem 0.75rem;
    vertical-align: middle;
}

.actions-table tbody tr:hover {
    background: rgba(131, 162, 219, 0.06);
}

.actions-table .icon-pill {
    width: 36px;
    height: 36px;
}

.actions-table .icon-pill i {
    font-size: 0.92rem;
}

.text-muted-light {
    color: rgba(27, 31, 42, 0.72);
}

.is-positive {
    color: #166534;
}

.is-negative {
    color: #9f1239;
}

.is-neutral {
    color: rgba(27, 31, 42, 0.78);
}

.card,
.list-group-item,
.table,
.form-control,
.form-select {
    border-radius: 20px;
    border-color: rgba(148, 163, 184, 0.2);
}

.card {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.9);
}

.btn {
    border-radius: 999px;
    font-weight: 600;
}

@media (max-width: 991px) {
    .content {
        margin-left: 0;
    }

    .sidebar {
        left: -88px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.is-open {
        left: 16px;
    }

    .sidebar-toggle {
        position: fixed;
        left: 16px;
        top: 16px;
        z-index: 1001;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: rgba(27, 31, 42, 0.95);
        color: white;
        border: none;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
        display: grid;
        place-items: center;
        transition: all 0.3s ease;
    }

    .sidebar-toggle:active {
        transform: scale(0.95);
    }

    .sidebar-toggle i {
        font-size: 1.5rem;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.is-active {
        opacity: 1;
        pointer-events: all;
    }

    .topbar {
        margin: 1rem 1rem 0;
        border-radius: 24px;
        padding: 0.75rem 1rem;
    }

    .app-shell {
        margin: 0 auto;
        padding: 1.5rem clamp(1rem, 3vw, 1.5rem);
    }

    .topbar-search {
        width: 160px;
    }

    .dashboard-summary-card {
        padding: 1.45rem !important;
    }

    .hero-actions {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }

    .hero-action-btn {
        flex: 1 1 auto;
    }

    .dashboard-today-meta {
        flex-wrap: wrap;
        gap: 0.85rem !important;
    }
}

@media (min-width: 992px) {
    .sidebar-toggle,
    .sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .card-header-clean {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .topbar {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        border-radius: 20px;
    }

    .topbar-title {
        padding-left: 0;
        font-size: 1rem;
        width: 100%;
    }

    .pt-subnav {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .pt-subnav-link {
        padding: 0.45rem 0.9rem;
        font-size: 0.8rem;
    }

    .topbar-actions {
        width: auto;
        max-width: 100%;
        margin-left: auto;
        justify-content: flex-end;
        padding-right: 0.35rem;
    }

    .topbar-search {
        flex: 1;
        min-width: 160px;
        width: auto;
    }

    .dashboard-summary-header {
        align-items: flex-start;
    }

    .dashboard-hero-title {
        font-size: 1.62rem;
    }

    .hero-action-btn {
        width: 100%;
    }

    .dashboard-kpi-value {
        font-size: 1.9rem;
    }

    .auth-shell {
        margin: 2rem auto;
    }
}

@media (max-width: 576px) {
    .app-shell {
        padding: 1.25rem 1rem 2.5rem;
    }

    .topbar-actions {
        flex-wrap: nowrap;
        gap: 0.45rem;
        padding: 0.24rem;
    }

    .topbar-actions .btn-light {
        width: 42px !important;
        height: 42px !important;
    }

    .topbar-actions .btn-dark {
        width: auto;
        min-height: 42px;
        padding: 0.45rem 0.9rem;
        justify-content: center;
    }

    .stat-card,
    .surface-card,
    .card,
    .quick-link {
        border-radius: 18px;
    }

    .report-kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .dashboard-summary-card {
        padding: 1.25rem !important;
    }

    .dashboard-summary-chip {
        min-height: 1.65rem;
        padding: 0.24rem 0.7rem;
    }

    .dashboard-today-date {
        font-size: 1.16rem;
    }

    .dashboard-kpi-value {
        font-size: 1.78rem;
    }

    .cashflow-chart-wrap {
        height: 220px;
    }

    .cashflow-chart-wrap-premium {
        height: 300px;
        padding: 0.75rem;
    }

    .chart-tooltip {
        padding: 10px 14px;
        font-size: 12px;
    }

    .tooltip-value {
        font-size: 16px;
    }
}

/* --- FIX: Modal sólido para que NO se vea el dashboard detrás --- */
#invoiceModal .modal-content.surface-card {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: none !important;   /* quita blur dentro del modal */
  -webkit-backdrop-filter: none !important;
}

/* Si tu surface-card usa "brillos" con ::before/::after, los apagamos SOLO en este modal */
#invoiceModal .modal-content.surface-card::before,
#invoiceModal .modal-content.surface-card::after {
  content: none !important;
}

/* Inputs/textarea dentro del modal: fondo sólido */
#invoiceModal .form-control,
#invoiceModal .form-select {
  background: #fff !important;
}

/* Ajustes de legibilidad */
#invoiceModal .form-text {
  font-size: .82rem;
  margin-top: .35rem;
}

/* Textarea más estable visualmente */
#invoiceModal textarea.form-control {
  min-height: 120px;
}

/* Backdrop un poco más oscuro para separar */
.modal-backdrop.show {
  opacity: .55;
}

/* --- Scrollable modals: glass legibility --- */
.modal-dialog-scrollable .modal-content {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

html[data-theme="dark"] .modal-dialog-scrollable .modal-content {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: rgba(148, 163, 184, 0.24);
}

/* --- Command Palette --- */
#commandPaletteModal .modal-dialog {
  max-width: 720px;
}

#commandPaletteModal .modal-content.command-palette {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(18px);
}

.command-palette-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #f1f5f9;
  color: #0f172a;
}

.command-palette-input {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: none;
  padding: 0.85rem 1rem;
  font-weight: 600;
}

.command-palette-input:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 0.15rem rgba(15, 23, 42, 0.15);
}

.command-palette-kbd {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
}

.command-palette-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.command-palette-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  align-items: center;
  text-align: left;
  border: 1px solid transparent;
  background: #fff;
  border-radius: 16px;
  padding: 0.85rem 1rem;
  transition: all 0.15s ease;
  font-weight: 600;
  color: #0f172a;
}

.command-palette-item:hover,
.command-palette-item.is-selected {
  border-color: rgba(15, 23, 42, 0.2);
  background: rgba(15, 23, 42, 0.04);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.command-palette-label {
  font-size: 0.95rem;
}

.command-palette-meta {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
}

.command-palette-section {
  justify-self: end;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
  background: #f1f5f9;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.command-palette-empty {
  padding: 1.5rem;
  text-align: center;
  border-radius: 16px;
  background: #f8fafc;
  color: #94a3b8;
  font-weight: 600;
}

/* --- Topbar style: Stratus-like --- */
.topbar {
    margin: 0.35rem 1.5rem 0;
    padding: 0.36rem 0;
    min-height: 56px;
    position: sticky;
    top: 0;
    z-index: 1030;
    border-radius: 0;
    background: rgba(246, 247, 251, 0.38);
    border: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.14);
    box-shadow: none;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(6px);
}

.topbar-left {
    min-width: 0;
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: var(--ink-900);
    max-width: min(42vw, 260px);
    transition: opacity 0.16s ease;
}

.topbar-brand:hover {
    opacity: 0.9;
}

.topbar-brand:focus-visible {
    outline: 2px solid rgba(131, 162, 219, 0.6);
    outline-offset: 2px;
    border-radius: 10px;
}

.topbar-brand-logo {
    display: block;
    height: 30px;
    max-height: 30px;
    max-width: 180px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
}

.topbar-brand-text {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-title,
.topbar-context-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(43, 51, 69, 0.86);
    margin-left: 0.2rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.topbar-mobile-toggle {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.topbar-nav {
    display: flex;
    justify-content: center;
    min-width: 0;
}

.pt-subnav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: transparent;
}

.pt-subnav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(43, 51, 69, 0.74);
    text-decoration: none;
    border-radius: 8px;
    border: 0;
    border-bottom: 2px solid transparent;
    line-height: 1;
    transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.pt-subnav-link:hover:not(.active):not(.is-disabled) {
    color: var(--ink-900);
    background: rgba(15, 23, 42, 0.03);
    border-bottom-color: rgba(27, 31, 42, 0.28);
}

.pt-subnav-link.active {
    color: var(--ink-900);
    border-bottom-color: var(--ink-900);
    font-weight: 700;
    background: transparent;
    box-shadow: none;
}

.pt-subnav-link.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: none;
}

.pt-subnav-link:focus-visible {
    outline: 2px solid rgba(131, 162, 219, 0.55);
    outline-offset: 2px;
}

.pt-subnav-avatar .pt-avatar-circle {
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.9);
    color: #475569;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.32);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.topbar-search {
    position: relative;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 999px;
    padding: 0 0.82rem;
    height: 38px;
    display: flex;
    align-items: center;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    width: 210px;
}

.topbar-search:focus-within {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.28);
    box-shadow: 0 0 0 2px rgba(131, 162, 219, 0.14);
}

.topbar-search i {
    color: #94a3b8;
    margin-right: 0.5rem;
}

.topbar-search input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.83rem;
    color: var(--ink-900);
    width: 100%;
    padding: 0;
}

.topbar-search input::placeholder {
    color: rgba(100, 116, 139, 0.8);
}

.topbar-actions .btn-light {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50%;
    padding: 0;
    display: grid;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #5f6c82;
    box-shadow: none;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.topbar-actions .btn-light:hover {
    background: #fff;
    color: #334155;
    border-color: rgba(148, 163, 184, 0.46);
}

.topbar-actions .btn-light:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(131, 162, 219, 0.2);
}

.pt-avatar-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    min-height: 38px;
    padding: 0 !important;
    border-radius: 50% !important;
    overflow: hidden;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: none;
}

.pt-avatar-btn.dropdown-toggle::after {
    display: none;
}

.pt-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pt-avatar-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #334155;
    background: linear-gradient(145deg, rgba(241, 245, 249, 0.98), rgba(226, 232, 240, 0.92));
}

.topbar-actions .btn-dark {
    border-radius: 999px;
    min-height: 38px;
    padding: 0.42rem 1rem;
    display: inline-flex;
    align-items: center;
    font-size: 0.84rem;
    background: var(--ink-900);
    border: 1px solid rgba(15, 23, 42, 0.35);
    box-shadow: none;
    transition: background-color 0.16s ease, border-color 0.16s ease;
}

.topbar-actions .btn-dark:hover {
    background: #0f172a;
    border-color: #0f172a;
    box-shadow: none;
}

.topbar-actions .btn-dark:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(131, 162, 219, 0.22);
}

.topbar-mobile-subnav {
    grid-column: 1 / -1;
    margin-top: 0.4rem;
    padding: 0 0.1rem 0.2rem;
    overflow-x: auto;
}

.topbar-mobile-subnav .pt-subnav {
    justify-content: flex-start;
    gap: 0.5rem;
}

.topbar-mobile-subnav .pt-subnav-link {
    white-space: nowrap;
}

.badge-notify {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(35%, -35%);
    border: 1.5px solid #fff;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.52rem;
    padding: 0;
    border-radius: 50%;
}

@media (max-width: 991px) {
    .topbar {
        margin: 0.25rem 1rem 0;
        padding: 0.3rem 0;
        min-height: 54px;
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .topbar-brand-logo {
        height: 28px;
        max-height: 28px;
        max-width: 150px;
    }

    .topbar-context-title {
        display: none;
    }

    .topbar-search {
        width: 170px;
    }

    .topbar-actions {
        gap: 0.4rem;
    }
}

@media (max-width: 768px) {
    .topbar {
        margin: 0.2rem 0.85rem 0;
        row-gap: 0.25rem;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .topbar-left {
        gap: 0.5rem !important;
    }

    .topbar-brand-logo {
        height: 24px;
        max-height: 24px;
        max-width: 124px;
    }

    .topbar-brand-text {
        font-size: 0.92rem;
    }

    .topbar-actions {
        gap: 0.35rem;
    }
}

@media (max-width: 576px) {
    .topbar-actions .btn-light {
        width: 36px !important;
        height: 36px !important;
    }

    .pt-avatar-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px;
        min-height: 36px;
    }

    .topbar-actions .btn-dark {
        min-height: 36px;
        padding: 0.38rem 0.82rem;
    }
}

.report-link-card {
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.cashflow-header {
    border: 1px solid #e2e8f0;
}

.cashflow-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #f8fafc;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.cashflow-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cashflow-filters {
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
}

.cashflow-card {
    border: 1px solid #e2e8f0;
}

.cashflow-chart-card {
    border: 1px solid #e2e8f0;
}

.cashflow-chart-wrap {
    width: 100%;
    height: 320px;
}

.cashflow-chart-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* === NUEVOS ESTILOS PREMIUM PARA CASHFLOW === */
.cashflow-chart-card-premium {
    border: 1px solid rgba(148, 163, 184, 0.2);
    position: relative;
    overflow: hidden;
}

.cashflow-chart-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(135deg, 
        rgba(127, 161, 220, 0.05) 0%, 
        rgba(240, 139, 137, 0.03) 50%,
        rgba(245, 196, 123, 0.04) 100%);
    pointer-events: none;
    z-index: 0;
}

.cashflow-chart-card-premium > * {
    position: relative;
    z-index: 1;
}

.cashflow-chart-wrap-premium {
    width: 100%;
    height: 400px;
    position: relative;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(10px);
}

.cashflow-chart-wrap-premium canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* Tooltip premium */
.chart-tooltip {
    position: absolute;
    background: rgba(27, 31, 42, 0.96);
    color: white;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 200px;
}

.tooltip-date {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    margin-bottom: 8px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.tooltip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    font-size: 13px;
}

.tooltip-row span:first-child:not(.tooltip-dot) {
    opacity: 0.8;
    flex: 1;
}

.tooltip-row strong {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.tooltip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.tooltip-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 8px -4px;
}

.tooltip-note {
    font-size: 11px;
    opacity: 0.75;
    letter-spacing: 0.02em;
}

.chart-tooltip .text-success {
    color: #4ade80 !important;
}

.chart-tooltip .text-danger {
    color: #f87171 !important;
}

.tooltip-year {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
    margin-bottom: 4px;
    font-weight: 600;
}

.tooltip-month {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #ffffff;
}

.tooltip-value {
    font-size: 18px;
    font-weight: 700;
    color: #7fa1dc;
    letter-spacing: -0.02em;
}

/* Mejoras en la leyenda */
.report-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.report-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(27, 31, 42, 0.8);
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.report-legend-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

/* Animación de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cashflow-chart-card-premium {
    animation: fadeInUp 0.6s ease-out;
}


.cashflow-card .table-responsive {
    overflow-x: auto;
}

.cashflow-table {
    width: 100%;
    table-layout: fixed;
    font-size: 0.82rem;
}

.cashflow-table th,
.cashflow-table td {
    white-space: nowrap;
    padding: 0.35rem 0.5rem;
}

.cashflow-table th:first-child,
.cashflow-table td:first-child {
    width: 150px;
}

.cashflow-table th:not(:first-child),
.cashflow-table td:not(:first-child) {
    width: 70px;
}

.cashflow-table thead th {
    background: #f1f5f9;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cashflow-table tbody tr:not(.cashflow-section):not(.cashflow-total):not(.cashflow-available):nth-child(even) {
    background: #f8fafc;
}

.cashflow-section th {
    background: #e2e8f0;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #475569;
}

.cashflow-total td {
    background: #f8fafc;
}

.cashflow-available td {
    background: #eef2ff;
}

.cashflow-negative {
    color: #ef4444;
}

.cashflow-positive {
    color: #15803d;
}

/* ============================================
   RESPONSIVE - MOBILE TABLES
   ============================================ */

@media (max-width: 767px) {
    .table-responsive-stack table,
    .table-responsive-stack thead,
    .table-responsive-stack tbody,
    .table-responsive-stack tr,
    .table-responsive-stack td,
    .table-responsive-stack th {
        display: block;
    }

    .table-responsive-stack thead {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-responsive-stack tr {
        margin-bottom: 1rem;
        border: 1px solid rgba(148, 163, 184, 0.3);
        border-radius: 16px;
        padding: 1.25rem;
        background: var(--glass);
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    }

    .table-responsive-stack td {
        padding: 0.75rem 0;
        text-align: right !important;
        position: relative;
        padding-left: 50%;
        border: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    }

    .table-responsive-stack td:last-child {
        border-bottom: none;
    }

    .table-responsive-stack td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        font-weight: 600;
        text-align: left;
        color: rgba(27, 31, 42, 0.8);
        font-size: 0.85rem;
    }

    .table-controls .row {
        flex-direction: column;
    }

    .table-controls .col-md-6 {
        width: 100%;
        text-align: left !important;
        margin-bottom: 0.5rem;
    }
}

@media print {
    @page {
        size: landscape;
        margin: 12mm;
    }

    body {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .pt-subnav,
    .mobile-subnav,
    .mobile-sidebar,
    .topbar-actions,
    .cashflow-filters,
    .btn {
        display: none !important;
    }

    .cashflow-chart-card {
        display: none !important;
    }

    .cashflow-chart-card-premium {
        display: none !important;
    }

    .app-layout,
    .app-shell {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    .surface-card {
        box-shadow: none !important;
        border: none !important;
    }

    .cashflow-table {
        font-size: 10px;
        line-height: 1.2;
    }

    .cashflow-table thead th {
        background: #e2e8f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .cashflow-table thead {
        display: table-header-group;
    }

    .cashflow-section th,
    .cashflow-total td,
    .cashflow-available td {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .cashflow-card {
        overflow: visible !important;
    }
}

/* Operación: Planning (Planner/Tasks/Calendar) */
.task-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #1f2937;
    box-shadow: var(--shadow);
}

.task-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 16px;
    padding: 0.85rem 0.9rem;
    box-shadow: var(--shadow);
    cursor: grab;
}

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

.dropzone {
    min-height: 120px;
    border-radius: 18px;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    background: rgba(248, 250, 252, 0.6);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone.is-hover {
    border-color: rgba(59, 130, 246, 0.6);
    background: rgba(219, 234, 254, 0.6);
}

.planner-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.capacity-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.9);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.capacity-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.85), rgba(14, 165, 233, 0.85));
    box-shadow: var(--shadow);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.75rem;
}

.calendar-day-cell {
    min-height: 120px;
    border-radius: 16px;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: var(--shadow);
}

.calendar-weekday {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(71, 85, 105, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.calendar-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.6rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.calendar-day-cell.is-today {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.15);
}

.calendar-day-cell.is-other-month {
    opacity: 0.55;
    background: rgba(241, 245, 249, 0.7);
}

.calendar-day-cell.is-hover {
    border-color: rgba(14, 165, 233, 0.5);
    box-shadow: 0 12px 28px rgba(56, 189, 248, 0.18);
    background: rgba(226, 232, 240, 0.85);
}

.calendar-more-btn {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(71, 85, 105, 0.85);
    text-decoration: none;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.calendar-more-btn:hover {
    color: rgba(30, 64, 175, 0.9);
    background: rgba(219, 234, 254, 0.8);
}

.badge-personal {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 999px;
    color: #334155;
    background: rgba(226, 232, 240, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.6);
}

.task-card--personal {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(248, 250, 252, 0.7);
}

.action-danger {
    color: #b91c1c;
}

.action-danger:hover,
.action-danger:focus {
    color: #991b1b;
    background: rgba(254, 226, 226, 0.7);
}

/* ============================================
   BIRTHDAY CELEBRATION
   ============================================ */

.birthday-banner {
    margin: 0.85rem 2rem 0;
    padding: 0.8rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.92), rgba(226, 232, 240, 0.82));
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.12);
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.birthday-banner.is-visible {
    display: flex;
}

.birthday-banner-copy {
    color: var(--ink-900);
    font-size: 0.95rem;
}

.birthday-banner-close {
    flex-shrink: 0;
}

.bday-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10050;
    background: rgba(10, 10, 14, 0.35);
    backdrop-filter: blur(6px);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.28s ease;
}

.bday-overlay.is-closing {
    opacity: 0;
}

.bday-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 18px 18px;
    max-width: 420px;
    width: calc(100% - 24px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    text-align: center;
    color: #fff;
    pointer-events: auto;
    animation: bdayPop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both, bdayGlow 2.8s ease-in-out infinite;
}

.bday-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.bday-name {
    margin-top: 0.15rem;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.05;
    text-shadow: 0 8px 24px rgba(255, 255, 255, 0.28);
}

.bday-sub {
    margin-top: 0.45rem;
    font-size: 0.92rem;
    opacity: 0.92;
}

.bday-close {
    margin-top: 0.9rem;
    min-width: 100px;
}

.birthday-confetti-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 10060;
}

.confetti-piece {
    position: fixed;
    top: -10px;
    width: 8px;
    height: 12px;
    opacity: 0.9;
    border-radius: 2px;
    animation: fall 4s linear forwards;
    z-index: 10061;
    will-change: transform, opacity;
}

@keyframes fall {
    to {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes bdayPop {
    0% {
        transform: scale(0.86);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bdayGlow {
    0%,
    100% {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 0 0 rgba(255, 255, 255, 0.16);
    }
    50% {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 0 26px rgba(255, 255, 255, 0.22);
    }
}

@media (max-width: 991.98px) {
    .birthday-banner {
        margin: 0.75rem 1rem 0;
        padding: 0.75rem 0.9rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .bday-card {
        max-width: 360px;
    }

    .bday-title {
        font-size: 20px;
    }

    .bday-name {
        font-size: 24px;
    }
}

@media print {
    .no-print,
    .birthday-confetti-layer,
    .bday-overlay {
        display: none !important;
    }
}


/* ============================================================
   SIDEBAR STRATUS (NEW MARKUP: aside.sbar + .sbar-pill)
   - Se añade al final para asegurar prioridad.
   ============================================================ */
.app-layout > aside.sbar{
  position: fixed !important;
  left: 18px !important;
  top: 0 !important;
  height: 100vh !important;
  width: auto !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  z-index: 1040 !important;
  pointer-events: none !important;
}

.app-layout > aside.sbar .sbar-pill{
  pointer-events: auto;
  width: 72px;
  border-radius: 999px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--sidebar-bg);
  border: 1px solid var(--sidebar-border);
  box-shadow: var(--sidebar-shadow);
  backdrop-filter: blur(16px);
}

.app-layout > aside.sbar .sbar-nav{
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.app-layout > aside.sbar .sbar-item{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--sidebar-link);
  transition: background-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.app-layout > aside.sbar .sbar-item:hover{
  background: var(--surface-3);
  color: var(--text-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.app-layout > aside.sbar .sbar-item.is-active,
.app-layout > aside.sbar .sbar-item.active{
  background: var(--sidebar-icon-active-bg);
  color: var(--sidebar-icon-active-color);
  box-shadow: var(--shadow-soft);
}

.app-layout > aside.sbar .sbar-bottom{
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  padding-top: 12px;
}

.app-layout > aside.sbar .sbar-theme-btn{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--theme-btn-border);
  background: var(--theme-btn-bg);
  display: grid;
  place-items: center;
  color: var(--theme-btn-color);
  transition: background-color var(--transition-theme), border-color var(--transition-theme), color var(--transition-theme), transform var(--transition-theme), box-shadow var(--transition-theme);
}

.app-layout > aside.sbar .sbar-theme-btn svg{
  width: 20px;
  height: 20px;
  display: block;
}

.app-layout > aside.sbar .sbar-theme-btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.app-layout > aside.sbar .sbar-theme-btn.is-active{
  background: var(--theme-btn-active-bg);
  border-color: var(--theme-btn-active-border);
  color: var(--theme-btn-active-color);
  box-shadow: var(--shadow-soft);
}

/* Offset del contenido (solo lo necesario) */
.content{ margin-left: 110px; }

@media (max-width: 992px){
  .content{ margin-left: 0; }
  .app-layout > aside.sbar{ display:none !important; }
}

/* === STRATUS SIDEBAR OVERRIDE (FINAL) === */
/* Topbar: one clean row on desktop (logo left, nav center, actions right) */
.topbar {
  margin: 0 !important;
  padding: 10px 0 !important;
  min-height: 0 !important;
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.topbar .topbar-inner {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  flex-wrap: nowrap !important;
}

.topbar .topbar-left {
  flex: 0 0 auto;
  min-width: 0;
}

.topbar .topbar-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.topbar .topbar-actions {
  flex: 0 0 auto;
  display: flex !important;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap !important;
}

.topbar .topbar-brand {
  max-width: min(42vw, 280px);
}

.topbar .topbar-brand-logo {
  max-width: 220px;
  max-height: 44px;
  height: 44px;
  width: auto;
  object-fit: contain;
}

.topbar .topbar-search {
  width: 260px;
  height: 44px;
}

.topbar .topbar-actions .btn-light,
.topbar .topbar-actions .notif-trigger,
.topbar .pt-avatar-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px;
  min-height: 44px;
}

.topbar .topbar-actions .btn-dark {
  min-height: 44px !important;
}

@media (max-width: 1200px) {
  .topbar .topbar-search {
    width: 200px;
  }
}

@media (max-width: 992px) {
  .topbar .topbar-search {
    width: 160px;
  }
}

/* Sidebar: keep only the pill visible, remove big bar behavior */
.app-layout > aside.sbar {
  position: fixed !important;
  left: 18px !important;
  top: 0 !important;
  height: 100vh !important;
  width: auto !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  pointer-events: none !important;
  z-index: 1040 !important;
}

.app-layout > aside.sbar .sbar-pill {
  pointer-events: auto;
  width: 72px;
  border-radius: 999px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(16px);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-pill {
  background: rgba(17, 24, 39, 0.35);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.35);
}

.app-layout > aside.sbar .sbar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.app-layout > aside.sbar .sbar-item {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: rgba(30, 41, 59, 0.75);
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.app-layout > aside.sbar .sbar-ico {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 1.08rem;
  line-height: 1;
}

.app-layout > aside.sbar .sbar-item:hover {
  background: rgba(15, 23, 42, 0.05);
  color: rgba(30, 41, 59, 0.92);
}

.app-layout > aside.sbar .sbar-item.is-active,
.app-layout > aside.sbar .sbar-item.active {
  background: rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.98);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-item {
  color: rgba(226, 232, 240, 0.7);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-item:hover {
  background: rgba(226, 232, 240, 0.1);
  color: rgba(226, 232, 240, 0.92);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-item.is-active,
html[data-theme="dark"] .app-layout > aside.sbar .sbar-item.active {
  background: rgba(226, 232, 240, 0.14);
  color: rgba(255, 255, 255, 0.95);
}

.app-layout > aside.sbar .sbar-item .badge-notify {
  right: 2px;
  top: 2px;
  transform: translate(22%, -22%);
}

.app-layout > aside.sbar .sbar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  padding-top: 14px;
}

.app-layout > aside.sbar .sbar-theme-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  place-items: center;
  color: rgba(30, 41, 59, 0.8);
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.app-layout > aside.sbar .sbar-theme-btn:hover {
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}

.app-layout > aside.sbar .sbar-theme-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.app-layout > aside.sbar .sbar-theme-btn.is-active {
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  border-color: rgba(15, 23, 42, 0.92);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-theme-btn {
  background: rgba(17, 24, 39, 0.35);
  border-color: rgba(148, 163, 184, 0.18);
  color: rgba(226, 232, 240, 0.85);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-theme-btn:hover {
  background: rgba(17, 24, 39, 0.55);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-theme-btn.is-active {
  background: rgba(226, 232, 240, 0.92);
  color: rgba(15, 23, 42, 0.95);
  border-color: rgba(226, 232, 240, 0.92);
}

/* Content offset ONLY (no global centering / no max-width changes) */
.app-layout > .content {
  margin-left: 110px !important;
  padding-left: 0 !important;
}

@media (max-width: 992px) {
  .app-layout > .content {
    margin-left: 0 !important;
    padding-left: 0 !important;
  }

  .app-layout > aside.sbar {
    display: none !important;
  }
}

/* === STRATUS REFERENCE OVERRIDE (TOPBAR + SIDEBAR) === */
body {
  background: transparent !important;
}

body::before {
  background:
    radial-gradient(68% 88% at 0% 0%, rgba(147, 197, 253, 0.34), rgba(147, 197, 253, 0) 62%),
    radial-gradient(52% 84% at 100% 0%, rgba(251, 191, 143, 0.28), rgba(251, 191, 143, 0) 60%),
    linear-gradient(90deg, #e9f0ff 0%, #edf1f9 48%, #f6efe2 100%) !important;
  background-attachment: fixed !important;
}

html[data-theme="dark"] body::before {
  background:
    radial-gradient(70% 92% at 0% 0%, rgba(59, 130, 246, 0.23), rgba(59, 130, 246, 0) 62%),
    radial-gradient(60% 90% at 100% 0%, rgba(234, 179, 8, 0.14), rgba(234, 179, 8, 0) 62%),
    linear-gradient(90deg, #0b1220 0%, #0e1628 45%, #131927 100%) !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  margin: 0 !important;
  padding: 12px clamp(14px, 1.8vw, 26px) 10px !important;
  min-height: 0 !important;
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.topbar .topbar-inner {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center !important;
  column-gap: 18px !important;
  row-gap: 8px !important;
  width: 100%;
  flex-wrap: nowrap !important;
}

.topbar .topbar-left {
  justify-self: start;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar .topbar-brand {
  max-width: min(42vw, 280px);
}

.topbar .topbar-brand-logo {
  display: block;
  max-width: 220px;
  max-height: 60px;
  height: 60px;
  width: auto;
  object-fit: contain;
}

.topbar .topbar-nav {
  justify-self: center;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.topbar .pt-subnav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  background: transparent !important;
}

.topbar .pt-subnav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  border-radius: 999px;
  border: 0 !important;
  border-bottom: 0 !important;
  background: transparent !important;
  color: rgba(31, 41, 55, 0.76);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.topbar .pt-subnav-link:hover:not(.active):not(.is-disabled) {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.06) !important;
  border-color: transparent !important;
}

.topbar .pt-subnav-link.active {
  background: #090c14 !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
  font-weight: 600;
}

.topbar .topbar-actions {
  justify-self: end;
  flex: 0 0 auto;
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: nowrap !important;
}

.topbar .topbar-search {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 999px;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.08);
  transition: width 0.18s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.topbar .topbar-search i {
  margin: 0;
  color: rgba(71, 85, 105, 0.8);
}

.topbar .topbar-search input {
  width: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.topbar .topbar-search:focus-within {
  width: 260px;
  justify-content: flex-start;
  padding: 0 14px;
  border-color: rgba(30, 41, 59, 0.28);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 3px rgba(131, 162, 219, 0.16);
}

.topbar .topbar-search:focus-within i {
  margin-right: 8px;
}

.topbar .topbar-search:focus-within input {
  width: 100%;
  opacity: 1;
  pointer-events: auto;
}

.topbar .topbar-actions .btn-light,
.topbar .topbar-actions .notif-trigger,
.topbar .pt-avatar-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(148, 163, 184, 0.3) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  color: rgba(51, 65, 85, 0.85);
  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.08);
  padding: 0 !important;
}

.topbar .topbar-actions .btn-light:hover,
.topbar .topbar-actions .notif-trigger:hover,
.topbar .pt-avatar-btn:hover {
  background: #fff !important;
  border-color: rgba(148, 163, 184, 0.42) !important;
  color: #0f172a;
  transform: translateY(-1px);
}

.topbar .topbar-actions .btn-dark {
  min-height: 44px !important;
  padding: 0 1rem !important;
  border-radius: 999px !important;
  border: 1px solid #090c14 !important;
  background: #090c14 !important;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.22);
}

.topbar .topbar-actions .btn-dark:hover {
  background: #0f172a !important;
  border-color: #0f172a !important;
}

.topbar .topbar-actions .btn:focus-visible,
.topbar .pt-avatar-btn:focus-visible,
.topbar .topbar-search:focus-within {
  outline: none;
}

html[data-theme="dark"] .topbar .pt-subnav-link {
  color: rgba(226, 232, 240, 0.74);
}

html[data-theme="dark"] .topbar .pt-subnav-link:hover:not(.active):not(.is-disabled) {
  color: rgba(241, 245, 249, 0.96);
  background: rgba(148, 163, 184, 0.16) !important;
}

html[data-theme="dark"] .topbar .pt-subnav-link.active {
  background: rgba(241, 245, 249, 0.95) !important;
  color: rgba(15, 23, 42, 0.95) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .topbar .topbar-search {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.46);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .topbar .topbar-search i {
  color: rgba(203, 213, 225, 0.85);
}

html[data-theme="dark"] .topbar .topbar-search input {
  color: rgba(226, 232, 240, 0.95);
}

html[data-theme="dark"] .topbar .topbar-search:focus-within {
  border-color: rgba(148, 163, 184, 0.42);
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

html[data-theme="dark"] .topbar .topbar-actions .btn-light,
html[data-theme="dark"] .topbar .topbar-actions .notif-trigger,
html[data-theme="dark"] .topbar .pt-avatar-btn {
  border-color: rgba(148, 163, 184, 0.22) !important;
  background: rgba(15, 23, 42, 0.54) !important;
  color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .topbar .topbar-actions .btn-light:hover,
html[data-theme="dark"] .topbar .topbar-actions .notif-trigger:hover,
html[data-theme="dark"] .topbar .pt-avatar-btn:hover {
  border-color: rgba(148, 163, 184, 0.36) !important;
  background: rgba(15, 23, 42, 0.76) !important;
  color: #fff;
}

html[data-theme="dark"] .topbar .topbar-actions .btn-dark {
  border-color: rgba(241, 245, 249, 0.92) !important;
  background: rgba(241, 245, 249, 0.92) !important;
  color: rgba(15, 23, 42, 0.95);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.app-layout > aside.sbar {
  position: fixed !important;
  left: 18px !important;
  top: 0 !important;
  height: 100vh !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  pointer-events: none !important;
  z-index: 1040 !important;
}

.app-layout > aside.sbar .sbar-pill {
  pointer-events: auto;
  width: 74px;
  min-height: min(84vh, 760px);
  border-radius: 999px;
  padding: 15px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.11);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.app-layout > aside.sbar .sbar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.app-layout > aside.sbar .sbar-item {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
  color: rgba(30, 41, 59, 0.78);
  text-decoration: none;
  display: grid;
  place-items: center;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.app-layout > aside.sbar .sbar-ico {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 1.02rem;
  line-height: 1;
}

.app-layout > aside.sbar .sbar-item:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(100, 116, 139, 0.32);
  color: #0f172a;
  transform: translateY(-1px);
}

.app-layout > aside.sbar .sbar-item.is-active,
.app-layout > aside.sbar .sbar-item.active {
  background: #090c14;
  border-color: #090c14;
  color: #fff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
}

.app-layout > aside.sbar .sbar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 18px;
}

.app-layout > aside.sbar .sbar-theme-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.7);
  color: rgba(30, 41, 59, 0.82);
  display: grid;
  place-items: center;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.app-layout > aside.sbar .sbar-theme-btn svg {
  width: 20px;
  height: 20px;
}

.app-layout > aside.sbar .sbar-theme-btn:hover {
  background: #fff;
  border-color: rgba(100, 116, 139, 0.32);
  transform: translateY(-1px);
}

.app-layout > aside.sbar .sbar-theme-btn.is-active {
  background: #090c14;
  border-color: #090c14;
  color: #fff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
}

.app-layout > aside.sbar .sbar-item:focus-visible,
.app-layout > aside.sbar .sbar-theme-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(131, 162, 219, 0.24);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-pill {
  background: rgba(15, 23, 42, 0.44);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-item {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.5);
  color: rgba(226, 232, 240, 0.82);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-item:hover {
  background: rgba(30, 41, 59, 0.84);
  border-color: rgba(148, 163, 184, 0.32);
  color: rgba(248, 250, 252, 0.98);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-item.is-active,
html[data-theme="dark"] .app-layout > aside.sbar .sbar-item.active {
  background: rgba(241, 245, 249, 0.95);
  border-color: rgba(241, 245, 249, 0.95);
  color: rgba(15, 23, 42, 0.96);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-theme-btn {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.52);
  color: rgba(226, 232, 240, 0.9);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-theme-btn:hover {
  background: rgba(30, 41, 59, 0.84);
  border-color: rgba(148, 163, 184, 0.32);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-theme-btn.is-active {
  background: rgba(241, 245, 249, 0.94);
  border-color: rgba(241, 245, 249, 0.94);
  color: rgba(15, 23, 42, 0.96);
}

.app-layout > .content {
  margin-left: 114px !important;
  padding-left: 0 !important;
}

@media (max-width: 1200px) {
  .topbar .topbar-search:focus-within {
    width: 220px;
  }
}

@media (max-width: 1100px) {
  .topbar .topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topbar .topbar-nav {
    display: none !important;
  }
}

@media (max-width: 992px) {
  .topbar {
    padding: 10px 14px 8px !important;
  }

  .topbar .topbar-search {
    display: none !important;
  }

  .topbar .topbar-actions {
    gap: 8px;
  }

  .app-layout > .content {
    margin-left: 0 !important;
  }

  .app-layout > aside.sbar {
    display: none !important;
  }
}

/* === SIDEBAR FLOATING BUBBLES (NO FULL BAR BG) === */
.app-layout > aside.sbar .sbar-pill {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  width: 72px;
  padding: 10px 6px 12px;
  min-height: min(84vh, 760px);
  gap: 12px;
}

.app-layout > aside.sbar .sbar-nav {
  gap: 12px;
}

.app-layout > aside.sbar .sbar-item,
.app-layout > aside.sbar .sbar-theme-btn {
  background: rgba(248, 250, 252, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.app-layout > aside.sbar .sbar-item:hover,
.app-layout > aside.sbar .sbar-theme-btn:hover {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(100, 116, 139, 0.32);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.11);
}

.app-layout > aside.sbar .sbar-item.is-active,
.app-layout > aside.sbar .sbar-item.active,
.app-layout > aside.sbar .sbar-theme-btn.is-active {
  background: #090c14;
  border-color: #090c14;
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.24);
}

.app-layout > aside.sbar .sbar-bottom {
  gap: 12px;
  padding-top: 16px;
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-pill {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-item,
html[data-theme="dark"] .app-layout > aside.sbar .sbar-theme-btn {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(148, 163, 184, 0.24);
  color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-item:hover,
html[data-theme="dark"] .app-layout > aside.sbar .sbar-theme-btn:hover {
  background: rgba(51, 65, 85, 0.88);
  border-color: rgba(148, 163, 184, 0.34);
  color: #f8fafc;
}

html[data-theme="dark"] .app-layout > aside.sbar .sbar-item.is-active,
html[data-theme="dark"] .app-layout > aside.sbar .sbar-item.active,
html[data-theme="dark"] .app-layout > aside.sbar .sbar-theme-btn.is-active {
  background: rgba(241, 245, 249, 0.95);
  border-color: rgba(241, 245, 249, 0.95);
  color: rgba(15, 23, 42, 0.96);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.33);
}

/* === FACEBOOK-LIKE NOTIFICATIONS (TOPBAR DROPDOWN) === */
.topbar .notif-dd .notif-trigger {
  position: relative;
}

.topbar .notif-dd .notif-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  transform: translate(45%, -45%);
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e11d48;
  color: #fff;
  border: 2px solid #fff;
  font-size: 0.67rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.topbar .notif-dd .notif-popover {
  width: min(92vw, 388px);
  min-width: 360px;
  max-height: min(80vh, 620px);
  margin-top: 10px !important;
  border-radius: 16px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.topbar .notif-dd .notif-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 12px 8px;
  background: #fff;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.topbar .notif-dd .notif-title {
  font-size: 1.85rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: #111827;
}

.topbar .notif-dd .notif-more {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(203, 213, 225, 0.85) !important;
  background: #f1f5f9 !important;
  color: #475569;
  box-shadow: none !important;
}

.topbar .notif-dd .notif-more:hover {
  background: #e2e8f0 !important;
  color: #334155;
}

.topbar .notif-dd .notif-tabs {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar .notif-dd .notif-tab {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1;
  color: #1f2937;
  background: #e5e7eb;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.topbar .notif-dd .notif-tab:hover {
  background: #dbe1e8;
}

.topbar .notif-dd .notif-tab.is-active {
  background: #e7f3ff;
  color: #0866ff;
}

.topbar .notif-dd .notif-link {
  margin-left: auto;
  color: #0866ff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
  line-height: 1;
}

.topbar .notif-dd .notif-link:hover {
  background: #f3f4f6;
  text-decoration: none;
}

.topbar .notif-dd .notif-list {
  max-height: 460px;
  overflow: auto;
  padding: 6px;
}

.topbar .notif-dd .notif-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  border-radius: 12px;
  padding: 10px;
  text-decoration: none;
  color: #111827;
  transition: background-color 0.15s ease;
}

.topbar .notif-dd .notif-item:visited,
.topbar .notif-dd .notif-item:hover {
  color: #111827;
  text-decoration: none;
}

.topbar .notif-dd .notif-item:hover {
  background: #f3f4f6;
}

.topbar .notif-dd .notif-item.is-unread {
  background: #eaf3ff;
}

.topbar .notif-dd .notif-item.is-unread:hover {
  background: #deecff;
}

.topbar .notif-dd .notif-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.topbar .notif-dd .notif-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topbar .notif-dd .notif-initial {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 0.86rem;
  font-weight: 800;
  color: #334155;
}

.topbar .notif-dd .notif-type-badge {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  background: #475569;
  color: #fff;
}

.topbar .notif-dd .notif-type-badge svg {
  width: 11px;
  height: 11px;
  display: block;
}

.topbar .notif-dd .notif-type-badge.is-invoice { background: #2563eb; }
.topbar .notif-dd .notif-type-badge.is-bill { background: #0f766e; }
.topbar .notif-dd .notif-type-badge.is-task { background: #7c3aed; }
.topbar .notif-dd .notif-type-badge.is-card { background: #1d4ed8; }
.topbar .notif-dd .notif-type-badge.is-payment { background: #0f766e; }
.topbar .notif-dd .notif-type-badge.is-alert { background: #dc2626; }
.topbar .notif-dd .notif-type-badge.is-system { background: #475569; }

.topbar .notif-dd .notif-body {
  min-width: 0;
}

.topbar .notif-dd .notif-text {
  color: #111827;
  font-size: 0.93rem;
  line-height: 1.34;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topbar .notif-dd .notif-text strong {
  color: #0f172a;
  font-weight: 700;
}

.topbar .notif-dd .notif-meta {
  margin-top: 2px;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar .notif-dd .notif-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #0866ff;
}

.topbar .notif-dd .notif-empty {
  padding: 28px 16px;
  text-align: center;
  color: #64748b;
  font-size: 0.93rem;
  font-weight: 600;
}

html[data-theme="dark"] .topbar .notif-dd .notif-badge {
  border-color: rgba(15, 23, 42, 0.95);
}

html[data-theme="dark"] .topbar .notif-dd .notif-popover {
  border-color: rgba(71, 85, 105, 0.8);
  background: #0f172a;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .topbar .notif-dd .notif-head {
  background: #0f172a;
  border-bottom-color: rgba(71, 85, 105, 0.7);
}

html[data-theme="dark"] .topbar .notif-dd .notif-title {
  color: #f8fafc;
}

html[data-theme="dark"] .topbar .notif-dd .notif-more {
  background: #1e293b !important;
  border-color: rgba(100, 116, 139, 0.8) !important;
  color: #cbd5e1;
}

html[data-theme="dark"] .topbar .notif-dd .notif-more:hover {
  background: #334155 !important;
  color: #f1f5f9;
}

html[data-theme="dark"] .topbar .notif-dd .notif-tab {
  background: #1e293b;
  color: #dbe2eb;
}

html[data-theme="dark"] .topbar .notif-dd .notif-tab:hover {
  background: #334155;
}

html[data-theme="dark"] .topbar .notif-dd .notif-tab.is-active {
  background: rgba(8, 102, 255, 0.22);
  color: #8ec5ff;
}

html[data-theme="dark"] .topbar .notif-dd .notif-link {
  color: #8ec5ff;
}

html[data-theme="dark"] .topbar .notif-dd .notif-link:hover {
  background: rgba(51, 65, 85, 0.78);
}

html[data-theme="dark"] .topbar .notif-dd .notif-item {
  color: #e2e8f0;
}

html[data-theme="dark"] .topbar .notif-dd .notif-item:hover {
  background: #1e293b;
}

html[data-theme="dark"] .topbar .notif-dd .notif-item.is-unread {
  background: rgba(8, 102, 255, 0.16);
}

html[data-theme="dark"] .topbar .notif-dd .notif-item.is-unread:hover {
  background: rgba(8, 102, 255, 0.24);
}

html[data-theme="dark"] .topbar .notif-dd .notif-avatar {
  background: #334155;
}

html[data-theme="dark"] .topbar .notif-dd .notif-initial {
  color: #f1f5f9;
}

html[data-theme="dark"] .topbar .notif-dd .notif-type-badge {
  border-color: #0f172a;
}

html[data-theme="dark"] .topbar .notif-dd .notif-text,
html[data-theme="dark"] .topbar .notif-dd .notif-text strong {
  color: #f1f5f9;
}

html[data-theme="dark"] .topbar .notif-dd .notif-meta {
  color: #94a3b8;
}

html[data-theme="dark"] .topbar .notif-dd .notif-empty {
  color: #94a3b8;
}

@media (max-width: 576px) {
  .topbar .notif-dd .notif-popover {
    min-width: 0;
    width: min(96vw, 388px);
    max-height: 70vh;
  }

  .topbar .notif-dd .notif-title {
    font-size: 1.5rem;
  }
}

/* === DARK MODE NORMALIZATION (GLOBAL) === */
html[data-theme="dark"] {
  color-scheme: dark;
  --dm-text: #e2e8f0;
  --dm-text-strong: #f8fafc;
  --dm-muted: #94a3b8;
  --dm-border: rgba(148, 163, 184, 0.24);
  --dm-surface: rgba(15, 23, 42, 0.78);
  --dm-surface-2: rgba(30, 41, 59, 0.72);
  --dm-surface-3: rgba(51, 65, 85, 0.66);
  --dm-hover: rgba(148, 163, 184, 0.14);
  --dm-shadow: 0 20px 38px rgba(0, 0, 0, 0.34);
  --bs-body-color: var(--dm-text);
  --bs-body-bg: transparent;
  --bs-border-color: var(--dm-border);
  --bs-secondary-color: var(--dm-muted);
  --bs-tertiary-bg: var(--dm-surface-2);
}

html[data-theme="dark"] body {
  color: var(--dm-text);
}

html[data-theme="dark"] .content,
html[data-theme="dark"] .app-shell {
  color: var(--dm-text);
}

html[data-theme="dark"] .surface-card,
html[data-theme="dark"] .glass-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .card-soft,
html[data-theme="dark"] .quick-link,
html[data-theme="dark"] .actions-table-wrap,
html[data-theme="dark"] .report-chart-wrap,
html[data-theme="dark"] .report-client-item,
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .modal-content {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  box-shadow: var(--dm-shadow);
  color: var(--dm-text);
}

html[data-theme="dark"] .surface-card .card-header,
html[data-theme="dark"] .card-header-clean,
html[data-theme="dark"] .table-sticky thead th,
html[data-theme="dark"] .table > :not(caption) > * > * {
  border-color: var(--dm-border);
}

html[data-theme="dark"] .table,
html[data-theme="dark"] .table-clean,
html[data-theme="dark"] .table-clean tbody tr,
html[data-theme="dark"] .table-clean tbody td {
  color: var(--dm-text);
  border-color: var(--dm-border);
}

html[data-theme="dark"] .table-light,
html[data-theme="dark"] .table-light th,
html[data-theme="dark"] .table-light td,
html[data-theme="dark"] .table-clean thead th,
html[data-theme="dark"] .actions-table thead th {
  background: var(--dm-surface-2) !important;
  color: #cbd5e1 !important;
  border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .table-clean tbody tr:hover,
html[data-theme="dark"] .actions-table tbody tr:hover,
html[data-theme="dark"] .table tbody tr:focus-within {
  background: var(--dm-hover);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] .table-controls input[type="search"] {
  background: rgba(15, 23, 42, 0.74) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] .topbar .topbar-search input::placeholder {
  color: var(--dm-muted);
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] .table-controls input[type="search"]:focus {
  background: rgba(15, 23, 42, 0.9) !important;
  border-color: rgba(96, 165, 250, 0.62) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18) !important;
  color: var(--dm-text-strong) !important;
}

html[data-theme="dark"] .btn-light {
  background: var(--dm-surface-2);
  border-color: var(--dm-border);
  color: var(--dm-text);
}

html[data-theme="dark"] .btn-light:hover {
  background: var(--dm-surface-3);
  border-color: rgba(148, 163, 184, 0.34);
  color: var(--dm-text-strong);
}

html[data-theme="dark"] .btn-outline-dark {
  border-color: rgba(148, 163, 184, 0.52);
  color: #dbe4ef;
}

html[data-theme="dark"] .btn-outline-dark:hover {
  background: rgba(148, 163, 184, 0.22);
  border-color: rgba(148, 163, 184, 0.62);
  color: #f8fafc;
}

html[data-theme="dark"] .dropdown-menu {
  background: #0f172a;
  border: 1px solid var(--dm-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .dropdown-item {
  color: var(--dm-text);
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus {
  background: rgba(51, 65, 85, 0.76);
  color: var(--dm-text-strong);
}

html[data-theme="dark"] .dropdown-divider {
  border-color: var(--dm-border);
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-muted-light,
html[data-theme="dark"] .report-metric-meta,
html[data-theme="dark"] .report-kpi-caption,
html[data-theme="dark"] .report-legend-item,
html[data-theme="dark"] .table-no-results,
html[data-theme="dark"] .is-neutral {
  color: var(--dm-muted) !important;
}

html[data-theme="dark"] .text-dark,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
  color: var(--dm-text-strong) !important;
}

html[data-theme="dark"] .icon-pill,
html[data-theme="dark"] .card-icon-circle,
html[data-theme="dark"] .report-metric-icon,
html[data-theme="dark"] .report-client-avatar,
html[data-theme="dark"] .report-client-rank {
  background: var(--dm-surface-2);
  border-color: var(--dm-border);
  color: var(--dm-text);
}

html[data-theme="dark"] .chip,
html[data-theme="dark"] .stat-badge {
  background: rgba(51, 65, 85, 0.7);
  color: #dbe4ef;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

html[data-theme="dark"] .badge-blue {
  background: rgba(59, 130, 246, 0.28);
  color: #bfdbfe;
}

html[data-theme="dark"] .badge-rose {
  background: rgba(244, 63, 94, 0.24);
  color: #fecdd3;
}

html[data-theme="dark"] .badge-peach {
  background: rgba(249, 115, 22, 0.26);
  color: #fed7aa;
}

html[data-theme="dark"] .badge-status {
  border-color: rgba(148, 163, 184, 0.34);
}

html[data-theme="dark"] .badge-status--success {
  background: rgba(34, 197, 94, 0.24);
  color: #bbf7d0;
}

html[data-theme="dark"] .badge-status--warning {
  background: rgba(245, 158, 11, 0.24);
  color: #fde68a;
}

html[data-theme="dark"] .badge-status--danger {
  background: rgba(239, 68, 68, 0.24);
  color: #fecaca;
}

html[data-theme="dark"] .badge-status--secondary {
  background: rgba(71, 85, 105, 0.5);
  color: #cbd5e1;
}

html[data-theme="dark"] .report-chip {
  background: rgba(51, 65, 85, 0.66);
  border-color: rgba(148, 163, 184, 0.24);
  color: #dbe4ef;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .report-chip--blue {
  background: rgba(59, 130, 246, 0.22);
  color: #bfdbfe;
}

html[data-theme="dark"] .report-chip--rose {
  background: rgba(244, 63, 94, 0.2);
  color: #fecdd3;
}

html[data-theme="dark"] .report-chip--peach {
  background: rgba(249, 115, 22, 0.22);
  color: #fed7aa;
}

html[data-theme="dark"] .report-chip--ink {
  background: rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
}

html[data-theme="dark"] .alert {
  background: var(--dm-surface-2);
  border-color: var(--dm-border);
  color: var(--dm-text);
}

html[data-theme="dark"] .bg-danger-subtle {
  background: rgba(239, 68, 68, 0.22) !important;
  color: #fecaca !important;
}

html[data-theme="dark"] .bg-warning-subtle {
  background: rgba(245, 158, 11, 0.24) !important;
  color: #fde68a !important;
}

html[data-theme="dark"] .bg-info-subtle {
  background: rgba(56, 189, 248, 0.22) !important;
  color: #bae6fd !important;
}

html[data-theme="dark"] #invoiceModal .modal-content.surface-card {
  background: #0f172a !important;
  border-color: var(--dm-border) !important;
}

html[data-theme="dark"] #invoiceModal .form-control,
html[data-theme="dark"] #invoiceModal .form-select,
html[data-theme="dark"] #invoiceModal textarea.form-control {
  background: rgba(15, 23, 42, 0.9) !important;
  color: var(--dm-text) !important;
  border-color: var(--dm-border) !important;
}

html[data-theme="dark"] #commandPaletteModal .modal-content.command-palette {
  background: #0f172a;
  border: 1px solid var(--dm-border);
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .command-palette-icon {
  background: var(--dm-surface-2);
  color: var(--dm-text);
}

html[data-theme="dark"] .command-palette-input {
  background: rgba(15, 23, 42, 0.8);
  border-color: var(--dm-border);
  color: var(--dm-text);
}

html[data-theme="dark"] .command-palette-input:focus {
  border-color: rgba(96, 165, 250, 0.62);
  box-shadow: 0 0 0 0.15rem rgba(59, 130, 246, 0.18);
}

html[data-theme="dark"] .command-palette-item {
  background: rgba(15, 23, 42, 0.86);
  border-color: transparent;
  color: var(--dm-text);
}

html[data-theme="dark"] .command-palette-item:hover,
html[data-theme="dark"] .command-palette-item.is-selected {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .command-palette-meta {
  color: var(--dm-muted);
}

html[data-theme="dark"] .command-palette-section {
  background: rgba(51, 65, 85, 0.72);
  color: #dbe4ef;
}

html[data-theme="dark"] .command-palette-empty {
  background: rgba(15, 23, 42, 0.74);
  color: var(--dm-muted);
}

/* --- Chat MVP --- */
#chatApp {
  --chat-shell-height: 72vh;
}

.chat-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: var(--chat-shell-height);
  min-height: 520px;
}

.chat-sidebar {
  min-width: 0;
  background: rgba(248, 250, 252, 0.64);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-sidebar-head {
  flex-shrink: 0;
}

.chat-thread-list-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.chat-thread-list {
  display: flex;
  flex-direction: column;
}

.chat-thread-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: transparent;
  text-align: left;
  padding: 0.8rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.chat-thread-item:hover {
  background: rgba(59, 130, 246, 0.08);
}

.chat-thread-item.is-active {
  background: rgba(59, 130, 246, 0.16);
}

.chat-thread-main {
  min-width: 0;
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex: 1;
}

.chat-thread-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.32);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-thread-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-thread-body {
  min-width: 0;
  flex: 1;
}

.chat-thread-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.chat-thread-title {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-thread-time {
  white-space: nowrap;
  font-size: 0.7rem;
}

.chat-thread-preview {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-thread-unread {
  font-size: 0.72rem;
  min-width: 28px;
}

.chat-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(255, 255, 255, 0.72);
}

.chat-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.chat-messages-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 45%),
    radial-gradient(circle at left bottom, rgba(14, 165, 233, 0.08), transparent 45%);
}

.chat-messages-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.chat-message-row {
  display: flex;
}

.chat-message-row.is-own {
  justify-content: flex-end;
}

.chat-message-row.is-other {
  justify-content: flex-start;
}

.chat-message-bubble {
  max-width: min(680px, 82%);
  border-radius: 14px;
  padding: 0.52rem 0.72rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.chat-message-bubble.is-own {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.3);
}

.chat-message-bubble.is-other {
  background: rgba(255, 255, 255, 0.9);
}

.chat-message-bubble.is-pending {
  opacity: 0.72;
}

.chat-message-bubble.is-failed {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(254, 226, 226, 0.74);
}

.chat-message-author {
  font-size: 0.74rem;
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 0.18rem;
}

.chat-message-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
  font-size: 0.92rem;
}

.chat-message-meta {
  margin-top: 0.26rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.42rem;
  font-size: 0.68rem;
  color: #64748b;
}

.chat-message-status {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.chat-message-read-status {
  font-weight: 600;
}

.chat-message-read-status i {
  font-size: 0.72rem;
  line-height: 1;
}

.chat-message-read-status.is-read {
  color: #0284c7;
}

.chat-message-read-status.is-sent {
  color: #64748b;
}

.chat-composer {
  background: rgba(248, 250, 252, 0.88);
}

.chat-composer textarea {
  min-height: 42px;
  max-height: 104px;
  resize: none;
}

.chat-state {
  font-size: 0.9rem;
}

html[data-theme="dark"] .chat-sidebar {
  background: rgba(15, 23, 42, 0.42);
}

html[data-theme="dark"] .chat-thread-item {
  border-bottom-color: rgba(51, 65, 85, 0.58);
}

html[data-theme="dark"] .chat-thread-item:hover {
  background: rgba(51, 65, 85, 0.55);
}

html[data-theme="dark"] .chat-thread-item.is-active {
  background: rgba(59, 130, 246, 0.26);
}

html[data-theme="dark"] .chat-thread-preview,
html[data-theme="dark"] .chat-thread-time,
html[data-theme="dark"] .chat-message-meta {
  color: #94a3b8;
}

html[data-theme="dark"] .chat-message-read-status.is-read {
  color: #38bdf8;
}

html[data-theme="dark"] .chat-message-read-status.is-sent {
  color: #94a3b8;
}

html[data-theme="dark"] .chat-main {
  background: rgba(15, 23, 42, 0.5);
}

html[data-theme="dark"] .chat-messages-wrap {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.17), transparent 42%),
    radial-gradient(circle at left bottom, rgba(14, 165, 233, 0.14), transparent 44%);
}

html[data-theme="dark"] .chat-message-bubble.is-other {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(100, 116, 139, 0.44);
}

html[data-theme="dark"] .chat-message-bubble.is-own {
  background: rgba(30, 64, 175, 0.46);
  border-color: rgba(96, 165, 250, 0.58);
}

html[data-theme="dark"] .chat-message-author {
  color: #93c5fd;
}

html[data-theme="dark"] .chat-message-bubble.is-failed {
  border-color: rgba(248, 113, 113, 0.66);
  background: rgba(127, 29, 29, 0.44);
}

html[data-theme="dark"] .chat-composer {
  background: rgba(15, 23, 42, 0.66);
}

@media (max-width: 991.98px) {
  .chat-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 78vh;
  }

  .chat-sidebar {
    border-right: 0 !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  }

  .chat-thread-list-wrap {
    max-height: 250px;
  }

  .chat-message-bubble {
    max-width: 92%;
  }
}

/* CHAT UI */
.chat-composer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.chat-emoji-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.4rem);
  width: 250px;
  padding: 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.15);
  z-index: 30;
}

.chat-emoji-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}

.chat-emoji-btn {
  border: 0;
  border-radius: 8px;
  padding: 0.35rem;
  background: rgba(241, 245, 249, 0.86);
  font-size: 1.1rem;
  line-height: 1;
}

.chat-emoji-btn:hover {
  background: rgba(59, 130, 246, 0.18);
}

.chat-entity-card {
  display: grid;
  gap: 0.3rem;
}

.chat-entity-title {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.25;
}

.chat-entity-subtitle {
  font-size: 0.8rem;
  color: #64748b;
}

.chat-entity-meta {
  font-size: 0.74rem;
  color: #475569;
}

.chat-entity-actions {
  margin-top: 0.1rem;
}

.chat-entity-comment {
  margin-top: 0.1rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
  line-height: 1.38;
}

.chat-entity-results {
  max-height: 48vh;
  overflow-y: auto;
  display: grid;
  gap: 0.55rem;
}

.chat-entity-result-item {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.72);
  text-align: left;
  padding: 0.65rem 0.75rem;
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.chat-entity-result-item:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.35);
}

.chat-entity-result-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(148, 163, 184, 0.32);
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #0f172a;
  font-size: 0.74rem;
  font-weight: 700;
}

.chat-entity-result-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-entity-result-body {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.chat-entity-result-title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
}

.chat-entity-result-subtitle {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.25;
}

.chat-entity-result-status {
  width: fit-content;
  margin-top: 0.15rem;
  font-size: 0.68rem;
}

html[data-theme="dark"] .chat-emoji-popover {
  border-color: rgba(100, 116, 139, 0.5);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .chat-emoji-btn {
  background: rgba(30, 41, 59, 0.85);
}

html[data-theme="dark"] .chat-emoji-btn:hover {
  background: rgba(59, 130, 246, 0.34);
}

html[data-theme="dark"] .chat-entity-subtitle,
html[data-theme="dark"] .chat-entity-meta,
html[data-theme="dark"] .chat-entity-result-subtitle {
  color: #94a3b8;
}

html[data-theme="dark"] .chat-entity-result-item {
  border-color: rgba(100, 116, 139, 0.45);
  background: rgba(15, 23, 42, 0.65);
}

html[data-theme="dark"] .chat-entity-result-item:hover {
  background: rgba(51, 65, 85, 0.7);
  border-color: rgba(96, 165, 250, 0.6);
}

html[data-theme="dark"] .chat-entity-result-status {
  background: rgba(51, 65, 85, 0.84) !important;
  border-color: rgba(100, 116, 139, 0.5) !important;
  color: #dbe4ef !important;
}

/* --- Profile Premium --- */
.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(145deg, rgba(131, 162, 219, 0.28), rgba(253, 142, 140, 0.24));
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: rgba(27, 31, 42, 0.85);
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-premium-hero {
  position: relative;
  overflow: hidden;
}

.profile-premium-hero .report-chip {
  backdrop-filter: blur(8px);
}

.profile-premium-hero-avatar {
  width: 84px;
  height: 84px;
  font-size: 1.8rem;
}

.profile-premium-hero-copy {
  min-width: 0;
}

.profile-premium-hero-kpi {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.62);
}

.profile-premium-progress {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.24);
}

.profile-premium-progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.profile-premium-progress-bar--low {
  background: linear-gradient(90deg, #fd8e8c, #f97316);
}

.profile-premium-progress-bar--mid {
  background: linear-gradient(90deg, #f5c47b, #f59e0b);
}

.profile-premium-progress-bar--high {
  background: linear-gradient(90deg, #83a2db, #0ea5e9);
}

.profile-premium-alert {
  border-radius: 18px;
}

.profile-premium-panel {
  border-radius: 24px;
}

.profile-premium-panel--sticky {
  position: sticky;
  top: 84px;
}

.profile-premium-avatar-preview {
  width: 112px;
  height: 112px;
  font-size: 2.35rem;
}

.profile-premium-field-hint {
  margin-top: 0.35rem;
  color: rgba(27, 31, 42, 0.62);
  font-size: 0.78rem;
}

.profile-premium-file-name {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: rgba(27, 31, 42, 0.6);
}

.profile-premium-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.profile-premium-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.52rem 0.62rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.56);
  font-size: 0.82rem;
  color: rgba(27, 31, 42, 0.78);
}

.profile-premium-checklist i {
  color: #2f4f89;
  line-height: 1.2;
}

.profile-premium-section {
  border-radius: 24px;
}

.profile-premium-section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.profile-premium-section-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(131, 162, 219, 0.18);
  border: 1px solid rgba(131, 162, 219, 0.28);
  color: #2f4f89;
  flex-shrink: 0;
}

.profile-premium-bio-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.76);
  color: rgba(27, 31, 42, 0.7);
  font-size: 0.74rem;
  font-weight: 600;
}

.profile-premium-bio-counter.is-limit {
  color: #9f1239;
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(253, 142, 140, 0.2);
}

.profile-premium-collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.profile-premium-collapse-btn i {
  transition: transform 0.2s ease;
}

.profile-premium-collapse-btn[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.profile-premium-emergency-panel {
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.48);
  background: rgba(255, 255, 255, 0.55);
  padding: 1rem;
}

.profile-premium-savebar {
  position: sticky;
  bottom: 0.8rem;
  z-index: 16;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
}

@media (max-width: 1199.98px) {
  .profile-premium-panel--sticky {
    position: static;
  }
}

@media (max-width: 767.98px) {
  .profile-premium-hero-avatar {
    width: 70px;
    height: 70px;
    font-size: 1.5rem;
  }

  .profile-premium-avatar-preview {
    width: 96px;
    height: 96px;
    font-size: 2rem;
  }

  .profile-premium-savebar {
    bottom: 0.65rem;
  }
}

html[data-theme="dark"] .avatar-circle {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.38), rgba(244, 63, 94, 0.3));
  border-color: rgba(100, 116, 139, 0.55);
  color: #f8fafc;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .profile-premium-hero-kpi {
  background: rgba(15, 23, 42, 0.58);
  border-color: rgba(100, 116, 139, 0.48);
}

html[data-theme="dark"] .profile-premium-progress {
  background: rgba(51, 65, 85, 0.78);
}

html[data-theme="dark"] .profile-premium-field-hint,
html[data-theme="dark"] .profile-premium-file-name {
  color: #94a3b8;
}

html[data-theme="dark"] .profile-premium-checklist li {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(100, 116, 139, 0.45);
  color: #dbe4ef;
}

html[data-theme="dark"] .profile-premium-checklist i {
  color: #93c5fd;
}

html[data-theme="dark"] .profile-premium-section-icon {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(96, 165, 250, 0.34);
  color: #bfdbfe;
}

html[data-theme="dark"] .profile-premium-bio-counter {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(100, 116, 139, 0.5);
  color: #dbe4ef;
}

html[data-theme="dark"] .profile-premium-bio-counter.is-limit {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.32);
}

html[data-theme="dark"] .profile-premium-emergency-panel {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(100, 116, 139, 0.58);
}

html[data-theme="dark"] .profile-premium-savebar {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(100, 116, 139, 0.42);
}

.brief-public-hero {
  overflow: hidden;
}

.brief-public-copy {
  max-width: 62ch;
}

.brief-public-brand {
  min-width: min(100%, 280px);
}

.brief-public-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 18px;
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.brief-kicker {
  letter-spacing: 0.16em;
}

.brief-section-pill {
  align-self: flex-start;
  padding: 0.7rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: rgba(27, 31, 42, 0.72);
  max-width: 320px;
  font-size: 0.9rem;
}

.brief-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.brief-option-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.brief-option-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.05rem;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.brief-option-card:hover {
  transform: translateY(-1px);
  border-color: rgba(131, 162, 219, 0.48);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.07);
}

.brief-option-input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.brief-option-input:checked {
  background-color: #2f4f89;
  border-color: #2f4f89;
}

.brief-option-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.brief-submit-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(246, 248, 255, 0.78));
}

.brief-share-field {
  min-width: 260px;
  max-width: 420px;
}

.brief-record-card {
  overflow: visible;
}

.brief-detail {
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  padding-top: 1rem;
}

.brief-detail summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-900);
}

.brief-detail summary::-webkit-details-marker {
  display: none;
}

.brief-detail summary::after {
  content: "▾";
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.brief-detail[open] summary::after {
  transform: rotate(180deg);
}

.brief-detail-body {
  padding-top: 1rem;
}

.brief-answer-block {
  height: 100%;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.brief-answer-label {
  margin-bottom: 0.45rem;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(27, 31, 42, 0.6);
  font-weight: 600;
}

.brief-answer-value {
  white-space: pre-line;
  color: var(--ink-900);
}

@media (max-width: 767.98px) {
  .brief-option-grid--two {
    grid-template-columns: 1fr;
  }

  .brief-share-field {
    min-width: 100%;
    max-width: 100%;
  }
}

html[data-theme="dark"] .brief-public-logo {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(100, 116, 139, 0.48);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .brief-section-pill,
html[data-theme="dark"] .brief-option-card,
html[data-theme="dark"] .brief-submit-card,
html[data-theme="dark"] .brief-answer-block {
  background: rgba(15, 23, 42, 0.58);
  border-color: rgba(100, 116, 139, 0.45);
  color: #dbe4ef;
}

html[data-theme="dark"] .brief-option-card:hover {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .brief-share-field {
  background: rgba(15, 23, 42, 0.58) !important;
  border-color: rgba(100, 116, 139, 0.45) !important;
}

html[data-theme="dark"] .brief-share-field input {
  background: transparent;
  color: #f8fafc;
}

html[data-theme="dark"] .brief-detail {
  border-top-color: rgba(100, 116, 139, 0.38);
}

html[data-theme="dark"] .brief-detail summary,
html[data-theme="dark"] .brief-answer-value {
  color: #f8fafc;
}

html[data-theme="dark"] .brief-answer-label,
html[data-theme="dark"] .brief-kicker {
  color: #94a3b8;
}
