/* ============================================================
   Shared admin design system
   Cross-page, reusable styles for the admin panel pages.
   Page-specific rules live in each page's own css file.
   ============================================================ */

/* --- Page shell --- */
.admin-page {
    background: #f7fafc;
    min-height: 100vh;
}

/* Admin layout main content area */
.admin-main {
    background: #f7fafc;
    min-height: 100vh;
    color: #2d3748;
}

/* --- Hero header banner --- */
.admin-hero {
    border-radius: 12px;
    color: #fff;
}

.admin-hero--purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.admin-hero--green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* Mud typography inside the hero inherits white text */
.admin-hero .mud-typography {
    color: #fff;
}

.hero-subtitle {
    opacity: 0.9;
}

/* --- Cards & boxes --- */
.admin-card {
    border-radius: 12px;
}

.admin-card--full {
    height: 100%;
}

.bordered-box {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

/* --- Typography helpers --- */
.card-title {
    font-weight: 700;
    color: #2d3748;
}

.card-subtitle {
    color: #718096;
}

.text-muted {
    color: #718096;
}

.text-faint {
    color: #a0aec0;
}

.text-dark {
    color: #2d3748;
}

.text-soft {
    color: #4a5568;
}

.text-blue {
    color: #4299e1;
}

.text-white {
    color: #fff;
}

.fw-500 {
    font-weight: 500;
}

.fw-600 {
    font-weight: 600;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.fw-700 {
    font-weight: 700;
}

.fw-800 {
    font-weight: 800;
}

.label-caps {
    color: #718096;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Loading --- */
.loading-area {
    height: 300px;
}

/* Full-screen loading shown while auth state is being resolved
   (prerender + initial circuit connect) to avoid the login flash. */
.admin-auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f7fafc;
}

/* --- Misc helpers --- */
.ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.min-w-0 {
    min-width: 0;
}

/* Inline stat (icon + number), used in tables and lists */
.inline-stat .mud-icon-root {
    margin-right: 4px;
}

.stat-icon-views {
    color: #4299e1;
}

.stat-icon-likes {
    color: #e53e3e;
}

/* --- Gradient action button --- */
.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    font-weight: 600;
}

/* --- Table card wrapper (admin list pages) --- */
.table-card {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

/* --- Row action icons --- */
.icon-edit {
    color: #38a169 !important;
}

.icon-delete {
    color: #e53e3e !important;
}

.icon-view {
    color: #4299e1 !important;
}

.icon-publish {
    color: #d69e2e !important;
}

/* --- Status chips (override MudBlazor filled defaults) --- */
.chip-success {
    background: #c6f6d5 !important;
    color: #22543d !important;
    font-weight: 600;
}

.chip-warning {
    background: #fef5e7 !important;
    color: #c05621 !important;
    font-weight: 600;
}

.chip-error {
    background: #fed7d7 !important;
    color: #c53030 !important;
    font-weight: 600;
}

.chip-neutral {
    background: #edf2f7 !important;
    color: #718096 !important;
    font-weight: 600;
}

/* Tinted chip — colour + soft background passed inline as --accent / --accent-soft */
.tint-chip {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
    font-weight: 600;
}

/* Category chip — solid colour passed inline as --chip */
.category-chip {
    background-color: var(--chip) !important;
    color: #fff !important;
    border-radius: 5px;
}

/* --- Dynamic accent helpers ---
   Pass the accent colour inline as a CSS variable, e.g.
   Style="--accent: #4299e1;"  (optionally --accent-soft for the tint) */
.accent-icon {
    color: var(--accent);
}

.accent-icon-box {
    background: var(--accent-soft, color-mix(in srgb, var(--accent) 13%, transparent));
    border-radius: 12px;
    padding: 12px;
}

/* --- Stat / KPI card --- */
.stat-card {
    border-radius: 12px;
    border-left: 4px solid var(--accent);
    height: 100%;
}

/* --- Error boundary fallback ---
   Friendly UI shown when an unexpected error is caught while rendering a page. */
.error-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    min-height: 50vh;
    padding: 40px 20px;
}

.error-fallback__icon {
    font-size: 56px;
    color: #e53e3e;
}

.error-fallback__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.error-fallback__text {
    color: #718096;
    max-width: 460px;
    margin: 0;
}

.error-fallback__btn {
    margin-top: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.error-fallback__btn:hover {
    opacity: 0.92;
}

.stat-value {
    font-weight: 700;
    color: #2d3748;
    margin: 4px 0;
}
