﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ==========================================
   MODERN PREMIUM THEME - FESOMEM
   ========================================== */

:root {
    /* Modern Color Palette */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --accent: #f59e0b;
    --accent-light: #fbbf24;

    /* Neutral Colors */
    --bg: #f8fafc;
    --bg-dark: #0f172a;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Status Colors */
    --success: #10b981;
    --success-bg: #ecfdf5;
    --error: #ef4444;
    --error-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;

    /* Effects */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(14, 165, 233, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(245, 158, 11, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ==========================================
   CONTAINER
   ========================================== */
.container {
    width: 92%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ==========================================
   SITE HEADER - HERO SECTION
   ========================================== */
.site-header {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #4338ca 70%, #6366f1 100%);
    color: #fff;
    padding: 0;
    position: relative;
    overflow: hidden;
}

/* Animated gradient orbs */
.site-header::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation: float 20s ease-in-out infinite;
}

.site-header::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.3) 0%, transparent 70%);
    bottom: -100px;
    left: -50px;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    position: relative;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform var(--transition), box-shadow var(--transition);
}

.brand:hover img {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 10px 16px;
    border-radius: var(--radius);
    transition: all var(--transition);
    font-size: 0.9rem;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-1px);
}

.nav-admin {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px);
}

.nav-admin:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: center;
    padding: 60px 0 80px;
    position: relative;
    z-index: 1;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hero h1 {
    margin: 0;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    margin: 0;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.7;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* Stats Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.stat {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition);
}

.stat:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin-top: 4px;
}

/* Latest Card - Glassmorphism */
.latest-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    color: var(--text);
}

.latest-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.latest-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.latest-list li {
    padding: 16px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--border);
    transition: all var(--transition);
    cursor: pointer;
}

.latest-list li:hover {
    transform: translateX(8px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.latest-title {
    font-weight: 700;
    color: var(--text);
    font-size: 0.95rem;
}

.latest-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.link-muted {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 16px;
    transition: all var(--transition);
}

.link-muted:hover {
    gap: 10px;
    color: var(--primary-dark);
}

/* ==========================================
   PILLS & BADGES
   ========================================== */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.pill-light {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
}

.pill-accent {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(251, 191, 36, 0.15) 100%);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 100px;
    background: var(--border-light);
    color: var(--text);
    font-weight: 600;
    font-size: 0.75rem;
    transition: all var(--transition);
}

.chip:hover {
    background: var(--border);
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: #1e1b4b;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
    color: #1e1b4b;
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    color: #fff;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--border-light);
    transform: translateY(-1px);
}

/* ==========================================
   CARDS
   ========================================== */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card h3 {
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

/* ==========================================
   SECTIONS
   ========================================== */
.section {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.section-header {
    margin-bottom: 24px;
}

.section-header .pill-light {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.section-header h3 {
    margin: 12px 0 4px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

/* ==========================================
   FORMS
   ========================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 8px;
    color: var(--text);
}

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    background: var(--surface);
    color: var(--text);
    transition: all var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 44px;
}

/* ==========================================
   ALERTS
   ========================================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: var(--success-bg);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: var(--error-bg);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* ==========================================
   ADS GRID
   ========================================== */
.ads {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.ad-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.ad-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

.ad-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border-color: var(--primary-light);
}

.ad-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
    margin-top: 6px;
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.ad-card h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.criteria {
    margin-top: 16px;
}

.criteria-title {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.ad-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.meta-item {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius);
    padding: 12px 14px;
    border: 1px solid var(--border);
}

.meta-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    font-weight: 700;
    color: var(--text);
    font-size: 0.9rem;
    margin-top: 2px;
}

.ad-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ==========================================
   TABLES
   ========================================== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--border-light);
    border-bottom: 2px solid var(--border);
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.table tr:hover {
    background: var(--border-light);
}

/* ==========================================
   ADMIN STYLES
   ========================================== */
.page-header {
    background: var(--surface);
    padding: 16px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.page-header .brand img {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
    border: 1px solid var(--border);
}

.page-header .nav-links a {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.page-header .nav-links a:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.admin-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(14, 165, 233, 0.08) 100%);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================
   FOOTER
   ========================================== */
footer {
    margin-top: 60px;
    padding: 32px 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

/* ==========================================
   MUTED TEXT
   ========================================== */
.muted {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ==========================================
   RESPONSIVE STYLES
   ========================================== */

/* --- TABLET (≤992px) --- */
@media (max-width: 992px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 36px 0 50px;
    }

    .hero h1 {
        font-size: 2.1rem;
        text-align: center;
    }

    .hero p {
        text-align: center;
        max-width: 100%;
    }

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

    .hero-actions {
        justify-content: center;
    }

    .ads {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* --- MOBILE (≤768px) --- */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }

    /* Navigation */
    .nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        padding: 12px 0;
    }

    .brand {
        font-size: 1.1rem;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px;
    }

    .nav-links a {
        padding: 10px 14px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    /* Hero */
    .hero {
        padding: 28px 0 40px;
        gap: 24px;
    }

    .hero h1 {
        font-size: 1.65rem;
        text-align: center;
        line-height: 1.2;
    }

    .hero p {
        text-align: center;
        font-size: 0.95rem;
        max-width: 100%;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Stats */
    .stat-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .stat {
        padding: 12px 8px;
    }

    .stat-value {
        font-size: 1.35rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* Latest Card */
    .latest-card {
        padding: 18px;
        border-radius: var(--radius-lg);
    }

    .latest-list li {
        padding: 12px;
    }

    /* Page Header */
    .page-header .nav-links {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .page-header .nav-links::-webkit-scrollbar {
        display: none;
    }

    /* Tables */
    .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .table th,
    .table td {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    /* Sections */
    .section {
        padding: 18px;
        border-radius: var(--radius-lg);
    }

    .section-header h3 {
        font-size: 1.25rem;
    }

    /* Forms */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* Ads Grid */
    .ads {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .ad-card {
        padding: 18px;
    }

    .ad-meta-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .meta-item {
        padding: 10px 12px;
    }

    .meta-label {
        font-size: 0.65rem;
    }

    .meta-value {
        font-size: 0.85rem;
    }

    .ad-footer {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .ad-footer .btn {
        width: 100%;
        justify-content: center;
    }

    /* Admin header */
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Buttons - touch friendly */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    /* Cards */
    .card {
        padding: 16px;
        border-radius: var(--radius);
    }

    .card h3 {
        font-size: 1.1rem;
    }

    /* Alerts */
    .alert {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    /* Footer */
    footer {
        margin-top: 40px;
        padding: 24px 0;
        font-size: 0.8rem;
    }

    /* Touch targets */
    a,
    button,
    .btn,
    .chip,
    input[type="submit"] {
        min-height: 44px;
    }

    .table button,
    .table .chip,
    .table .btn {
        min-height: 36px;
        padding: 6px 10px;
    }

    /* iOS zoom prevention */
    input[type="text"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px;
        padding: 12px 14px;
    }
}

/* --- SMALL MOBILE (≤576px) --- */
@media (max-width: 576px) {
    .hero h1 {
        font-size: 1.4rem;
    }

    .hero p {
        font-size: 0.88rem;
    }

    .brand {
        font-size: 0.95rem;
    }

    .brand img {
        width: 36px;
        height: 36px;
        padding: 6px;
    }

    .nav-links a {
        padding: 8px 10px;
        font-size: 0.78rem;
    }

    /* Stats become 1 column */
    .stat-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 16px;
        text-align: left;
    }

    .stat-label {
        margin-bottom: 0;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    /* Ad card */
    .ad-card {
        padding: 14px;
    }

    .ad-card h4 {
        font-size: 1rem;
    }

    .ad-meta-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .ad-footer {
        padding-top: 12px;
        margin-top: 12px;
    }

    /* Pill */
    .pill {
        font-size: 0.7rem;
        padding: 5px 10px;
    }

    /* Chips */
    .chip {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Stats admin */
    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 14px;
    }
}

/* --- MICRO MOBILE (≤400px) --- */
@media (max-width: 400px) {
    .container {
        width: 96%;
        padding: 0 8px;
    }

    .hero h1 {
        font-size: 1.25rem;
    }

    .hero-actions .btn {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 8px;
        font-size: 0.72rem;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 12px;
    }

    .section {
        padding: 14px;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 576px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }
}

/* ==========================================
   PREVENT HORIZONTAL OVERFLOW
   ========================================== */
html,
body,
main {
    overflow-x: hidden;
}

/* Smooth scrolling */
.table {
    -webkit-overflow-scrolling: touch;
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    footer {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

/* Better tap highlight */
a,
button {
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.1);
}