/**
 * School Visitor Management System - Main Styles
 */

:root {
    --sidebar-width: 260px;
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f1f5f9;
    min-height: 100vh;
}

/* Auth Pages */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-wrapper { width: 100%; max-width: 420px; }

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

/* Layout */
.wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-gatekeeper { background: #065f46; }

.sidebar-header {
    padding: 1.25rem;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-nav { padding: 1rem 0; }

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-gatekeeper .nav-link:hover,
.sidebar-gatekeeper .nav-link.active {
    background: #047857;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-navbar { padding: 0.75rem 1.5rem; }

.content-area { flex: 1; }

.avatar-sm {
    width: 36px;
    height: 36px;
    object-fit: cover;
}

/* Stat Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stat-card .card-body { padding: 1.25rem; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat-label { color: #64748b; font-size: 0.875rem; }

/* Quick Actions */
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 2px solid #e2e8f0;
    transition: all 0.2s;
    height: 100%;
}

.quick-action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.quick-action-btn i { font-size: 2rem; margin-bottom: 0.5rem; }

/* Tables */
.table-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.visitor-photo-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.badge-checked-in { background: #dcfce7; color: #166534; }
.badge-checked-out { background: #fee2e2; color: #991b1b; }

/* Visitor Pass */
.visitor-pass {
    width: 350px;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 1rem;
    margin: 0 auto;
    background: #fff;
}

.visitor-pass .pass-header {
    text-align: center;
    border-bottom: 2px dashed #ccc;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.visitor-pass .pass-photo {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #ddd;
}

.visitor-pass .pass-qr { width: 80px; height: 80px; }

/* Camera capture */
.camera-preview {
    width: 100%;
    max-width: 320px;
    border-radius: 8px;
    background: #000;
}

.photo-capture-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

/* Chart container */
.chart-container {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Profile */
.profile-photo-lg {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .stat-value { font-size: 1.5rem; }
}

@media print {
    body * { visibility: hidden; }
    .visitor-pass, .visitor-pass * { visibility: visible; }
    .visitor-pass {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .no-print { display: none !important; }
}

/* Form enhancements */
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-card {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
