/* ========================================
   COMPLETE CSS FOR POD MANAGEMENT SYSTEM
   ======================================== */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2a6df4;
    --primary-dark: #1a4f9e;
    --primary-light: #e8edf8;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f4f7fc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 8px 20px rgba(0,0,0,0.08);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   MODERN LOGIN PAGE
   ======================================== */
.login-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0f0c29;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.login-wrapper {
    width: 100%;
    max-width: 1200px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px 0;
}

/* Animated Background Shapes */
.login-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float-shape 20s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: #667eea;
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: #764ba2;
    bottom: -5%;
    right: -5%;
    animation-delay: -5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: #f093fb;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
    opacity: 0.15;
}

.shape-4 {
    width: 200px;
    height: 200px;
    background: #4facfe;
    bottom: 20%;
    left: 20%;
    animation-delay: -15s;
}

@keyframes float-shape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float-particle 15s infinite linear;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 12s; }
.particle:nth-child(2) { left: 20%; top: 60%; animation-delay: -2s; animation-duration: 18s; }
.particle:nth-child(3) { left: 30%; top: 80%; animation-delay: -4s; animation-duration: 14s; }
.particle:nth-child(4) { left: 50%; top: 30%; animation-delay: -6s; animation-duration: 16s; }
.particle:nth-child(5) { left: 60%; top: 70%; animation-delay: -8s; animation-duration: 20s; }
.particle:nth-child(6) { left: 70%; top: 10%; animation-delay: -10s; animation-duration: 13s; }
.particle:nth-child(7) { left: 80%; top: 50%; animation-delay: -12s; animation-duration: 17s; }
.particle:nth-child(8) { left: 90%; top: 90%; animation-delay: -14s; animation-duration: 19s; }
.particle:nth-child(9) { left: 40%; top: 90%; animation-delay: -16s; animation-duration: 15s; }
.particle:nth-child(10) { left: 85%; top: 25%; animation-delay: -18s; animation-duration: 11s; }

@keyframes float-particle {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* Login Container */
.login-container-modern {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.8s ease-out;
}

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

/* Brand */
.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.brand-icon {
    font-size: 3.5rem;
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 16px;
    animation: pulse-icon 3s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.login-brand h1 {
    color: white;
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    font-weight: 400;
    margin: 4px 0 0 0;
}

/* Login Card */
.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px 36px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    max-height: 85vh;
    max-height: 85dvh;
    overflow-y: auto;
}

.login-card:hover {
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h2 {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.login-header p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
    margin: 6px 0 0 0;
}

/* Alert */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

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

.alert-icon {
    font-size: 1.2rem;
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group-modern {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group-modern label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.input-icon {
    padding: 0 0 0 16px;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.3s ease;
}

.input-wrapper:focus-within .input-icon {
    color: #667eea;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 1rem;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
}

.input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.toggle-password {
    background: none;
    border: none;
    padding: 0 16px 0 0;
    font-size: 1.1rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: rgba(255, 255, 255, 0.6);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.checkbox-label:hover {
    color: rgba(255, 255, 255, 0.7);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-label input:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.forgot-link {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #667eea;
}

/* Login Button */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-login .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0 16px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.divider span {
    padding: 0 16px;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Demo Credentials */
.demo-creds {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: all 0.3s ease;
}

.demo-creds:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.cred-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.cred-label {
    color: rgba(255, 255, 255, 0.3);
}

.cred-value {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Login Footer */
.login-footer {
    margin-top: 24px;
}

.footer-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    margin: 16px 0 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.login-footer-bottom {
    text-align: center;
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.75rem;
    margin-top: 24px;
}

.login-footer-bottom p {
    margin: 0;
}

/* ========================================
   NAVIGATION
   ======================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    transition: 0.2s;
    font-size: 0.95rem;
}

.nav-links a.active,
.nav-links a:hover {
    background: var(--primary);
    color: white;
}

.user-info {
    font-size: 0.9rem;
    color: var(--text-light);
}

.main-content {
    padding: 30px 0;
}

/* ========================================
   DASHBOARD
   ======================================== */
.welcome-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius);
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    margin-bottom: 30px;
}

.welcome-content h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
    font-weight: 700;
}

.welcome-content p {
    opacity: 0.9;
    font-size: 1rem;
    margin: 0;
}

.welcome-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.welcome-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    background: white;
    color: #667eea;
    transition: all 0.3s ease;
}

.welcome-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.welcome-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.welcome-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

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

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.stat-card.planned { border-left-color: #3b82f6; }
.stat-card.received { border-left-color: #22c55e; }
.stat-card.outstanding { border-left-color: #f59e0b; }
.stat-card.completion { border-left-color: #8b5cf6; }

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 12px;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-trend span {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 12px;
}

.trend-up { background: #dcfce7; color: #166534; }
.trend-down { background: #fee2e2; color: #991b1b; }
.trend-neutral { background: #f1f5f9; color: #475569; }

/* Progress */
.progress-section {
    background: var(--card-bg);
    padding: 24px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.progress-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.progress-percentage {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.progress-track {
    background: #e5e7eb;
    border-radius: 20px;
    height: 32px;
    overflow: hidden;
    position: relative;
    margin-bottom: 16px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    min-width: 40px;
}

.progress-fill-label {
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding-top: 8px;
}

.step {
    display: flex;
    align-items: center;
    gap: 6px;
}

.step-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: white;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.step-dot.completed {
    background: #22c55e;
    border-color: #22c55e;
}

.step-dot.active {
    background: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
}

.step-dot.incomplete {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.step-label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.step-line {
    width: 40px;
    height: 2px;
    background: #d1d5db;
    margin: 0 8px;
    transition: all 0.3s ease;
}

.step-line.completed {
    background: #22c55e;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Recent Activity */
.recent-activity {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.recent-activity h3 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--bg);
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: var(--primary-light);
}

.activity-icon {
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 0.9rem;
    color: var(--text);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Quick Actions */
.quick-actions {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.quick-actions h3 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.action-card {
    background: var(--bg);
    padding: 16px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.action-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.action-icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.action-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.action-desc {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ========================================
   SCANNER
   ======================================== */
.scan-page h1 {
    margin-bottom: 20px;
}

.scan-methods {
    margin: 20px 0;
}

.method-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-light);
    transition: 0.2s;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.scanner-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.video-wrapper {
    flex: 1 1 350px;
    min-width: 280px;
    background: #1a1a2e;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.video-wrapper video {
    width: 100%;
    height: auto;
    min-height: 250px;
    max-height: 450px;
    display: block;
    background: #1a1a2e;
}

.preview-wrapper {
    flex: 1 1 350px;
    min-width: 280px;
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.preview-wrapper h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
}

#preview-container {
    min-height: 200px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#preview {
    display: none;
    max-width: 100%;
    max-height: 400px;
}

#preview-placeholder {
    text-align: center;
    padding: 30px 20px;
    color: #999;
}

#preview-placeholder span {
    display: block;
    font-size: 3rem;
    margin-bottom: 10px;
}

/* CAPTURE BUTTON - FORCED VISIBLE */
#capture-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 56px !important;
    width: 100% !important;
    padding: 16px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    border: none !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    border-radius: 0 0 12px 12px !important;
    margin: 0 !important;
    z-index: 999 !important;
    position: relative !important;
}

#capture-btn:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a3f8e 100%) !important;
    transform: scale(1.02) !important;
}

#capture-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Upload Button */
.btn-upload {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    margin-top: 10px;
    transition: 0.3s;
}

.btn-upload:hover {
    opacity: 0.9;
}

.btn-upload:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Camera Status */
.camera-status {
    margin: 12px 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
}

.camera-status.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.camera-status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.camera-status.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Result Messages */
.result {
    margin: 16px 0;
    padding: 16px;
    border-radius: var(--radius);
    font-weight: 500;
}

.result.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.result.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ========================================
   MANUAL ENTRY
   ======================================== */
.manual-entry {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 500px;
    margin: 0 auto;
}

.manual-entry h3 {
    margin-bottom: 8px;
}

.manual-entry p {
    color: var(--text-light);
    margin-bottom: 16px;
}

.manual-entry form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.manual-entry input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.manual-entry input:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

/* ========================================
   UPLOAD
   ======================================== */
.upload-page {
    max-width: 800px;
    margin: 0 auto;
}

.upload-info {
    background: var(--primary-light);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 16px 0;
}

.upload-info ul {
    margin-left: 20px;
    margin-top: 8px;
}

.upload-container {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    display: block;
    padding: 40px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    text-align: center;
    color: var(--text-light);
    transition: 0.2s;
}

.file-input-wrapper:hover .file-input-label {
    border-color: var(--primary);
    background: var(--primary-light);
}

.sample-data {
    margin-top: 20px;
}

.sample-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.sample-table th {
    background: var(--primary-light);
    font-weight: 600;
}

/* ========================================
   SEARCH
   ======================================== */
.search-container {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.search-row input {
    flex: 1;
    min-width: 150px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.search-row input:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

.search-results {
    margin-top: 20px;
}

.search-hint {
    text-align: center;
    color: var(--text-light);
    padding: 40px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.result-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-list li {
    background: var(--card-bg);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.result-list li strong {
    color: var(--primary);
}

/* ========================================
   USER MANAGEMENT
   ======================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.8rem;
    margin: 0;
}

.page-header .subtitle {
    color: var(--text-light);
    margin: 4px 0 0 0;
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card.mini {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary);
}

.stat-card.mini .stat-value {
    font-size: 1.6rem;
}

.table-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.users-table th {
    background: var(--bg);
    color: var(--text-light);
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

.users-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.users-table tr:hover td {
    background: var(--primary-light);
}

.users-table .empty,
.users-table .loading,
.users-table .error {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

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

.role-admin { background: #fef3c7; color: #92400e; }
.role-report { background: #dbeafe; color: #1e40af; }
.role-view { background: #d1fae5; color: #065f46; }
.role-scan_only { background: #fce4ec; color: #9a3412; }

.status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active { background: #dcfce7; color: #166534; }
.status-inactive { background: #fee2e2; color: #991b1b; }

.actions {
    display: flex;
    gap: 6px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
}

.btn-icon.edit:hover { background: #dbeafe; }
.btn-icon.delete:hover { background: #fee2e2; }

/* ========================================
   MODAL
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-light);
    transition: 0.2s;
}

.modal-close:hover {
    color: var(--text);
    transform: rotate(90deg);
}

.modal form {
    padding: 24px;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

#password-note {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-light);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.delete-warning {
    color: var(--danger);
    font-weight: 500;
    padding: 0 24px 20px 24px !important;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    border-radius: var(--radius);
    color: white;
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 2000;
    max-width: 400px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success { background: #22c55e; }
.toast-error { background: #ef4444; }
.toast-info { background: #3b82f6; }

/* ========================================
   BUTTONS (Global)
   ======================================== */
.btn-primary {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    background: var(--primary);
    color: white;
    transition: 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(42, 109, 244, 0.3);
}

.btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    background: var(--border);
    color: var(--text);
    transition: 0.2s;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-danger {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    background: var(--danger);
    color: white;
    transition: 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .nav-links {
        justify-content: center;
        gap: 0.3rem;
    }

    .nav-links a {
        padding: 4px 10px;
        font-size: 0.85rem;
    }

    .user-info {
        text-align: center;
        font-size: 0.8rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .welcome-banner {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .welcome-content h1 {
        font-size: 1.4rem;
    }

    .welcome-actions {
        justify-content: center;
    }

    .scanner-container {
        flex-direction: column;
    }

    .video-wrapper,
    .preview-wrapper {
        flex: 1 1 100%;
        min-width: 0;
    }

    .video-wrapper video {
        min-height: 200px;
        max-height: 350px;
    }

    #preview-container {
        min-height: 150px;
    }

    .search-row {
        flex-direction: column;
    }

    .search-row input {
        width: 100%;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-stats {
        grid-template-columns: 1fr 1fr;
    }

    .modal-content {
        width: 95%;
    }

    .action-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Login Mobile */
    .login-card {
        padding: 28px 20px;
    }
    
    .login-brand h1 {
        font-size: 1.8rem;
    }
    
    .brand-icon {
        font-size: 2.8rem;
        padding: 12px;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
    
    .demo-creds {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .input-wrapper input {
        font-size: 0.95rem;
        padding: 12px 14px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .user-stats {
        grid-template-columns: 1fr;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
    }

    .manual-entry form {
        flex-direction: column;
    }

    .manual-entry input {
        width: 100%;
    }

    /* Login Small */
    .login-card {
        padding: 20px 16px;
    }
    
    .login-brand h1 {
        font-size: 1.5rem;
    }
    
    .brand-icon {
        font-size: 2.2rem;
        padding: 10px;
    }
    
    .login-header h2 {
        font-size: 1.3rem;
    }
}

/* Login Very Small */
@media (max-width: 360px) {
    .login-card {
        padding: 16px 12px;
    }
}

/* Login Landscape */
@media (max-height: 600px) and (orientation: landscape) {
    .login-page {
        align-items: flex-start;
        padding-top: 10px;
    }

    .login-wrapper {
        padding: 5px 0;
    }

    .login-container-modern {
        max-width: 380px;
    }

    .login-card {
        padding: 16px 20px;
        max-height: 85vh;
    }

    .login-brand {
        margin-bottom: 12px;
    }

    .brand-icon {
        font-size: 1.8rem;
        padding: 8px;
        margin-bottom: 6px;
    }

    .login-brand h1 {
        font-size: 1.4rem;
    }

    .brand-subtitle {
        font-size: 0.7rem;
    }

    .login-header {
        margin-bottom: 16px;
    }

    .login-header h2 {
        font-size: 1.2rem;
    }

    .login-header p {
        font-size: 0.8rem;
    }

    .login-form {
        gap: 12px;
    }

    .form-group-modern {
        gap: 4px;
    }

    .form-group-modern label {
        font-size: 0.75rem;
    }

    .input-wrapper input {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .btn-login {
        padding: 10px;
        font-size: 0.85rem;
    }

    .divider {
        margin: 12px 0 8px 0;
    }

    .demo-creds {
        padding: 8px;
        flex-direction: row;
    }

    .login-footer-bottom {
        margin-top: 10px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Firefox scrollbar */
.login-card {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}