:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --danger: #ef4444;
    --success: #10b981;
    --bg: #ffffff;
    --bg-card: #ffffff;
    --border: #f1f5f9;
    --text: #1e293b;
    --text-muted: #64748b;
    --radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Layout & Nav --- */
.navbar {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.025em;
}

.logo stroke {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    width: 100%;
}

/* --- Typography --- */
h1,
h2,
h3 {
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text);
    margin-bottom: 1rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-sm {
    font-size: 0.875rem;
}

.text-primary {
    color: var(--primary);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.text-center {
    text-align: center;
}

.font-medium {
    font-weight: 500;
}

.font-bold {
    font-weight: 700;
}

.font-mono {
    font-family: monospace;
}

.text-lg {
    font-size: 1.125rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.w-full {
    width: 100%;
}

/* --- Components --- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Buttons */
.btn-primary,
.btn-outline,
.btn-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.btn-text {
    background-color: transparent;
    color: var(--text-muted);
}

.btn-text:hover {
    color: var(--text);
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control,
.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus,
.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* --- Login Page --- */
.split-layout {
    display: flex;
    min-height: 80vh;
    align-items: center;
    gap: 4rem;
}

.split-left {
    flex: 1;
}

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #6366f1, #4f46e5, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.split-right {
    flex: 1;
    max-width: 480px;
}

.auth-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
}

.auth-header {
    margin-bottom: 2rem;
    text-align: center;
}

.method-toggle {
    display: flex;
    background-color: #f1f5f9;
    border-radius: 8px;
    padding: 0.25rem;
    margin-bottom: 2rem;
}

.method-toggle button {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.method-toggle button.active {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: var(--text);
}

.input-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.oauth-icon {
    width: 48px;
    height: 48px;
    margin: 1rem auto;
    color: var(--primary);
}

/* --- Dashboard --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.2s;
    background-color: #f8fafc;
}

.upload-area.dragover {
    border-color: var(--primary);
    background-color: rgba(79, 70, 229, 0.1);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem;
    color: var(--text-muted);
}

.upload-area p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.file-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.2s ease;
}

/* Success Code */
.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    color: var(--success);
    background-color: rgba(16, 185, 129, 0.05);
    border-radius: 50%;
    padding: 12px;
}

.pickup-code-display {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--primary);
    margin: 1.5rem 0;
    font-family: 'Orbitron', 'JetBrains Mono', sans-serif;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

/* Fetch Card */
.fetch-box {
    text-align: center;
}

.code-input-lg {
    font-size: 3rem;
    text-align: center;
    letter-spacing: 0.3em;
    padding: 1.5rem;
    width: 100%;
    background-color: #f8fafc;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 700;
    font-family: 'Orbitron', 'JetBrains Mono', sans-serif;
    transition: all 0.3s;
}

.code-input-lg:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--border);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
}

.badge-danger {
    background-color: #fee2e2;
    color: #b91c1c;
}

.badge-success {
    background-color: #d1fae5;
    color: #047857;
}

.badge-muted {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

/* Table specific rows */
.row-danger {
    background-color: #fff1f2;
}

.row-used {
    opacity: 0.5;
}

/* Utilities */
.hidden {
    display: none !important;
}

.flex-between {
    display: flex;
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

/* Alerts */
.flash-messages {
    margin-bottom: 2rem;
}

.flash {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.flash-danger {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.flash-success {
    background-color: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #047857;
}

.flash-info {
    background-color: #e0f2fe;
    border: 1px solid #7dd3fc;
    color: #0369a1;
}

/* Responsive */
@media (max-width: 768px) {
    .split-layout {
        flex-direction: column;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }
}

/* --- Footer --- */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background-color: transparent;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    text-align: center;
}

.site-footer p {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: var(--primary);
}

.site-footer .separator {
    color: var(--border);
}