/* ============================================
   COMPONENTS — myndfocal News
   Buttons, cards, forms, tables, messages, etc.
   ============================================ */

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    text-decoration: none;
    font-family: var(--font-ui);
    transition: background var(--duration-fast) ease, transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-fast) ease, color var(--duration-fast) ease;
    gap: 6px;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-secondary {
    background: var(--ink);
    color: white;
}

.btn-secondary:hover {
    background: var(--ink-muted);
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--accent-softer);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* ── Messages ── */
.message {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin: 16px 0;
    display: none;
    font-size: 0.95rem;
    font-family: var(--font-ui);
}

.message.active {
    display: block;
}

.message.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.message.error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

/* ── Featured card ── */
.featured {
    margin-bottom: 48px;
}

.featured-card {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 0;
    align-items: stretch;
    background: var(--paper-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out);
}

.featured-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-3px);
}

.featured-card .featured-img-wrap {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, var(--border) 25%, var(--paper) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: lazy-shine 1.5s ease-in-out infinite;
}

.featured-card .featured-img-wrap.loaded {
    animation: none;
    background: var(--paper);
}

.featured-card .featured-img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.20) 0%, transparent 50%);
    pointer-events: none;
}

.featured-img {
    aspect-ratio: 16/10;
    object-fit: cover;
    width: 100%;
    height: 100%;
    display: block;
    transition: opacity var(--duration-normal) ease, transform var(--duration-slow) var(--ease-out);
}

.featured-img[loading="lazy"] {
    opacity: 0;
}

.featured-img.loaded {
    opacity: 1;
}

.featured-card:hover .featured-img {
    transform: scale(1.03);
}

.featured-body {
    padding: clamp(24px, 4vw, 36px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-body h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.35rem, 4vw, 2rem);
    line-height: 1.25;
    margin-bottom: 14px;
    font-weight: 700;
    color: var(--ink);
    transition: color var(--duration-fast);
}

.featured-card:hover .featured-body h2 {
    color: var(--accent);
}

.featured-meta {
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--ink-muted);
    font-family: var(--font-ui);
}

.featured-meta .by-label {
    font-weight: 600;
    color: var(--ink);
}

.featured-body .description {
    color: var(--ink-muted);
    font-size: 1.05rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 900px) {
    .featured-card {
        grid-template-columns: 1fr;
    }

    .featured-body {
        padding: clamp(16px, 4vw, 24px);
    }
}

@media (max-width: 480px) {
    .featured-body {
        padding: 16px;
    }

    .featured-body h2 {
        font-size: 1.25rem;
    }
}

/* ── Article cards ── */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: clamp(16px, 3vw, 26px);
}

@media (max-width: 480px) {
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.article-card {
    display: flex;
    flex-direction: column;
    height: 340px;
    background: var(--paper-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out), border-color var(--duration-fast);
}

.article-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
    border-color: var(--border-strong);
}

.article-card:hover .article-card-body h3 {
    color: var(--accent);
}

.article-card:hover .article-card-img {
    transform: scale(1.05);
}

.article-card-img-wrap {
    aspect-ratio: 16/9;
    position: relative;
    background: linear-gradient(90deg, var(--border) 25%, var(--paper) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: lazy-shine 1.5s ease-in-out infinite;
    overflow: hidden;
    flex-shrink: 0;
}

/* ── Category badge overlay on image ── */
.card-category-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background var(--duration-fast);
}

.article-card:hover .card-category-badge {
    background: var(--accent);
    border-color: var(--accent);
}

.article-card-img-wrap.loaded {
    animation: none;
    background: var(--paper);
}

.article-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease-out), opacity var(--duration-normal) ease;
}

.article-card-img[loading="lazy"] {
    opacity: 0;
}

.article-card-img.loaded {
    opacity: 1;
}

/* ── Image placeholder ── */
.img-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: absolute;
    inset: 0;
    min-height: 140px;
    background: linear-gradient(145deg, var(--paper) 0%, var(--border) 50%, var(--paper-warm) 100%);
    color: var(--ink-muted);
}

.featured-img-wrap .img-placeholder {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
}

.img-placeholder img.placeholder-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 50%;
    flex-shrink: 0;
}

.img-placeholder .placeholder-text {
    font-family: var(--font-heading);
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.featured-img-wrap .img-placeholder {
    aspect-ratio: 16/10;
    min-height: auto;
}

.featured-img-wrap .img-placeholder img.placeholder-logo {
    width: 64px;
    height: 64px;
}

.featured-img-wrap .img-placeholder .placeholder-text {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.img-placeholder-hidden {
    display: none !important;
}

.article-card-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: clamp(14px, 3vw, 20px);
}

.article-card-body h3 {
    font-family: var(--font-heading);
    font-size: clamp(0.95rem, 2.2vw, 1.08rem);
    line-height: 1.4;
    font-weight: 700;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--ink);
    transition: color var(--duration-fast);
}

.article-card-meta {
    font-size: 0.85rem;
    color: var(--ink-muted);
    margin-bottom: 10px;
    font-family: var(--font-ui);
}

.article-card-meta .by-label {
    font-weight: 600;
    color: var(--ink);
}

.article-card-meta .time {
    opacity: 0.9;
}

.article-card-body .description {
    font-size: 0.9rem;
    color: var(--ink-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Controls bar ── */
.controls-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(10px, 2vw, 14px);
    margin-bottom: clamp(20px, 4vw, 28px);
    padding: clamp(12px, 3vw, 18px) clamp(14px, 3vw, 22px);
    background: var(--paper-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.controls-bar .btn {
    flex-shrink: 0;
}

.controls-bar .article-count {
    color: var(--ink-muted);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    font-weight: 500;
    margin-left: auto;
    flex-shrink: 0;
    font-family: var(--font-ui);
}

/* ── Filter pills ── */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.filter-pills::-webkit-scrollbar {
    display: none;
}

.filter-pills a {
    padding: clamp(8px, 1.5vw, 9px) clamp(14px, 2.5vw, 18px);
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    font-weight: 600;
    background: var(--paper);
    color: var(--ink-muted);
    border: 1px solid var(--border);
    transition: color var(--duration-fast), border-color var(--duration-fast), background var(--duration-fast), box-shadow var(--duration-fast);
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-ui);
}

.filter-pills a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 3px var(--accent-softer);
}

.filter-pills a.active {
    background: var(--ink);
    color: var(--paper-elevated);
    border-color: var(--ink);
    box-shadow: var(--shadow-sm);
}

/* ── Ad divider ── */
.ad-divider {
    text-align: center;
    padding: 14px 16px;
    margin: clamp(20px, 4vw, 32px) 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-ui);
}

/* ── Category section ── */
.category-section {
    margin-bottom: clamp(28px, 5vw, 44px);
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: clamp(40px, 8vw, 72px) clamp(16px, 4vw, 24px);
    background: var(--paper-elevated);
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    color: var(--ink-muted);
    box-shadow: var(--shadow-sm);
}

.empty-state h2 {
    font-size: 1.35rem;
    margin-bottom: 10px;
    color: var(--ink);
    font-family: var(--font-heading);
}

/* ── Loading state ── */
.loading {
    display: none;
    text-align: center;
    padding: 28px;
}

.loading.active {
    display: block;
}

/* ── Article detail page ── */
.article-back {
    margin-bottom: 24px;
}

.article-back a {
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    transition: color var(--duration-fast), background var(--duration-fast);
}

.article-back a:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.article-head {
    max-width: var(--max-article);
    margin: 0 auto clamp(20px, 4vw, 28px);
    padding: 0 clamp(0px, 2vw, 16px);
}

.article-head .source-tag {
    margin-bottom: 12px;
}

.article-head h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.25;
    font-weight: 700;
    margin-bottom: 14px;
}

.article-head .subheadline {
    font-size: 1.2rem;
    color: var(--ink-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.article-byline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 0.95rem;
    color: var(--ink-muted);
    font-family: var(--font-ui);
}

.article-byline .author {
    font-weight: 600;
    color: var(--ink);
}

.article-byline .author a {
    color: var(--accent);
    text-decoration: none;
}

.article-byline .author a:hover {
    text-decoration: underline;
}

/* ── Article hero image ── */
.article-hero-figure {
    max-width: var(--max-article);
    margin: 0 auto clamp(20px, 4vw, 32px);
    padding: 0 clamp(0px, 2vw, 16px);
}

.article-hero-img {
    width: 100%;
    max-width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius-md);
    display: block;
    box-shadow: var(--shadow-md);
}

.img-placeholder-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    min-height: 240px;
    max-height: 420px;
    aspect-ratio: 16/10;
    background: linear-gradient(145deg, var(--paper) 0%, var(--border) 50%, var(--paper-warm) 100%);
    border-radius: var(--radius-md);
    color: var(--ink-muted);
}

.img-placeholder-hero img.placeholder-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%;
}

.img-placeholder-hero .placeholder-text {
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.img-placeholder-hero.img-placeholder-hidden {
    display: none !important;
}

/* ── Article body ── */
.article-body-wrap {
    max-width: var(--max-article-body);
    margin: 0 auto;
    padding: 0 clamp(0px, 2vw, 16px);
}

.article-body-wrap .article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

.article-body {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    line-height: 1.85;
    color: var(--ink);
}

.article-body p {
    margin-bottom: 1.3em;
}

.article-body p:first-of-type::first-letter {
    font-family: var(--font-heading);
    font-size: 3.2em;
    float: left;
    line-height: 0.85;
    margin-right: 8px;
    margin-top: 4px;
    color: var(--accent);
    font-weight: 700;
}

.article-description-box {
    background: var(--paper-elevated);
    border-left: 4px solid var(--accent);
    padding: clamp(14px, 3vw, 20px) clamp(16px, 3vw, 24px);
    margin-bottom: clamp(20px, 4vw, 28px);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    color: var(--ink-muted);
    box-shadow: var(--shadow-xs);
}

.article-categories {
    margin-bottom: 24px;
}

.article-categories a,
.article-categories span {
    display: inline-block;
    padding: 6px 14px;
    margin-right: 8px;
    margin-bottom: 8px;
    background: var(--paper-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--ink-muted);
    text-decoration: none;
    font-family: var(--font-ui);
    transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
}

.article-categories a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.article-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: clamp(12px, 3vw, 20px);
    margin-top: clamp(24px, 5vw, 40px);
}

.article-gallery figcaption {
    font-size: 0.85rem;
    color: var(--ink-muted);
    margin-top: 10px;
    line-height: 1.4;
    font-family: var(--font-ui);
}

.article-gallery img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    display: block;
    transition: transform var(--duration-normal) var(--ease-out);
}

.article-gallery figure:hover img {
    transform: scale(1.02);
}

.article-original {
    margin-top: 40px;
    padding: 20px 24px;
    background: var(--paper-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--duration-fast);
}

.article-original:hover {
    box-shadow: var(--shadow-sm);
}

.article-original a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.article-original a:hover {
    text-decoration: underline;
}

/* ── Share bar (article detail) ── */
.share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.share-bar-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-muted);
    margin-right: 4px;
    font-family: var(--font-ui);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--paper);
    border: 1px solid var(--border);
    color: var(--ink-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast);
    text-decoration: none;
}

.share-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
    transform: scale(1.1);
}

@media (max-width: 640px) {
    .article-hero-img {
        max-height: 280px;
    }

    .article-gallery {
        grid-template-columns: 1fr;
    }

    .article-back {
        padding-left: 0;
    }
}

@media (max-width: 480px) {
    .article-hero-img {
        max-height: 220px;
    }

    .article-body-wrap .article-body img {
        border-radius: var(--radius-sm);
    }
}

/* ============================================
   ADMIN PANEL COMPONENTS
   ============================================ */

/* ── Admin layout ── */
.admin-wrap {
    display: flex;
    min-height: 100vh;
}

.admin-side {
    width: 250px;
    background: var(--admin-side);
    color: var(--admin-side-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-side a {
    color: inherit;
    text-decoration: none;
    display: block;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--duration-fast), color var(--duration-fast);
    border-radius: 0;
    font-family: var(--font-ui);
}

.admin-side a:hover {
    background: var(--admin-side-hover);
    color: #fff;
}

.admin-side a.active {
    background: var(--admin-side-hover);
    color: #fff;
    border-left: 3px solid var(--admin-accent);
    padding-left: 17px;
}

.admin-side .brand {
    padding: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    font-family: var(--font-ui);
    letter-spacing: -0.01em;
}

.admin-side .nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.admin-side .nav-section {
    padding: 16px 0 8px;
}

.admin-side .nav-section-title {
    padding: 0 20px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(226, 232, 240, 0.5);
    font-family: var(--font-ui);
}

.admin-side .nav-section:first-of-type {
    padding-top: 12px;
}

.admin-side .nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 12px 0;
}

.admin-side .nav-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-side .nav-footer a {
    color: rgba(226, 232, 240, 0.75);
    font-size: 0.85rem;
}

.admin-side .nav-footer a:hover {
    color: #fff;
}

.admin-main {
    flex: 1;
    min-width: 0;
    padding: clamp(16px, 4vw, 28px) clamp(16px, 4vw, 32px);
    overflow: auto;
    background: var(--admin-bg);
    color: var(--ink);
}

.admin-main h1 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    margin-bottom: 20px;
    font-weight: 700;
    font-family: var(--font-ui);
}

/* ── Admin cards ── */
.card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-md);
    padding: clamp(16px, 3vw, 24px);
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--duration-fast);
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--ink);
    font-family: var(--font-ui);
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--admin-muted);
    margin-top: 4px;
}

.section-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--admin-muted);
    margin-bottom: 12px;
    font-family: var(--font-ui);
}

/* ── Admin stat cards ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.stat {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--duration-fast), transform var(--duration-fast);
}

.stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--admin-accent), var(--accent-light));
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.stat:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.stat strong {
    display: block;
    font-size: 1.75rem;
    color: var(--admin-accent);
    font-family: var(--font-ui);
}

.stat span {
    font-size: 0.9rem;
    color: var(--admin-muted);
    font-family: var(--font-ui);
}

/* ── Admin tables ── */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 320px;
}

th,
td {
    text-align: left;
    padding: clamp(8px, 2vw, 12px) clamp(10px, 2vw, 16px);
    border-bottom: 1px solid var(--admin-border);
}

th {
    font-weight: 600;
    color: var(--admin-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    font-family: var(--font-ui);
    background: rgba(0, 0, 0, 0.01);
}

tr:hover td {
    background: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.muted {
    color: var(--admin-muted);
    font-size: 0.9rem;
}

/* ── Admin forms ── */
.admin-main input[type="text"],
.admin-main input[type="email"],
.admin-main input[type="password"],
.admin-main input[type="number"],
.admin-main input[type="url"],
.admin-main select,
.admin-main textarea {
    padding: 10px 14px;
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-ui);
    background: var(--admin-card);
    color: var(--ink);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.admin-main input:focus,
.admin-main select:focus,
.admin-main textarea:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.flex {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.admin-foot {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--admin-border);
    font-size: 0.85rem;
    color: var(--admin-muted);
    font-family: var(--font-ui);
}

.admin-foot a {
    color: var(--admin-accent);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ── Admin responsive ── */
@media (max-width: 768px) {
    .admin-wrap {
        flex-direction: column;
    }

    .admin-side {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .admin-side .brand {
        width: 100%;
        padding: 12px 16px;
        font-size: 1rem;
    }

    .admin-side .nav {
        flex: none;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0 8px 12px;
        gap: 4px;
    }

    .admin-side .nav-section {
        padding: 0;
        width: auto;
    }

    .admin-side .nav-section-title {
        width: 100%;
        padding: 8px 12px 4px;
    }

    .admin-side .nav-divider {
        width: 100%;
        margin: 8px 0;
    }

    .admin-side .nav-footer {
        width: 100%;
        margin-top: 0;
        padding: 8px 12px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }

    .admin-side a {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .admin-side a.active {
        border-left: none;
        padding-left: 12px;
        border-bottom: 2px solid var(--admin-accent);
    }
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .flex {
        gap: 8px;
    }
}

/* ============================================
   AUTH PAGE COMPONENTS
   ============================================ */
.auth-page {
    font-family: var(--font-ui);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0d9488 100%);
    background-size: 400% 400%;
    animation: auth-gradient 12s ease infinite;
}

@keyframes auth-gradient {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    animation: fade-in-up 0.5s var(--ease-out);
}

[data-theme="dark"] .auth-card {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 700;
    font-family: var(--font-ui);
}

.auth-card .auth-subtitle {
    color: var(--ink-muted);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.auth-card .auth-logo {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 50%;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--ink);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-ui);
    outline: none;
    background: var(--paper-elevated);
    color: var(--ink);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group input::placeholder {
    color: var(--ink-faint);
}

.auth-btn {
    width: 100%;
    padding: 13px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-ui);
    transition: background var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.auth-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateY(-1px);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
}

.auth-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-messages {
    margin-bottom: 20px;
}

.auth-message {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.auth-message.error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

.auth-message.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

/* ============================================
   REPORTER PORTAL COMPONENTS
   ============================================ */

.reporter-wrap {
    max-width: 900px;
    margin: 0 auto;
}

.reporter-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.reporter-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-ui);
}

.reporter-messages {
    margin-bottom: 16px;
}

.reporter-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    font-family: var(--font-ui);
}

/* ── Pending approval card ── */
.pending-card {
    max-width: 560px;
    margin: 48px auto;
    padding: 32px;
    background: var(--paper-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    text-align: center;
}

.pending-card h1 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    font-family: var(--font-ui);
}

.pending-card p {
    color: var(--ink-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.pending-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* ── Global form enhancements ── */
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-ui);
    outline: none;
    background: var(--paper-elevated);
    color: var(--ink);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--ink-faint);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.95rem;
}

/* ── Status badges (reporters, etc.) ── */
.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    display: inline-block;
    font-family: var(--font-ui);
}

.status-approved {
    background: #dcfce7;
    color: #166534;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

[data-theme="dark"] .status-approved {
    background: rgba(22, 101, 52, 0.25);
    color: #86efac;
}

[data-theme="dark"] .status-pending {
    background: rgba(146, 64, 14, 0.25);
    color: #fcd34d;
}

/* ── Utility classes ── */
.text-right {
    text-align: right;
}

.link-accent {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.link-accent:hover {
    text-decoration: underline;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mt-lg {
    margin-top: 20px;
}