/* ===== Top Bar ===== */
.top-bar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
}
.brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.brand-icon {
    background: #e63946;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}
.top-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.top-nav a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.top-nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.top-nav a.active { color: #fff; background: rgba(255,255,255,0.15); }
.nav-logout { margin-left: 0.5rem; opacity: 0.6; }

/* ===== Main Content ===== */
.main-content { padding-top: 2rem; padding-bottom: 3rem; min-height: calc(100vh - 140px); }

/* ===== Page Headers ===== */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; }
.page-header p { color: #6c757d; margin: 0; }

/* ===== Cards ===== */
.card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-header {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== Status Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-error   { background: #f8d7da; color: #721c24; }
.badge-info    { background: #d1ecf1; color: #0c5460; }

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}
.stat-item {
    text-align: center;
    padding: 1rem;
    border-radius: 10px;
    background: #f8f9fa;
}
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8rem; color: #6c757d; margin-top: 0.3rem; }
.stat-item.uploaded { background: #d4edda; }
.stat-item.uploaded .stat-value { color: #155724; }
.stat-item.pending { background: #d1ecf1; }
.stat-item.pending .stat-value { color: #0c5460; }
.stat-item.missing { background: #fff3cd; }
.stat-item.missing .stat-value { color: #856404; }
.stat-item.total .stat-value { color: #1a1a2e; }
.stat-item.success { background: #c3e6cb; }
.stat-item.success .stat-value { color: #1e7e34; }

/* ===== Alerts ===== */
.alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert-icon { font-size: 1rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ===== Form Styling ===== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid label { font-size: 0.85rem; font-weight: 500; }
.form-actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-primary { background: linear-gradient(135deg, #e63946, #d62839); color: #fff; }
.btn-primary:hover { background: linear-gradient(135deg, #d62839, #c1121f); color: #fff; }
.btn-secondary { background: #f0f0f0; color: #333; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-outline { background: transparent; color: #e63946; border: 1px solid #e63946; }
.btn-outline:hover { background: #e63946; color: #fff; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

/* ===== Log Output ===== */
.log-container {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background: #0d1117;
    color: #c9d1d9;
    border-radius: 10px;
    line-height: 1.6;
}
.log-success { color: #3fb950; }
.log-error { color: #f85149; }
.log-warning { color: #d29922; }
.log-info { color: #79c0ff; }
.log-progress { color: #56d4dd; }
.log-done { color: #3fb950; font-weight: bold; }

/* ===== Live Indicator ===== */
.live-dot {
    width: 8px;
    height: 8px;
    background: #3fb950;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ===== Tables ===== */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}
.table-modern thead th {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid #e9ecef;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
}
.table-modern tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}
.table-modern tbody tr:hover { background: #f8f9fa; }
.table-modern a { color: #e63946; text-decoration: none; font-weight: 500; }

/* ===== Login Page ===== */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-card h2 { text-align: center; margin-bottom: 0.25rem; }
.login-card .subtitle { text-align: center; color: #6c757d; font-size: 0.9rem; margin-bottom: 1.5rem; }

/* ===== Footer ===== */
.footer-bar { text-align: center; padding: 1.5rem 0; color: #adb5bd; border-top: 1px solid #f0f0f0; }

/* ===== OAuth Link Box ===== */
.auth-link-box {
    padding: 1rem;
    background: #f0f4ff;
    border: 1px solid #d0d7ff;
    border-radius: 8px;
    word-break: break-all;
    font-size: 0.85rem;
}
.auth-link-box a { color: #1a56db; }

/* ===== Two-column layout ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }

/* ===== Results grid ===== */
.results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0; }
.result-item { text-align: center; padding: 1.25rem; border-radius: 10px; }
.result-item.uploaded { background: #d4edda; }
.result-item.skipped { background: #fff3cd; }
.result-item.failed { background: #f8d7da; }
