/**
 * Hadirin - Custom Design System & Global Styles
 */

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --card-border: #e2e8f0;
    --body-bg: #f8fafc;
}

body {
    background-color: var(--body-bg);
    color: #334155;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

/* Navbar / Header */
.navbar-custom {
    background: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 0.75rem 1.5rem;
}

.brand-logo {
    font-weight: 700;
    font-size: 1.35rem;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}
.brand-logo span.badge-role {
    font-size: 0.75rem;
    font-weight: 600;
    vertical-align: middle;
}

/* Card Styling */
.card-custom {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card-custom:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}
.card-custom .card-header {
    background: transparent;
    border-bottom: 1px solid var(--card-border);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* Metric / Stat Card */
.stat-card {
    border-radius: 0.75rem;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.stat-icon.blue { background-color: #dbeafe; color: #2563eb; }
.stat-icon.green { background-color: #d1fae5; color: #059669; }
.stat-icon.amber { background-color: #fef3c7; color: #d97706; }
.stat-icon.red { background-color: #fee2e2; color: #dc2626; }
.stat-icon.purple { background-color: #f3e8ff; color: #7e22ce; }

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
}
.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.15rem;
}

/* Face Camera / Attendance Container */
.attendance-camera-box {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 1rem;
    overflow: hidden;
    background: #000000;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
    aspect-ratio: 4/3;
}
.attendance-camera-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror camera for natural selfie experience */
}
.attendance-camera-box canvas.face-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform: scaleX(-1); /* Mirror overlay to match video */
}
.face-status-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Map Containers */
.leaflet-map-picker {
    height: 320px;
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
}
.custom-pin-marker {
    background: transparent !important;
    border: none !important;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Table Styling */
.table thead th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-bottom: 1px solid var(--card-border);
}
.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Badges */
.badge-soft-success { background-color: #d1fae5; color: #065f46; font-weight: 600; }
.badge-soft-warning { background-color: #fef3c7; color: #92400e; font-weight: 600; }
.badge-soft-danger { background-color: #fee2e2; color: #991b1b; font-weight: 600; }
.badge-soft-info { background-color: #e0f2fe; color: #075985; font-weight: 600; }
.badge-soft-secondary { background-color: #f1f5f9; color: #475569; font-weight: 600; }

/* Responsive navigation sidebar */
@media (min-width: 992px) {
    .app-sidebar {
        width: 260px;
        min-height: calc(100vh - 65px);
        background: #ffffff;
        border-right: 1px solid var(--card-border);
    }
    .app-content {
        flex: 1;
        padding: 1.5rem;
    }
}
@media (max-width: 991.98px) {
    .app-content {
        padding: 1rem;
    }
}
