:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --glass-blur: blur(12px);
    --font-family: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    background-image:
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.2) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.2) 0, transparent 50%);
    background-attachment: fixed;
}

/* ---- Layout ---- */
.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* ---- Typography ---- */
header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ---- Navbar ---- */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* ---- Subnav ---- */
.subnav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.4);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.subnav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.subnav a:hover,
.subnav a.active {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.1);
}

/* ---- Glass Card ---- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
}

.card h2 {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

a .card, a.card {
    color: var(--text-color);
    text-decoration: none;
}

.card ul { list-style: none; margin-bottom: 1.5rem; }
.card li { padding: 0.5rem 0; border-bottom: 1px solid var(--border-color); }
.card li:last-child { border-bottom: none; }

/* ---- Forms ---- */
.glass-form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    text-decoration: none;
    text-align: center;
}

.primary-btn { background-color: var(--primary-color); }
.primary-btn:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.secondary-btn { background-color: var(--secondary-color); }
.secondary-btn:hover {
    background-color: var(--secondary-hover);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.glass-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}
.glass-btn:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--primary-color);
}

.btn-block, .w-100 { width: 100%; }

/* ---- Alerts ---- */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.alert.success, .alert:not(.error) {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* ---- Table ---- */
.table-container {
    overflow-x: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

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

th, td { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color); }

th {
    background-color: rgba(15, 23, 42, 0.5);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background-color: rgba(255, 255, 255, 0.03); }

/* ---- Login / Auth ---- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    text-align: center;
}

.login-container h1 {
    margin-bottom: 2rem;
    font-size: 2rem;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: left;
}

/* ---- Admin ---- */
.admin-container { margin-top: 3rem; }
.admin-container h1 { margin-bottom: 2rem; }

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 400px;
}

/* ---- Utilities ---- */
.text-muted { color: var(--text-muted); }
.text-green  { color: var(--secondary-color); font-weight: 700; }
.text-center { text-align: center; }
code {
    background: rgba(255,255,255,0.08);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ---- Animations ---- */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Admin Sidebar Layout ---- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: rgba(15, 23, 42, 0.8);
    border-right: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.admin-sidebar .sidebar-brand {
    padding: 0 1.5rem 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.admin-sidebar h3 {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.admin-sidebar a {
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.admin-sidebar a:hover {
    background: rgba(255, 255, 255, 0.05);
}

.admin-sidebar a.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.admin-content {
    flex-grow: 1;
    padding: 2rem 3rem;
    max-width: 1200px;
}

.hamburger-btn {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    backdrop-filter: var(--glass-blur);
}

.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.page-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0;
    background: none;
    -webkit-text-fill-color: var(--text-color);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .glass-form { grid-template-columns: 1fr; }
    .btn { width: 100%; }
    header h1 { font-size: 2rem; }
    
    /* Sidebar mobile overrides */
    .hamburger-btn {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 200;
    }
    
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 150;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-content {
        padding: 5rem 1.5rem 2rem;
    }
}
