/* ==========================================================
   SISTEM GERBANG ASRAMA - MAIN STYLESHEET
   Clean, Minimal, Modern, Professional Aesthetic
   ========================================================== */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --success: #10b981;
    --success-light: #ecfdf5;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --info: #0ea5e9;
    --info-light: #f0f9ff;
    --dark: #0f172a;
    --secondary: #64748b;
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

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

/* Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    transition: transform 0.25s ease;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
    background-color: var(--bg-body);
}

/* Sidebar Elements */
.sidebar-brand {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--secondary);
    font-weight: 500;
}

.sidebar-nav {
    padding: 1rem 0.75rem;
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.sidebar-nav .nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding: 0.75rem 0.75rem 0.25rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.85rem;
    color: #475569;
    font-weight: 500;
    font-size: 0.925rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    text-decoration: none;
}

.sidebar-nav .nav-link i {
    font-size: 1.15rem;
    color: #64748b;
    transition: color 0.15s ease;
}

.sidebar-nav .nav-link:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

.sidebar-nav .nav-link:hover i {
    color: var(--primary);
}

.sidebar-nav .nav-link.active {
    color: var(--primary);
    background-color: var(--primary-light);
    font-weight: 600;
}

.sidebar-nav .nav-link.active i {
    color: var(--primary);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Navbar Top */
.top-navbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.live-clock-badge {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Card Modern Style */
.card-clean {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-clean:hover {
    box-shadow: var(--shadow-md);
}

/* Stat Cards */
.stat-card {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-icon-primary { background: var(--primary-light); color: var(--primary); }
.stat-icon-success { background: var(--success-light); color: var(--success); }
.stat-icon-danger { background: var(--danger-light); color: var(--danger); }
.stat-icon-warning { background: var(--warning-light); color: var(--warning); }
.stat-icon-info { background: var(--info-light); color: var(--info); }

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
    margin-top: 0.5rem;
}

.stat-label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Gate Scan Terminal Page Styles */
.gate-kiosk-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.gate-mode-btn {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.gate-mode-btn i {
    font-size: 2rem;
}

.gate-mode-btn.mode-masuk {
    border-color: #d1fae5;
    color: #065f46;
}
.gate-mode-btn.mode-masuk:hover,
.gate-mode-btn.mode-masuk.active {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.25);
    transform: translateY(-2px);
}

.gate-mode-btn.mode-keluar {
    border-color: #fee2e2;
    color: #991b1b;
}
.gate-mode-btn.mode-keluar:hover,
.gate-mode-btn.mode-keluar.active {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.25);
    transform: translateY(-2px);
}

.barcode-input-lg {
    font-size: 1.5rem !important;
    letter-spacing: 0.1em;
    font-weight: 700;
    text-align: center;
    border-radius: var(--radius-md) !important;
    padding: 0.85rem 1.25rem !important;
    border: 2px solid var(--border-color) !important;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.barcode-input-lg:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15) !important;
}

/* Result Identification Card */
.resident-result-card {
    border-radius: var(--radius-lg);
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.resident-avatar-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffffff;
    box-shadow: var(--shadow-md);
}

/* Status Badges */
.badge-status {
    padding: 0.4em 0.75em;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-status-dalam {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-status-luar {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badge-transaksi-masuk {
    background-color: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.badge-transaksi-keluar {
    background-color: #ffe4e6;
    color: #be123c;
    border: 1px solid #fecdd3;
}

/* Table Modern */
.table-clean {
    margin-bottom: 0;
}
.table-clean thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
.table-clean tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: #334155;
}
.table-clean tbody tr:last-child td {
    border-bottom: none;
}
.table-clean tbody tr:hover td {
    background-color: #f8fafc;
}

/* Quick Demo Chips */
.quick-chip {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.quick-chip:hover {
    background-color: var(--primary-light);
    border-color: #c7d2fe;
    color: var(--primary);
    transform: translateY(-1px);
}

/* Printable ID Card */
.id-card-print {
    width: 320px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    overflow: hidden;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.id-card-header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff;
    padding: 12px;
    text-align: center;
}
.id-card-body {
    padding: 16px;
    text-align: center;
}

/* Responsive sidebar drawer */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(2px);
        z-index: 1025;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

/* Print Styles */
@media print {
    .sidebar, .top-navbar, .no-print, .btn, .breadcrumb, .pagination {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }
    .card-clean {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
