/* ── Force pure dark-grey palette (remove blue tint) ── */
:root,
[data-theme="dark"],
.dark {
    --color-base-50: 250 250 250;
    --color-base-100: 244 244 245;
    --color-base-200: 228 228 231;
    --color-base-300: 212 212 216;
    --color-base-400: 161 161 170;
    --color-base-500: 113 113 122;
    --color-base-600: 82 82 91;
    --color-base-700: 63 63 70;
    --color-base-800: 30 30 30;
    --color-base-900: 18 18 18;
    --color-base-950: 14 14 16;
}

.ll-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0.25rem 0 1.5rem;
}

.ll-dashboard-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 34%),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.03), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    overflow: hidden;
    word-break: break-word;
}

.ll-dashboard-hero > div:first-child {
    flex: 1 1 32rem;
    min-width: 0;
}

.ll-dashboard-kicker {
    margin: 0 0 0.35rem;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ll-dashboard-hero h1 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-wrap: balance;
}

.ll-dashboard-copy,
.ll-dashboard-meta,
.ll-stat-meta,
.ll-panel-copy,
.ll-muted {
    color: #9ca3af;
}

.ll-dashboard-copy {
    margin: 0.55rem 0 0;
    max-width: 42rem;
    font-size: 1rem;
}

.ll-dashboard-meta {
    font-size: 0.85rem;
}

.ll-dashboard-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: flex-start;
}

.ll-stats-grid,
.ll-chart-grid,
.ll-breakdown-grid,
.ll-table-grid {
    display: grid;
    gap: 1rem;
}

.ll-stats-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ll-chart-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ll-breakdown-grid,
.ll-table-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ll-stat-card,
.ll-panel-card {
    height: 100%;
}

.ll-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ll-stat-icon {
    color: #cbd5e1;
    font-size: 1.35rem;
}

.ll-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.24rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.ll-badge-slate {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.ll-badge-emerald {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.ll-badge-indigo {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.ll-badge-amber {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.ll-badge-pink {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
}

.ll-badge-violet {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.ll-stat-value {
    margin-top: 1rem;
    color: #f8fafc;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}

.ll-stat-label {
    margin: 0.7rem 0 0.3rem;
    color: #e5e7eb;
    font-size: 0.95rem;
    font-weight: 700;
}

.ll-stat-meta,
.ll-panel-copy {
    margin: 0;
    font-size: 0.85rem;
}

.ll-panel-copy {
    margin-bottom: 1rem;
}

.ll-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ll-breakdown-row {
    display: grid;
    gap: 0.45rem;
}

.ll-breakdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: #e5e7eb;
    font-size: 0.92rem;
}

.ll-breakdown-track {
    height: 0.52rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.ll-breakdown-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.ll-breakdown-row small {
    color: #9ca3af;
    font-size: 0.78rem;
    text-align: right;
}

.ll-table-grid a {
    color: #f8fafc;
    font-weight: 600;
    text-decoration: none;
}

.ll-table-grid a:hover {
    color: #f9a8d4;
}

@media (max-width: 1600px) {
    .ll-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .ll-chart-grid,
    .ll-breakdown-grid,
    .ll-table-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .ll-dashboard-hero {
        flex-direction: column;
        justify-content: flex-start;
        gap: 1rem;
    }

    .ll-dashboard-hero > div:first-child {
        flex: 1 1 auto;
    }

    .ll-dashboard-actions {
        justify-content: flex-start;
    }

    .ll-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .ll-stats-grid {
        grid-template-columns: 1fr;
    }

    .ll-dashboard-hero {
        padding: 1.25rem;
    }

    .ll-dashboard-hero h1 {
        font-size: 1.5rem;
    }

    .ll-dashboard-copy {
        font-size: 0.875rem;
    }
}

/* ── Force dark theme across all unfold 0.44 surfaces ── */
/* Unfold 0.44 uses bg-base-* (oklch) instead of bg-gray-*/bg-slate-* */

/* Page body background */
html body,
body.login,
.bg-base-50,
.dark\:bg-base-900,
.bg-base-900 {
    background-color: #121212 !important;
}

/* Sidebar */
aside,
nav[class*="sidebar"],
#nav-sidebar,
[class*="nav-global"] {
    background-color: #121212 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Header / top bar */
header {
    background-color: #121212 !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

/* Cards / panels / elevated surfaces */
.bg-base-100,
.dark\:bg-base-800,
.bg-base-800,
.ll-dashboard-hero,
.ll-stat-card,
.ll-panel-card {
    background-color: #1e1e1e !important;
}

/* Deeper surfaces (inputs, wells) */
.bg-base-200,
.dark\:bg-base-950,
.bg-base-950 {
    background-color: #0e0e10 !important;
}

/* Borders everywhere */
.border-base-200,
.dark\:border-base-700,
.border-base-700,
.dark\:border-base-800,
.border-base-800 {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ── Login page specific ── */
#login-form button[type="submit"] {
    background: #ffffff !important;
    color: #18181b !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease !important;
}

#login-form button[type="submit"]:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15) !important;
    background: #f4f4f5 !important;
}

/* Login + all admin inputs */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select {
    background-color: #1e1e1e !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f0f0f0 !important;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05) !important;
}

/* Text color consistency */
.text-base-500,
.dark\:text-base-400 {
    color: #a1a1aa !important;
}

.text-font-important-light,
.dark\:text-font-important-dark {
    color: #e4e4e7 !important;
}

/* Push footer to bottom */
#main {
    display: flex;
    flex-direction: column;
}

#main > footer,
.px-4.pb-6.mt-auto {
    margin-top: auto !important;
}

/* Dashboard grids overflow guard */
.ll-dashboard,
.ll-stats-grid,
.ll-chart-grid,
.ll-breakdown-grid,
.ll-table-grid {
    max-width: 100%;
    overflow: hidden;
}

.ll-dashboard-hero h1 {
    font-size: clamp(1.5rem, 2.5vw, 2.6rem);
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

/* Fix iOS auto-zoom */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px !important;
    }
}
