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

@keyframes spin {
    to { transform: rotate(360deg); }
}

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --glass-bg: #ffffff;
    --glass-bg-hover: #f8fafc;
    --glass-border: rgba(226, 232, 240, 0.9);
    --glass-border-light: rgba(226, 232, 240, 0.6);
    --glass-border-glow: rgba(99, 102, 241, 0.3);
    
    --accent-indigo: #4f46e5;
    --accent-violet: #7c3aed;
    --accent-rose: #e11d48;
    --accent-emerald: #059669;
    --accent-amber: #d97706;
    --accent-sky: #0284c7;
    --accent-gold: #d97706;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --border-light: rgba(15, 23, 42, 0.08);
    --border-medium: rgba(15, 23, 42, 0.15);
    --border-glow: rgba(99, 102, 241, 0.4);
    
    --shadow-sm: 0 2px 8px 0 rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.08);
    --shadow-xl: 0 20px 48px -6px rgba(15, 23, 42, 0.1);
    --shadow-2xl: 0 32px 64px -12px rgba(15, 23, 42, 0.14);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
    
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-2xl: 36px;
    --transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    
    --gradient-primary: linear-gradient(135deg, #4f46e5, #7c3aed, #ec4899);
    --gradient-warm: linear-gradient(135deg, #e11d48, #d97706);
    --gradient-cool: linear-gradient(135deg, #0284c7, #4f46e5);
}

/* ── Global Page Reset & Light Crystal Canvas ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    background-color: #f8fafc;
    background-image: 
        radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 90% 15%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 85%, rgba(236, 72, 153, 0.06) 0px, transparent 50%);
    color: #0f172a;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

h1, h2, h3, h4, .logo, .section-title, .card-title, .hero-title, .brand-title, .admin-panel-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
}

/* ── Mesh Background Orbs ── */
.bg-mesh-container {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    will-change: transform;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    will-change: transform;
    pointer-events: none;
    animation: floatOrb 22s ease-in-out infinite alternate;
}

.bg-orb-1 {
    top: -15%;
    left: 20%;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(99, 102, 241, 0) 70%);
}

.bg-orb-2 {
    bottom: -20%;
    right: 12%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, rgba(124, 58, 237, 0) 70%);
    animation-delay: -9s;
}

.bg-orb-3 {
    top: 35%;
    left: -12%;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.14) 0%, rgba(236, 72, 153, 0) 70%);
    animation-delay: -4s;
}

@keyframes floatOrb {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(30px, 25px, 0) scale(1.04); }
    100% { transform: translate3d(-25px, -20px, 0) scale(0.97); }
}

/* ── Top Header Navigation ── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 2.75rem;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.logo {
    font-size: 1.65rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    display: flex;
    align-items: center;
    gap: 10px;
}

nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(241, 245, 249, 0.8);
    padding: 0.35rem 0.6rem;
    border-radius: 9999px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
}

.nav-link {
    text-decoration: none;
    color: #475569;
    font-weight: 600;
    font-size: 0.86rem;
    padding: 0.55rem 1.2rem;
    border-radius: 9999px;
    transition: var(--transition);
}

.nav-link:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.9);
}

.nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

/* ── App Container ── */
.app-container {
    max-width: 1340px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* ── Glass Utilities ── */
.glass-panel {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 1);
    border-radius: var(--radius-2xl);
    transition: var(--transition);
}

.glass-panel-interactive:hover {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 24px 50px -10px rgba(15, 23, 42, 0.09), 0 0 25px rgba(99, 102, 241, 0.15);
    transform: translateY(-4px);
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Cards & Bento ── */
.card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-2xl);
    padding: 2.25rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.card-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #0f172a;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
    margin-bottom: 3.5rem;
}

.stat-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.stat-card:hover {
    transform: translateY(-4px);
    background: #ffffff;
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: var(--shadow-xl), 0 0 25px rgba(99, 102, 241, 0.12);
}

.stat-card .value {
    font-size: 2.75rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.04em;
    line-height: 1;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0.75rem 1.75rem;
    background: var(--gradient-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
    filter: brightness(1.05);
}

.btn-secondary {
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-sm {
    padding: 0.45rem 1.1rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* ── Form Inputs ── */
.form-input {
    width: 100%;
    padding: 0.8rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
    background: #ffffff;
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    color: #334155;
    margin-bottom: 0.45rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Tables ── */
.admin-table-wrap {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(28px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    font-size: 0.74rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 1.1rem 1.75rem;
    background: #f8fafc;
    border-bottom: 1.5px solid #e2e8f0;
}

.data-table td {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: #1e293b;
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(99, 102, 241, 0.03);
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 9999px;
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.02em;
}

.badge-purple { background: rgba(124, 58, 237, 0.1); color: #7c3aed; border: 1px solid rgba(124, 58, 237, 0.25); }
.badge-emerald { background: rgba(5, 150, 105, 0.1); color: #059669; border: 1px solid rgba(5, 150, 105, 0.25); }
.badge-rose { background: rgba(225, 29, 72, 0.1); color: #e11d48; border: 1px solid rgba(225, 29, 72, 0.25); }
.badge-amber { background: rgba(217, 119, 6, 0.1); color: #d97706; border: 1px solid rgba(217, 119, 6, 0.25); }
.badge-sky { background: rgba(2, 132, 199, 0.1); color: #0284c7; border: 1px solid rgba(2, 132, 199, 0.25); }

/* ── Action Buttons ── */
.action-edit, .action-delete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    text-decoration: none;
}

.action-edit {
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.25);
}

.action-edit:hover {
    background: #4f46e5;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.action-delete {
    color: #e11d48;
    background: rgba(225, 29, 72, 0.08);
    border: 1px solid rgba(225, 29, 72, 0.25);
}

.action-delete:hover {
    background: #e11d48;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

/* ── Progress Bar ── */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.4);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Modal Overlay ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-overlay .card {
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-2xl);
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #cbd5e1;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 3.8rem;
    margin-bottom: 1.25rem;
    opacity: 0.85;
}

.empty-state-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    font-size: 0.9rem;
    color: #64748b;
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Responsive / Mobile UI ── */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    nav {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.5rem;
    }
    
    .app-container {
        padding: 0 1rem 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .data-table, .data-table tbody, .data-table tr, .data-table td {
        display: block;
        width: 100%;
    }
    
    .data-table thead {
        display: none;
    }
    
    .data-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: var(--radius-md);
        background: #fff;
    }
    
    .data-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
    }
    
    .data-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 45%;
        text-align: left;
        font-weight: 700;
        color: #475569;
        font-size: 0.75rem;
        text-transform: uppercase;
    }
}
