:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #22c55e;
    --danger: #ef4444;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header */
.header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    color: var(--primary);
}

.nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav a:hover, .nav a.active {
    color: var(--text);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

/* Hero */
.hero {
    padding: 80px 0 60px;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Download cards */
.downloads-section {
    padding: 40px 0 80px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.section-title p {
    color: var(--text-muted);
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.file-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.file-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.file-icon {
    width: 64px;
    height: 64px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 28px;
}

.file-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.file-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.file-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Footer */
.footer {
    margin-top: auto;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 40px 0 30px;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    align-items: center;
}

.footer-stats {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-stats strong {
    color: var(--text);
}

.socials {
    display: flex;
    gap: 12px;
}

.socials a {
    width: 42px;
    height: 42px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 18px;
    transition: all 0.2s;
}

.socials a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.footer-copy {
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

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

.admin-sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
}

.admin-sidebar .logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.admin-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--text-muted);
    font-weight: 500;
}

.admin-menu a:hover, .admin-menu a.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.admin-content {
    flex: 1;
    padding: 30px;
    overflow-x: auto;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.stat-card .number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Progress bar */
.progress {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .nav {
        display: none;
    }
    
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
    }
    
    .files-grid {
        grid-template-columns: 1fr;
    }
}

/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.6rem;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
?>
.auth-dropdown { position: relative; display: inline-block; }
.auth-dropdown .dropdown-menu {
  display: none; position: absolute; right: 0; top: 100%;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; min-width: 160px; z-index: 200; padding: 8px 0;
}
.auth-dropdown.open .dropdown-menu { display: block; }
.auth-dropdown .dropdown-menu a {
  display: block; padding: 10px 16px; color: var(--text-muted);
}
.auth-dropdown .dropdown-menu a:hover { background: var(--bg-hover); color: var(--text); }


/* Mobile base improvements */
@media (max-width: 640px) {
    .container { padding: 0 14px; }
    .header { position: sticky; top: 0; }
    .btn { padding: 10px 16px; font-size: 0.9rem; }
    .card { padding: 16px; }
    .auth-card { padding: 24px 18px; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .admin-content { padding: 16px; }
    .table { font-size: 0.85rem; }
    .files-grid { grid-template-columns: 1fr; }
}
