/* ═══════════════════════════════════════════════════════════════
   ASETRIX — app.css
   Premium Real-Estate CRM — polished layout, micro-interactions
   Brand: #1a3d5c (navy) · #1a6b5a (teal/accent) · #2abfaa (turquoise)
   ═══════════════════════════════════════════════════════════════ */
@import url('css/theme.css');

/* Render native controls (date picker icon, select popup, number spinners,
   scrollbars) to match the active theme — fixes black-on-black date icons. */
html { color-scheme: dark; }
html[data-theme="light"], [data-theme="light"] { color-scheme: light; }


/* ─── KEYFRAMES ─────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes subtlePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .7; transform: scale(1.05); }
}
@keyframes dash-fade-up {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes skeleton-pulse {
    0%, 100% { opacity: .35; }
    50%      { opacity: .85; }
}
@keyframes badgeGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .4); }
    50%      { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}
@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-2px); }
}
@keyframes shimmer {
    from { background-position: -200% 0; }
    to   { background-position: 200% 0; }
}


/* ─── APP SHELL ──────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}


/* ═════════════════════════════════════════════
   SIDEBAR — white, auto-expand on hover, pin support
   ═════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-collapsed);
    background: var(--surface);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: width .25s cubic-bezier(.4, 0, .2, 1);
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid var(--border);
}
.sidebar:hover,
.sidebar-pinned .sidebar {
    width: var(--sidebar-w);
    box-shadow: var(--shadow-lg);
}
.sidebar-pinned .sidebar { box-shadow: none; }

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 0 0 0 calc((var(--sidebar-collapsed) - 32px) / 2);
    min-height: var(--topbar-h);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: -.01em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    transition: padding .25s cubic-bezier(.4, 0, .2, 1);
    flex-shrink: 0;
}
.sidebar:hover .sidebar-brand,
.sidebar-pinned .sidebar-brand { padding: 0 .75rem 0 1.1rem; }
.sidebar-brand .brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: var(--radius-xs);
    transition: transform 250ms var(--ease);
}
.sidebar-brand:hover .brand-logo {
    transform: rotate(-4deg) scale(1.05);
}
.sidebar-brand .brand-text {
    overflow: hidden;
    opacity: 0;
    width: 0;
    flex: 1;
    transition: opacity .25s cubic-bezier(.4, 0, .2, 1), width .25s cubic-bezier(.4, 0, .2, 1);
}
.sidebar:hover .sidebar-brand .brand-text,
.sidebar-pinned .sidebar-brand .brand-text {
    opacity: 1;
    width: auto;
}

/* Pin button */
.sidebar-pin {
    width: 28px; height: 28px; border-radius: var(--radius-sm);
    background: transparent; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text3); transition: all .25s cubic-bezier(.4, 0, .2, 1);
    opacity: 0; flex-shrink: 0; margin-left: auto;
}
.sidebar:hover .sidebar-pin,
.sidebar-pinned .sidebar-pin { opacity: 1; }
.sidebar-pin:hover { color: var(--accent); background: var(--surface2); }
.sidebar-pin [data-lucide] { width: 14px; height: 14px; transition: transform .25s cubic-bezier(.4, 0, .2, 1); }
.sidebar-pinned .sidebar-pin {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.sidebar-pinned .sidebar-pin [data-lucide] {
    transform: rotate(45deg);
}
.sidebar-pinned .sidebar-pin:hover { color: var(--text); }

/* Sidebar search — hidden when collapsed, shown when expanded */
.sidebar-search { display: none; }
.sidebar:hover .sidebar-search,
.sidebar-pinned .sidebar-search { display: block; }

/* Nav area */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .4rem .6rem;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
.sidebar-section {
    margin-bottom: .2rem;
}
.sidebar-section-title {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text3);
    padding: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity .25s cubic-bezier(.4, 0, .2, 1),
                height .25s cubic-bezier(.4, 0, .2, 1),
                padding .25s cubic-bezier(.4, 0, .2, 1);
    user-select: none;
}
.sidebar:hover .sidebar-section-title,
.sidebar-pinned .sidebar-section-title {
    opacity: 1;
    height: auto;
    padding: .85rem .7rem .3rem;
}

/* ── Nav items ── */
.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: .52rem 0;
    margin-bottom: 2px;
    border-radius: 8px;
    color: var(--text2);
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    white-space: nowrap;
    text-decoration: none;
    position: relative;
}
.sidebar:hover .nav-item,
.sidebar-pinned .nav-item {
    justify-content: flex-start;
    padding: .52rem .72rem;
    gap: .55rem;
}
.nav-item:hover {
    color: var(--text);
    background: var(--surface2);
}
.nav-item:hover .nav-icon {
    color: var(--accent);
}

/* Active — dark pill, white text */
.nav-item.active {
    background: #0f1f2a;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(15, 31, 42, .18);
}
[data-theme="dark"] .nav-item.active {
    background: #eaecf0;
    color: #111520;
    box-shadow: 0 2px 8px rgba(234, 236, 240, .1);
}
.nav-item.active [data-lucide] {
    color: inherit;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-item .nav-icon [data-lucide] {
    width: 17px;
    height: 17px;
    transition: transform 150ms var(--ease);
}
.nav-item:hover .nav-icon [data-lucide] {
    transform: scale(1.08);
}
.nav-item .nav-label {
    overflow: hidden;
    opacity: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
    transition: opacity .25s cubic-bezier(.4, 0, .2, 1);
}
.sidebar:hover .nav-item .nav-label,
.sidebar-pinned .nav-item .nav-label {
    opacity: 1;
    width: auto;
    position: static;
    pointer-events: auto;
}

/* External link icon — fully removed from flow when collapsed */
.nav-ext {
    margin-left: auto;
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    position: absolute;
    pointer-events: none;
    transition: opacity .25s cubic-bezier(.4, 0, .2, 1);
}
.sidebar:hover .nav-ext,
.sidebar-pinned .nav-ext {
    opacity: 1;
    width: auto;
    height: auto;
    position: static;
    pointer-events: auto;
    display: flex;
}

/* Notification badge */
.nav-item .nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: .56rem;
    font-weight: 800;
    padding: .1rem .38rem;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
    line-height: 1.3;
    box-shadow: 0 2px 8px rgba(239, 68, 68, .4);
    animation: subtlePulse 2.5s ease-in-out infinite;
    display: none;
}
.sidebar:hover .nav-item .nav-badge,
.sidebar-pinned .nav-item .nav-badge {
    display: flex;
}

/* Footer - user section */
.sidebar-footer {
    padding: .5rem .6rem;
    border-top: 1px solid var(--border);
    background: var(--surface2);
    flex-shrink: 0;
}
.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem;
    font-size: .78rem;
    border-radius: var(--radius-sm);
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    justify-content: center;
}
.sidebar:hover .sidebar-footer .user-info,
.sidebar-pinned .sidebar-footer .user-info {
    justify-content: flex-start;
}
.sidebar-footer .user-info .user-avatar-sm {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
}
.sidebar:hover .sidebar-footer .user-info .user-avatar-sm,
.sidebar-pinned .sidebar-footer .user-info .user-avatar-sm {
    width: 38px; height: 38px; min-width: 38px;
}
.sidebar-footer .user-info .user-details {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    min-width: 0;
    flex: 0;
}
.sidebar:hover .sidebar-footer .user-info .user-details,
.sidebar-pinned .sidebar-footer .user-info .user-details {
    opacity: 1;
    width: auto;
    flex: 1;
}
.sidebar-footer .user-info .user-name {
    font-weight: 600;
    color: var(--text);
    font-size: .8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.sidebar-footer .user-info .user-role {
    font-size: .67rem;
    color: var(--text3);
    line-height: 1.2;
}

/* Footer actions — Profile + Sign Out */
.sidebar-footer .sidebar-actions {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--border);
    margin-top: .4rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
}
.sidebar:hover .sidebar-footer .sidebar-actions,
.sidebar-pinned .sidebar-footer .sidebar-actions {
    max-height: 50px;
    opacity: 1;
}
.sidebar-action-form { flex: 1; display: flex; }
.sidebar-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem;
    background: none;
    border: none;
    color: var(--text3);
    font-size: .78rem;
    cursor: pointer;
    transition: all 150ms var(--ease);
    font-family: var(--font);
    text-decoration: none;
    width: 100%;
}
.sidebar-action:first-child {
    border-right: 1px solid var(--border);
}
.sidebar-action:hover {
    color: var(--accent);
    background: var(--surface);
}
.sidebar-action-logout:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, .05);
}
.sidebar-action [data-lucide] { width: 14px; height: 14px; }
.sidebar-action-text {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
}

/* Nav tooltips */
.nav-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 12px;
    background: #0f1f2a;
    color: #fff;
    font-size: .72rem;
    font-weight: 500;
    padding: .3rem .6rem;
    border-radius: var(--radius-xs);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 150ms var(--ease);
    z-index: 300;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
[data-theme="dark"] .nav-tooltip {
    background: #eaecf0;
    color: #111520;
}
.nav-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #0f1f2a;
}
[data-theme="dark"] .nav-tooltip::before {
    border-right-color: #eaecf0;
}
.nav-item:hover .nav-tooltip {
    opacity: 1;
}
.sidebar:hover .nav-tooltip,
.sidebar-pinned .nav-tooltip {
    opacity: 0 !important;
}


/* ═════════════════════════════════════════════
   MAIN CONTENT
   ═════════════════════════════════════════════ */
.main-area {
    flex: 1;
    margin-left: var(--sidebar-collapsed);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    transition: margin-left .25s cubic-bezier(.4, 0, .2, 1);
}
.sidebar-pinned .main-area {
    margin-left: var(--sidebar-w);
}


/* ═════════════════════════════════════════════
   TOPBAR — clean, page title + breadcrumb
   ═════════════════════════════════════════════ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 var(--content-padding);
    min-height: var(--topbar-h);
    background: var(--bg);
    color: var(--text);
    border-bottom: none;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex: 1;
    min-width: 0;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
}

/* Page title area */
.topbar-title-area { min-width: 0; }
.topbar-page-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    letter-spacing: -.03em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Breadcrumb */
.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: .2rem;
    margin-top: .15rem;
}
.breadcrumb-item {
    font-size: .65rem;
    font-weight: 500;
    color: var(--text3);
    text-decoration: none;
    transition: color 150ms var(--ease);
    white-space: nowrap;
}
.breadcrumb-item:hover { color: var(--accent); }
.breadcrumb-home { display: flex; align-items: center; color: var(--text3); }
.breadcrumb-home:hover { color: var(--accent); }
.breadcrumb-active { color: var(--text2); font-weight: 600; }
.breadcrumb-sep {
    display: flex;
    align-items: center;
    color: var(--text3);
    font-size: .6rem;
    opacity: .4;
}
.breadcrumb-sep [data-lucide] { display: none; }
.breadcrumb-sep::before { content: "/"; font-weight: 400; }

/* Topbar divider */
.topbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 .35rem;
    flex-shrink: 0;
    opacity: .5;
}

/* Sidebar toggle - removed, sidebar auto-expands on hover */
.sidebar-toggle {
    display: none;
}

/* Search */
.topbar-search {
    position: relative;
}
.topbar-search input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: .4rem .85rem .4rem 2rem;
    color: var(--text);
    font-size: .78rem;
    width: 180px;
    height: 34px;
    outline: none;
    transition: all 250ms var(--ease);
    font-family: var(--font);
}
.topbar-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--focus-ring);
    width: 260px;
    background: var(--bg);
}
.topbar-search input::placeholder {
    color: var(--text3);
}
.topbar-search .search-icon {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
    display: flex;
    pointer-events: none;
    transition: color 200ms var(--ease);
}
.topbar-search:focus-within .search-icon {
    color: var(--accent);
}
.topbar-search .search-icon [data-lucide] {
    width: 14px;
    height: 14px;
}

/* ── Topbar action buttons ── */
.topbar-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text3);
    transition: all 180ms var(--ease);
    position: relative;
    text-decoration: none;
}
.topbar-action:hover {
    color: var(--text);
    background: var(--surface3);
    border-color: var(--border2);
}
.topbar-action:active {
    transform: scale(.97);
}
.topbar-action [data-lucide] {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}
.topbar-action .action-badge {
    position: absolute;
    top: 0;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-family: var(--font);
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
    line-height: 1;
    letter-spacing: .02em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-shadow: 0 2px 6px rgba(239,68,68,.35);
    z-index: 1;
}
.action-badge--blue {
    background: #3b82f6 !important;
    box-shadow: 0 2px 6px rgba(59,130,246,.35);
}

/* Theme toggle */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 180ms var(--ease);
    position: relative;
    overflow: visible;
    flex-shrink: 0;
    color: var(--text2);
}
.theme-toggle:hover {
    color: var(--text);
    background: var(--surface2);
    transform: scale(1.08);
}
.theme-toggle::after {
    content: "Toggle theme";
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--text);
    color: var(--bg);
    font-size: .6rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 180ms var(--ease);
    z-index: 10;
}
.theme-toggle:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.theme-toggle:active {
    transform: scale(.95);
}
.theme-toggle .t-icon {
    position: absolute;
    transition: opacity .5s var(--ease), transform .5s cubic-bezier(.4, 0, .2, 1);
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
[data-theme="light"] .theme-toggle .t-sun  { opacity: 0; transform: rotate(90deg) scale(.5); }
[data-theme="light"] .theme-toggle .t-moon { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"]  .theme-toggle .t-sun  { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"]  .theme-toggle .t-moon { opacity: 0; transform: rotate(-90deg) scale(.5); }

/* User avatar - topbar */
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 150ms var(--ease);
    border: 2px solid transparent;
    text-decoration: none;
    margin-left: .25rem;
    position: relative;
}
.user-avatar::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 9px;
    height: 9px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid var(--bg);
}
.user-avatar:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 107, 90, .12);
    color: #fff;
}
.user-avatar:active {
    transform: scale(.95);
}


/* ═════════════════════════════════════════════
   PAGE CONTENT — entrance animation
   ═════════════════════════════════════════════ */
.page-content {
    flex: 1;
    padding: 1.5rem var(--content-padding);
    max-width: var(--page-max-w);
    width: 100%;
    margin: 0 auto;
    /* IMPORTANT: do NOT put an entrance animation (or transform/opacity<1/filter)
       here. Any of those make .page-content a STACKING CONTEXT, which (a) becomes the
       containing block for the position:fixed modal — de-centring it — and (b) traps
       the modal at this flex-item's stacking level (0), BELOW the sticky .topbar
       (z-index:100), so the topbar paints over the dialog header. Keeping
       .page-content free of stacking-context triggers lets the modal (z-index:1000)
       resolve against the document root and overlay the whole viewport, topbar
       included. Verified with elementFromPoint in a layout repro. */
}
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.4rem;
    flex-wrap: wrap;
    gap: .75rem;
}
.page-header h1 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.02em;
}
.page-header-actions {
    display: flex;
    gap: .5rem;
}


/* ═════════════════════════════════════════════
   STAT / DASHBOARD CARDS — colored left border
   ═════════════════════════════════════════════ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
    gap: .85rem;
    margin-bottom: 1.5rem;
}
.dashboard-section-title {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text3);
    margin-bottom: .65rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.2rem;
    transition: all 200ms var(--ease);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
}
.stat-card::after {
    content: '\2192';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: .85rem;
    opacity: 0;
    transform: translateX(-6px);
    transition: all 200ms var(--ease);
    color: var(--text3);
    pointer-events: none;
}
.stat-card:hover {
    border-color: var(--border2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-card:hover::after {
    opacity: .6;
    transform: translateX(0);
}
.stat-card:active {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

/* Stat card colored left borders */
.stat-card.border-ocean,
.stat-card.border-accent { border-left-color: var(--accent); }
.stat-card.border-danger  { border-left-color: var(--danger); }
.stat-card.border-success { border-left-color: var(--success); }
.stat-card.border-signal,
.stat-card.border-warning { border-left-color: var(--warning); }

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .65rem;
    transition: transform 200ms var(--ease);
}
.stat-card:hover .stat-icon {
    transform: scale(1.08);
}
.stat-card .stat-icon [data-lucide] {
    width: 18px;
    height: 18px;
}
.stat-card .stat-icon.ocean,
.stat-card .stat-icon.success {
    background: var(--badge-accent-bg);
    color: var(--badge-accent-text);
}
.stat-card .stat-icon.signal {
    background: var(--badge-warning-bg);
    color: var(--badge-warning-text);
}
.stat-card .stat-icon.danger {
    background: var(--badge-danger-bg);
    color: var(--badge-danger-text);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.03em;
    line-height: 1;
}
.stat-card .stat-value.danger { color: var(--danger); }
.stat-card .stat-value.ocean  { color: var(--accent); }
.stat-card .stat-value.signal { color: var(--warning); }
.stat-card .stat-label {
    font-size: .7rem;
    color: var(--text3);
    margin-top: .25rem;
    font-weight: 500;
    letter-spacing: .01em;
}
.stat-card .stat-amount {
    font-size: .85rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: .35rem;
}


/* ═════════════════════════════════════════════
   CHART CARD — clean with inner shadow
   ═════════════════════════════════════════════ */
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}
.chart-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(26, 107, 90, .012) 0%, transparent 60%);
    pointer-events: none;
}
.chart-card h3 {
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: .9rem;
    position: relative;
}
.chart-placeholder {
    height: 180px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text3);
    font-size: .82rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, .04);
    position: relative;
}
[data-theme="dark"] .chart-placeholder {
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, .25);
}
.commission-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-top: .9rem;
}
.commission-item {
    padding: .75rem;
    border-radius: var(--radius);
    background: var(--surface2);
    border: 1px solid var(--border);
    transition: all 150ms var(--ease);
}
.commission-item:hover {
    border-color: var(--border2);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transform: translateY(-1px);
}
.commission-item .label {
    font-size: .65rem;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
}
.commission-item .value {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text);
    margin-top: .15rem;
}
.commission-item .period {
    font-size: .67rem;
    color: var(--text3);
}


/* ═════════════════════════════════════════════
   PUBLIC LAYOUT
   ═════════════════════════════════════════════ */
.public-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.public-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
}
.public-nav-inner {
    max-width: var(--page-max-w);
    margin: 0 auto;
    padding: .7rem var(--content-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.public-nav-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
    transition: opacity 150ms var(--ease);
}
.public-nav-brand:hover {
    opacity: .85;
}
.public-nav-brand .dot {
    width: 9px;
    height: 9px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(26, 107, 90, .35);
}
.public-nav-links {
    display: flex;
    gap: .15rem;
}
.public-nav-links a {
    padding: .42rem .75rem;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 500;
    color: var(--text3);
    transition: all 150ms var(--ease);
    text-decoration: none;
}
.public-nav-links a:hover {
    color: var(--text);
    background: var(--surface2);
}
.public-content {
    flex: 1;
    max-width: var(--page-max-w);
    margin: 0 auto;
    width: 100%;
    padding: 1.5rem var(--content-padding);
    animation: fadeInUp .4s var(--ease) both;
}
.public-footer {
    border-top: 1px solid var(--border);
    padding: 1.75rem var(--content-padding);
    text-align: center;
    color: var(--text3);
    font-size: .76rem;
    letter-spacing: .01em;
}


/* ═════════════════════════════════════════════
   PROPERTY CARD — image zoom, price badge, features
   ═════════════════════════════════════════════ */
.property-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 250ms var(--ease);
}
.property-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border2);
}
.property-card-image {
    aspect-ratio: 16/10;
    background: var(--surface2);
    position: relative;
    overflow: hidden;
}
.property-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ease);
}
.property-card:hover .property-card-image img {
    transform: scale(1.06);
}
.property-card-badges {
    position: absolute;
    top: .7rem;
    left: .7rem;
    display: flex;
    gap: .35rem;
    z-index: 1;
}
.property-card-price {
    position: absolute;
    bottom: .7rem;
    right: .7rem;
    background: rgba(15, 31, 42, .82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    padding: .35rem .78rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: .88rem;
    z-index: 1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
    letter-spacing: -.01em;
    transition: transform 200ms var(--ease);
}
.property-card:hover .property-card-price {
    transform: translateY(-2px);
}
.property-card-body {
    padding: .95rem 1.05rem;
}
.property-card-title {
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: .2rem;
    color: var(--text);
    transition: color 150ms var(--ease);
}
.property-card:hover .property-card-title {
    color: var(--accent);
}
.property-card-address {
    font-size: .76rem;
    color: var(--text3);
    margin-bottom: .55rem;
}
.property-card-features {
    display: flex;
    gap: .85rem;
    font-size: .74rem;
    color: var(--text2);
}
.property-card-features span {
    display: flex;
    align-items: center;
    gap: .28rem;
}
.property-card-features [data-lucide] {
    width: 13px;
    height: 13px;
    color: var(--accent);
}
.property-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1rem;
}


/* ═════════════════════════════════════════════
   HERO
   ═════════════════════════════════════════════ */
.hero {
    padding: 3.75rem 2rem 3.25rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(26, 107, 90, .06) 0%, rgba(26, 61, 92, .03) 50%, rgba(42, 191, 170, .04) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: 1.75rem;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -25%;
    width: 150%;
    height: 150%;
    background: radial-gradient(ellipse at 30% 20%, rgba(26, 107, 90, .05) 0%, transparent 50%);
    pointer-events: none;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    line-height: 1.15;
    margin-bottom: .45rem;
    position: relative;
}
.hero h1 em {
    font-style: italic;
    color: var(--accent);
}
.hero p {
    font-size: 1rem;
    color: var(--text2);
    margin-bottom: 1.35rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}
.hero-search {
    max-width: 550px;
    margin: 0 auto;
    position: relative;
}
.hero-search input {
    width: 100%;
    padding: .82rem 1.2rem .82rem 2.9rem;
    border-radius: var(--radius-full);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: .9rem;
    outline: none;
    transition: all 300ms var(--ease);
    font-family: var(--font);
    box-shadow: var(--shadow-md);
}
.hero-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--focus-ring), var(--shadow-lg);
}
.hero-search .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
    display: flex;
}


/* ═════════════════════════════════════════════
   AGENT PROFILE, DETAIL, INQUIRY
   ═════════════════════════════════════════════ */
.agent-profile-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: 1.75rem;
    transition: box-shadow 250ms var(--ease);
}
.agent-profile-header:hover {
    box-shadow: var(--shadow-md);
}
.agent-profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(26, 107, 90, .2);
}
.agent-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.agent-profile-info h1 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: .2rem;
}
.agent-profile-info .company {
    font-size: .95rem;
    color: var(--accent);
    margin-bottom: .45rem;
    font-weight: 500;
}
.agent-profile-info .bio {
    font-size: .85rem;
    color: var(--text2);
    line-height: 1.65;
}

.detail-gallery {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: .4rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    max-height: 420px;
    box-shadow: var(--shadow-sm);
}
.detail-gallery .main-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 280px;
    transition: transform .6s var(--ease);
}
.detail-gallery .main-photo:hover {
    transform: scale(1.02);
}
.detail-gallery .side-photos {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: .4rem;
}
.detail-gallery .side-photos img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ease);
}
.detail-gallery .side-photos img:hover {
    transform: scale(1.03);
}

.detail-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    margin-bottom: 1rem;
    transition: box-shadow 200ms var(--ease);
}
.detail-section:hover {
    box-shadow: var(--shadow-sm);
}
.detail-section h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .85rem;
}
.detail-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .65rem;
}
.detail-feature {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .82rem;
    color: var(--text2);
    padding: .35rem .5rem;
    border-radius: var(--radius-sm);
    transition: background 150ms var(--ease);
}
.detail-feature:hover {
    background: var(--surface2);
}
.detail-feature [data-lucide] {
    width: 15px;
    height: 15px;
    color: var(--accent);
    flex-shrink: 0;
}

.inquiry-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    position: relative;
    overflow: hidden;
}
.inquiry-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #2abfaa);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.inquiry-form h3 {
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: .9rem;
}


/* ═════════════════════════════════════════════
   AUTH LAYOUT
   ═════════════════════════════════════════════ */
.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.auth-layout-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 70% 50% at 15% 85%, rgba(26, 107, 90, .07) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 85% 15%, rgba(26, 61, 92, .06) 0%, transparent 40%),
        radial-gradient(ellipse 40% 30% at 50% 50%, rgba(42, 191, 170, .03) 0%, transparent 50%),
        var(--bg);
}
.auth-layout-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    padding: 2rem;
    animation: fadeInUp .45s var(--ease) both;
}


/* ═════════════════════════════════════════════
   DASHBOARD ENHANCEMENTS
   ═════════════════════════════════════════════ */

/* Entrance animations */
.anim {
    opacity: 0;
    transform: translateY(18px);
    animation: dash-fade-up .5s cubic-bezier(.16, 1, .3, 1) forwards;
    animation-delay: var(--d, 0s);
}

/* Welcome header */
.dash-welcome {
    margin-bottom: .15rem;
}
.dash-welcome h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.03em;
    margin: 0;
}
.dash-welcome h1 span {
    color: var(--accent);
}
.dash-date {
    font-size: .78rem;
    color: var(--text3);
    font-weight: 500;
    margin-top: .1rem;
}

/* Quick-stats strip — 4 cards with colored left borders */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.quick-stat {
    display: flex;
    align-items: center;
    gap: .85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: .85rem 1rem;
    position: relative;
    overflow: hidden;
    transition: all 200ms var(--ease);
    cursor: pointer;
}
.quick-stat:hover {
    border-color: var(--border2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.quick-stat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0 3px 3px 0;
}
.quick-stat.qs-ocean::before  { background: var(--accent); }
.quick-stat.qs-success::before { background: var(--success); }
.quick-stat.qs-signal::before  { background: var(--warning); }
.quick-stat.qs-danger::before  { background: var(--danger); }
.quick-stat .qs-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 200ms var(--ease);
}
.quick-stat:hover .qs-icon {
    transform: scale(1.08);
}
.quick-stat .qs-icon [data-lucide] {
    width: 18px;
    height: 18px;
}
.quick-stat.qs-ocean .qs-icon  { background: var(--badge-accent-bg); color: var(--badge-accent-text); }
.quick-stat.qs-success .qs-icon { background: var(--badge-accent-bg); color: var(--badge-accent-text); }
.quick-stat.qs-signal .qs-icon  { background: var(--badge-warning-bg); color: var(--badge-warning-text); }
.quick-stat.qs-danger .qs-icon  { background: var(--badge-danger-bg); color: var(--badge-danger-text); }
.quick-stat .qs-text {
    flex: 1;
    min-width: 0;
}
.quick-stat .qs-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    letter-spacing: -.02em;
}
.quick-stat .qs-label {
    font-size: .68rem;
    color: var(--text3);
    font-weight: 500;
    margin-top: .1rem;
}

/* Card top accent line (legacy support) */
.stat-card--accent {
    position: relative;
    overflow: hidden;
}
.stat-card--accent::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card--accent.accent-ocean::before  { background: var(--accent); }
.stat-card--accent.accent-success::before { background: var(--success); }
.stat-card--accent.accent-signal::before  { background: var(--warning); }
.stat-card--accent.accent-danger::before  { background: var(--danger); }

/* Clickable card arrow */
.stat-card--clickable {
    cursor: pointer;
    position: relative;
}
.stat-card--clickable .card-arrow {
    position: absolute;
    top: 1rem;
    right: 1rem;
    opacity: 0;
    transform: translateX(-4px);
    transition: all 200ms var(--ease);
    color: var(--text3);
}
.stat-card--clickable .card-arrow [data-lucide] {
    width: 14px;
    height: 14px;
}
.stat-card--clickable:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Section header */
.dash-section-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .6rem;
}
.dash-section-header .section-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface2);
    color: var(--text3);
}
.dash-section-header .section-icon [data-lucide] {
    width: 12px;
    height: 12px;
}

/* Commission 2x2 grid */
.commission-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.commission-grid .commission-col-header {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text3);
    padding: .5rem .7rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
}
.commission-grid .commission-col-header:first-child {
    border-radius: var(--radius) 0 0 0;
    border-right: 1px solid var(--border);
}
.commission-grid .commission-col-header:nth-child(2) {
    border-radius: 0 var(--radius) 0 0;
}
.commission-grid .commission-cell {
    padding: .7rem;
    border-bottom: 1px solid var(--border);
    transition: background 150ms var(--ease);
}
.commission-grid .commission-cell:hover {
    background: var(--surface2);
}
.commission-grid .commission-cell:nth-child(odd) {
    border-right: 1px solid var(--border);
}
.commission-grid .commission-cell .label {
    font-size: .66rem;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
}
.commission-grid .commission-cell .value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-top: .1rem;
}

/* Loading skeleton */
.skeleton-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    margin-bottom: 1rem;
}
.skeleton-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.1rem;
}
.skeleton-bar {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.skeleton-bar.w40 { width: 40%; height: 12px; }
.skeleton-bar.w60 { width: 60%; height: 12px; margin-top: .5rem; }
.skeleton-bar.w80 { width: 80%; height: 22px; margin-top: .6rem; }


/* ═════════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════════ */

/* Tablet: sidebar already collapsed by default, hover behavior inherited */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar:hover {
        z-index: 210;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .main-area {
        margin-left: 0 !important;
    }
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    .dashboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .property-cards-grid {
        grid-template-columns: 1fr;
    }
    .detail-gallery {
        grid-template-columns: 1fr;
    }
    .agent-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .topbar-search input {
        width: 150px;
    }
    .topbar-search input:focus {
        width: 180px;
    }
    .commission-summary {
        grid-template-columns: 1fr;
    }
    .page-content {
        padding: 1.25rem 1rem;
    }
    .hero {
        padding: 2.5rem 1.25rem 2.25rem;
    }
    .quick-stats {
        grid-template-columns: 1fr 1fr;
    }
    .commission-grid {
        grid-template-columns: 1fr;
    }
    .commission-grid .commission-col-header:first-child {
        border-right: none;
    }
    .commission-grid .commission-cell:nth-child(odd) {
        border-right: none;
    }
}

@media (max-width: 480px) {
    .quick-stats {
        grid-template-columns: 1fr;
    }
    .topbar-search {
        display: none;
    }
    .page-header h1 {
        font-size: 1.15rem;
    }
}

/* Mobile sidebar overlay */
@media (max-width: 768px) {
    body.sidebar-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .35);
        z-index: 199;
        animation: fadeIn .2s var(--ease) both;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
}


/* ═════════════════════════════════════════════
   DASHBOARD BENTO — new layout classes
   ═════════════════════════════════════════════ */

/* Animation class */
.dx {
    opacity: 0;
    transform: translateY(18px);
    animation: dash-fade-up .5s cubic-bezier(.16, 1, .3, 1) forwards;
    animation-delay: var(--d, 0s);
}

/* Hero welcome banner */
.dash-hero {
    background: linear-gradient(135deg, #1a6b5a 0%, #1a3d5c 100%);
    border-radius: 20px;
    padding: 1.75rem 2rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

/* KPI tiles row */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.kpi-tile {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border: 1px solid var(--border);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.kpi-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.kpi-tile:hover [data-lucide="chevron-right"] {
    opacity: .4 !important;
    transform: translateX(2px);
}
.kpi-circle {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kpi-circle.c1 { background: linear-gradient(135deg, #1a6b5a, #2abfaa); }
.kpi-circle.c2 { background: linear-gradient(135deg, #059669, #34d399); }
.kpi-circle.c3 { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.kpi-circle.c4 { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.kpi-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text);
    line-height: 1.1;
}
.kpi-label {
    font-size: .72rem;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: .6px;
    font-weight: 600;
    margin-top: 2px;
}

/* Bento grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    grid-auto-rows: auto;
}
.bento-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border: 1px solid var(--border);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.bento-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.1);
}
.bento-card--wide {
    grid-column: span 2;
}
.bento-card--tall {
    grid-row: span 2;
}

/* Bento card header */
.bento-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.bento-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.bento-dot.dot-teal  { background: #1a6b5a; }
.bento-dot.dot-red   { background: #ef4444; }
.bento-dot.dot-amber { background: #f59e0b; }
.bento-dot.dot-blue  { background: #3b82f6; }
.bento-title {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    font-weight: 700;
    color: var(--text3);
}
.bento-badge {
    font-size: .65rem;
    font-weight: 700;
    background: var(--bg);
    color: var(--text2);
    padding: .15rem .55rem;
    border-radius: 99px;
    border: 1px solid var(--border);
}

/* Bento metrics */
.bento-metric {
    display: flex;
    flex-direction: column;
}
.bento-metric .big {
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1.1;
    color: var(--text);
}
.bento-metric .sub {
    font-size: .75rem;
    color: var(--text3);
    margin-top: 2px;
}

/* Bento rows (payment style) */
.bento-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 0;
    border-bottom: 1px solid var(--border);
    gap: .75rem;
}
.bento-row:last-child {
    border-bottom: none;
}
.bento-row[style*="cursor:pointer"]:hover {
    background: var(--surface2);
    border-radius: var(--radius);
    margin: 0 -.5rem;
    padding-left: .5rem;
    padding-right: .5rem;
}
.bento-row-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bento-row-label {
    flex: 1;
    font-size: .8rem;
    color: var(--text2);
}
.bento-row-value {
    font-weight: 700;
    font-size: .85rem;
    color: var(--text);
}

/* Bento divider */
.bento-divider {
    height: 1px;
    background: var(--border);
    margin: .5rem 0;
}

/* Bento compare (commission) */
.bento-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.bento-compare .period {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text3);
    font-weight: 700;
    margin-bottom: .4rem;
}
.bento-compare .amount {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
}
.bento-compare .sub-line {
    font-size: .7rem;
    color: var(--text3);
    margin-top: .1rem;
}

/* Bento timeline (contracts) */
.bento-timeline {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 0;
}
.bento-timeline-node {
    text-align: center;
    flex: 1;
}
.bento-timeline-line {
    height: 2px;
    flex: 0 0 20px;
    background: var(--border);
    border-radius: 1px;
}

/* Skeleton loading classes */
.sk-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.sk-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.sk-bar {
    background: var(--border);
    border-radius: 8px;
    height: 14px;
    animation: skeleton-pulse 1.2s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-card--wide {
        grid-column: span 1;
    }
    .sk-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .dash-hero {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}


/* ═════════════════════════════════════════════
   BLAZOR
   ═════════════════════════════════════════════ */
.blazor-error-boundary {
    background: var(--danger);
    padding: 1rem;
    color: white;
    border-radius: var(--radius);
}
.blazor-error-boundary::after {
    content: "An error has occurred.";
}
#blazor-error-ui {
    background: var(--danger);
    color: white;
    padding: .5rem 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: .75rem;
    top: .5rem;
}
