/* =====================================================
   AttendanceQR - Stylesheet
   ===================================================== */
:root {
    --primary: #1e3a5f;
    --primary-light: #2c5282;
    --secondary: #e2a03f;
    --success: #38a169;
    --danger: #e53e3e;
    --warning: #d69e2e;
    --info: #3182ce;
    --bg: #f7fafc;
    --card-bg: #ffffff;
    --text: #2d3748;
    --text-muted: #718096;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.main-header { background: var(--primary); color: white; border-bottom: 3px solid var(--secondary); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0; }
.header-brand { display: flex; align-items: center; gap: 0.75rem; }
.header-logo { width: 40px; height: 40px; background: var(--secondary); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.header-brand h1 { font-size: 1.25rem; font-weight: 700; }
.header-subtitle { font-size: 0.7rem; opacity: 0.7; }
.header-user { display: flex; align-items: center; gap: 0.75rem; }
.header-user-info { text-align: right; }
.user-name { display: block; font-size: 0.875rem; font-weight: 600; }
.user-role { font-size: 0.7rem; opacity: 0.7; }

/* Tabs */
.tab-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; background: var(--card-bg); padding: 0.25rem; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.tab-link { padding: 0.5rem 1rem; border-radius: 6px; text-decoration: none; color: var(--text-muted); font-size: 0.875rem; font-weight: 500; transition: all 0.2s; display: flex; align-items: center; gap: 0.375rem; }
.tab-link:hover { background: #edf2f7; color: var(--text); }
.tab-link.active { background: var(--primary); color: white; }
.tab-icon { font-size: 1rem; }

/* Cards */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 1.1rem; font-weight: 600; }
.card-body { padding: 1.25rem; }
.mt-4 { margin-top: 1rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.stat-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; display: flex; align-items: center; gap: 1rem; }
.stat-icon { font-size: 2rem; }
.stat-info h3 { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat-info p { font-size: 0.8rem; color: var(--text-muted); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th { background: #f7fafc; padding: 0.75rem; text-align: left; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid var(--border); font-size: 0.8rem; text-transform: uppercase; }
.table td { padding: 0.75rem; border-bottom: 1px solid var(--border); }
.table tr:hover { background: #f7fafc; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 0.8rem; }

/* Badges */
.badge { padding: 0.2rem 0.5rem; border-radius: 12px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.badge-success { background: #c6f6d5; color: #22543d; }
.badge-danger { background: #fed7d7; color: #742a2a; }
.badge-warning { background: #fefcbf; color: #744210; }
.badge-info { background: #bee3f8; color: #2a4365; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; color: var(--text-muted); }
.form-control { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.875rem; transition: border-color 0.2s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,0.1); }
.form-control-sm { padding: 0.375rem 0.5rem; font-size: 0.8rem; }
textarea.form-control { min-height: 80px; resize: vertical; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.5rem 1rem; border: 1px solid transparent; border-radius: 6px; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: #edf2f7; }
.btn-ghost { background: transparent; color: inherit; }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-close { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--text-muted); }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.flex-gap { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* Modals */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 90%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.modal-lg { max-width: 800px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1.25rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); }

/* QR */
.qr-display { display: inline-block; padding: 1rem; border: 2px solid var(--border); border-radius: var(--radius); }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.875rem; }
.alert-success { background: #c6f6d5; color: #22543d; border: 1px solid #9ae6b4; }
.alert-error { background: #fed7d7; color: #742a2a; border: 1px solid #feb2b2; }

/* Info Box */
.info-box { background: #edf2f7; border-radius: 6px; padding: 1rem; }
.info-box ol { padding-left: 1.25rem; margin-top: 0.5rem; }
.info-box li { margin-bottom: 0.25rem; }

/* Utilities */
.bg-light { background: #f7fafc; }
.rounded { border-radius: var(--radius); }
.p-3 { padding: 0.75rem; }
.font-medium { font-weight: 500; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--primary) 0%, #2c5282 100%); }
.login-container { width: 90%; max-width: 400px; }
.login-card { background: var(--card-bg); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 2rem; }
.login-header { text-align: center; margin-bottom: 1.5rem; }
.login-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.login-header h1 { font-size: 1.5rem; color: var(--primary); }
.login-header p { font-size: 0.8rem; color: var(--text-muted); }
.login-form .form-group { margin-bottom: 1.25rem; }
.login-form .btn { padding: 0.75rem; font-size: 1rem; }

/* Toast */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 2000; }
.toast { padding: 0.75rem 1rem; border-radius: 6px; color: white; font-size: 0.875rem; margin-bottom: 0.5rem; animation: slideIn 0.3s ease; min-width: 250px; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.main-content { padding: 1.5rem 0; }

/* Responsive */
@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .table { display: block; overflow-x: auto; }
    .flex-between { flex-direction: column; align-items: flex-start; }
    .header-user-info { display: none; }
}
