@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    --gradient: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
    --gradient-leave: linear-gradient(135deg, #0ea5e9, #0284c7);
    --sidebar-width: 260px;
    --bg-body: #f0f2f5;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

* {
    font-family: 'Tajawal', sans-serif;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    background-color: var(--bg-body);
    color: #1f2937;
    direction: rtl;
    overflow-x: hidden;
    max-width: 100%;
}

/* ==================== أنيميشنز مشتركة ==================== */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes checkmarkStroke {
    100% { stroke-dashoffset: 0; }
}
@keyframes confettiFall {
    0% { top: -5%; opacity: 1; transform: rotate(0deg) scale(1); }
    100% { top: 105%; opacity: 0; transform: rotate(720deg) scale(0.5); }
}
@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes staggerFade {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
.skeleton-card {
    height: 72px;
    border-radius: 14px;
    margin-bottom: 10px;
}
.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.skeleton-text {
    height: 14px;
    border-radius: 6px;
    width: 60%;
}
.skeleton-text.short { width: 40%; }

/* SVG Checkmark */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
}
.success-checkmark .checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: var(--success);
    fill: none;
    animation: checkmarkStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.success-checkmark .checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: var(--success);
    stroke-width: 3;
    stroke-linecap: round;
    fill: none;
    animation: checkmarkStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

/* Confetti */
.confetti-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}
.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confettiFall var(--duration, 2s) var(--delay, 0s) ease-out forwards;
    left: var(--x, 50%);
    opacity: 0.9;
}

/* Stagger animation helper */
.stagger-item {
    animation: staggerFade 0.4s ease forwards;
    opacity: 0;
}

/* ==================== الصفحات العامة ==================== */
.public-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
body:has(.public-page) {
    background: var(--gradient);
}

.public-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 750px;
    width: 100%;
    overflow: hidden;
    animation: scaleIn 0.4s ease;
}

.public-card-header {
    background: var(--gradient);
    color: #fff;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.public-card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.public-card-header h2 {
    font-weight: 800;
    margin-bottom: 5px;
    position: relative;
}

.public-card-header p {
    position: relative;
}

.public-card-body {
    padding: 30px;
}

/* ==================== معالج الحجز ==================== */
.wizard-steps {
    display: flex;
    direction: ltr;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 4px;
    margin-bottom: 30px;
    padding: 0 10px;
}

.wizard-step-indicator {
    flex: 1;
    text-align: center;
    position: relative;
}

.wizard-step-indicator .step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.wizard-step-indicator.active .step-circle {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    animation: pulseGlow 2s infinite;
}

.wizard-step-indicator.done .step-circle {
    background: var(--success);
    color: #fff;
    transform: scale(1);
}
.wizard-step-indicator.done .step-circle::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 13px;
}
.wizard-step-indicator.done .step-number {
    display: none;
}

.wizard-step-indicator .step-label {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    transition: all 0.3s ease;
}

.wizard-step-indicator.active .step-label {
    color: var(--primary);
    font-weight: 700;
}
.wizard-step-indicator.done .step-label {
    color: var(--success);
    font-weight: 600;
}

.wizard-step-line {
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: #e5e7eb;
    z-index: 0;
    transition: background 0.4s ease;
}

.wizard-step-indicator.done .wizard-step-line,
.wizard-step-indicator.active .wizard-step-line {
    background: var(--primary);
}

.wizard-content {
    display: none;
}

.wizard-content.active {
    display: block;
}
.wizard-content.slide-forward {
    animation: slideInLeft 0.35s ease forwards;
}
.wizard-content.slide-backward {
    animation: slideInRight 0.35s ease forwards;
}
.wizard-content.fade-in {
    animation: fadeSlideUp 0.35s ease both;
}

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

/* ==================== بطاقات أسباب الزيارة ==================== */
.reason-card {
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: 15px 20px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.reason-card:hover {
    border-color: var(--primary-light);
    background: #eff6ff;
    transform: translateX(-3px);
}

.reason-card:active {
    transform: scale(0.98);
}

.reason-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #eff6ff, #e8f0fe);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.reason-card .reason-radio {
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.reason-card.selected .reason-radio {
    border-color: var(--primary);
    background: var(--primary);
    transform: scale(1.1);
}

.reason-card.selected .reason-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.reason-card .reason-name {
    font-size: 16px;
    font-weight: 500;
}

/* ==================== بطاقة الموعد ==================== */
.visit-card-print {
    border: 2px dashed #d1d5db;
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    background: linear-gradient(135deg, #fafafa, #f5f5f5);
    animation: fadeSlideUp 0.5s ease;
}

.visit-card-print .qr-container {
    display: inline-block;
    padding: 15px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    animation: scaleIn 0.5s 0.2s ease both;
}

.visit-card-print .visit-info {
    text-align: right;
}

.visit-card-print .visit-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

.visit-card-print .visit-info .info-row:hover {
    background: #f9fafb;
    border-radius: 8px;
    padding-right: 8px;
    padding-left: 8px;
}

.visit-card-print .visit-info .info-row:last-child {
    border-bottom: none;
}

.visit-card-print .info-label {
    color: #6b7280;
    font-weight: 500;
}

.visit-card-print .info-value {
    font-weight: 700;
    color: #1f2937;
}

/* ==================== لوحة التحكم - السايدبار ==================== */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: rgb(70, 132, 162);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sidebar-header h4 {
    color: #fff;
    font-weight: 800;
    margin: 0;
    font-size: 20px;
}

.sidebar-header small {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-right-color: #fff;
}

.sidebar-menu li a i {
    width: 22px;
    text-align: center;
    font-size: 16px;
}

.sidebar-menu li.sidebar-section {
    color: rgba(255,255,255,.4);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 16px 25px 6px;
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: 4px;
}
.sidebar-menu li.sidebar-section:first-of-type {
    border-top: none;
    margin-top: 0;
}

/* ==================== المحتوى الرئيسي ==================== */
.main-content {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
}

.top-navbar {
    background: #fff;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-navbar h5 {
    margin: 0;
    font-weight: 700;
    color: #1f2937;
}

.page-content {
    padding: 25px 30px;
}

/* ==================== البطاقات الإحصائية ==================== */
.stat-card {
    border-radius: 16px;
    padding: 25px;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card .stat-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    opacity: 0.2;
}

.stat-card .stat-number {
    font-size: 32px;
    font-weight: 800;
}

.stat-card .stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
}

.stat-card.blue { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.stat-card.green { background: linear-gradient(135deg, #059669, #10b981); }
.stat-card.orange { background: linear-gradient(135deg, #d97706, #f59e0b); }
.stat-card.red { background: linear-gradient(135deg, #dc2626, #ef4444); }
.stat-card.cyan { background: linear-gradient(135deg, #0891b2, #06b6d4); }

/* ==================== الجداول ==================== */
.table-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    overflow: hidden;
}

.table-card .card-header-custom {
    padding: 20px 25px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-card .card-header-custom h6 {
    margin: 0;
    font-weight: 700;
    font-size: 16px;
}

.table-responsive { padding: 0; }

.table thead th {
    background: #f9fafb;
    border: none;
    font-weight: 700;
    font-size: 13px;
    color: #6b7280;
    padding: 12px 15px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-color: #f3f4f6;
    font-size: 14px;
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* ==================== الأزرار ==================== */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 10px 25px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}
.btn-success:active {
    transform: translateY(0);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}
.btn-outline-primary:active {
    transform: translateY(0);
}

/* ==================== حقول الإدخال ==================== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 2px solid #e5e7eb;
    padding: 10px 15px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

/* Enhanced NID/Phone input */
.nid-input-wrapper {
    position: relative;
}
.nid-input-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}
.nid-input-wrapper:focus-within::after {
    width: 80%;
}

/* ==================== التنبيهات ==================== */
.alert {
    border-radius: 12px;
    border: none;
    font-weight: 500;
}

/* ==================== صفحة المسح ==================== */
.scan-page {
    min-height: 100vh;
    background: var(--bg-body);
    padding: 30px 20px;
}

.scan-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 0 auto;
    overflow: hidden;
}

.scan-card-header {
    background: var(--gradient);
    color: #fff;
    padding: 25px;
    text-align: center;
}

.scan-card-body {
    padding: 25px;
}

#reader {
    border-radius: 12px;
    overflow: hidden;
}

/* ==================== صفحة تسجيل الدخول ==================== */
.login-page {
    min-height: 100vh;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-width: 420px;
    width: 100%;
    padding: 40px;
}

.login-card h3 {
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 30px;
    text-align: center;
}

/* ==================== الطباعة ==================== */
@media print {
    .no-print, .sidebar, .top-navbar, .btn { display: none !important; }
    .main-content { margin: 0 !important; }
    .page-content { padding: 0 !important; }
    .stat-card { break-inside: avoid; }
    body { background: #fff !important; }
}

/* ==================== بطاقة الموعد المستقلة ==================== */
.visit-card-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.visit-card-standalone {
    background: #fff;
    border-radius: var(--radius-lg);
    max-width: 460px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: scaleIn 0.4s ease;
}
.visit-card-standalone .vc-header {
    background: var(--gradient);
    color: #fff;
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.visit-card-standalone .vc-back-home {
    position: absolute; top: 14px; right: 14px; z-index: 6;
    width: 42px; height: 42px; border-radius: 13px;
    background: rgba(255,255,255,.18); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 17px; text-decoration: none; transition: background .2s, transform .12s;
}
.visit-card-standalone .vc-back-home:active { background: rgba(255,255,255,.34); transform: scale(.93); }
@media print { .visit-card-standalone .vc-back-home { display: none !important; } }
.visit-card-standalone .vc-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}
.visit-card-standalone .vc-header .vc-dept {
    opacity: 0.85;
    font-size: 13px;
    margin-bottom: 4px;
    position: relative;
}
.visit-card-standalone .vc-header h2 {
    font-weight: 800;
    font-size: 20px;
    margin-bottom: 4px;
    position: relative;
}
.visit-card-standalone .vc-header .vc-subtitle {
    opacity: 0.9;
    font-size: 14px;
    position: relative;
}
.visit-card-standalone .vc-body {
    padding: 24px;
}
.visit-card-standalone .vc-qr {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #fafafa, #f5f5f5);
    border-radius: 16px;
    border: 2px dashed #e5e7eb;
    animation: fadeSlideUp 0.5s 0.2s ease both;
}
.visit-card-standalone .vc-qr #qrcode {
    display: inline-block;
}
.visit-card-standalone .vc-info-table {
    width: 100%;
    animation: fadeSlideUp 0.5s 0.3s ease both;
}
.visit-card-standalone .vc-info-table tr td {
    padding: 10px 6px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    vertical-align: middle;
}
.visit-card-standalone .vc-info-table tr:last-child td {
    border-bottom: none;
}
.visit-card-standalone .vc-info-table .vc-label {
    color: #6b7280;
    font-weight: 500;
    width: 35%;
    white-space: nowrap;
}
.visit-card-standalone .vc-info-table .vc-label i {
    width: 18px;
    text-align: center;
    margin-left: 6px;
    color: #9ca3af;
    font-size: 13px;
}
.visit-card-standalone .vc-info-table .vc-value {
    font-weight: 700;
    color: #1f2937;
}
.visit-card-standalone .vc-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}
.vc-status-محجوز { background: #fef3c7; color: #92400e; }
.vc-status-حاضر { background: #d1fae5; color: #065f46; }
.vc-status-ملغي { background: #fee2e2; color: #991b1b; }

.visit-card-standalone .vc-section {
    padding: 0 24px 16px;
}
.visit-card-standalone .vc-section-card {
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    margin-bottom: 10px;
    animation: fadeSlideUp 0.4s ease both;
}
.visit-card-standalone .vc-section-card .vc-sec-icon {
    font-size: 28px;
    margin-bottom: 8px;
}
.visit-card-standalone .vc-section-card .vc-sec-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}
.visit-card-standalone .vc-section-card .vc-sec-sub {
    font-size: 12px;
    opacity: 0.85;
}

.visit-card-standalone .vc-actions {
    padding: 16px 24px 24px;
    display: flex;
    gap: 10px;
}
.visit-card-standalone .vc-actions .vc-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.visit-card-standalone .vc-btn:hover {
    transform: translateY(-2px);
}
.visit-card-standalone .vc-btn:active {
    transform: translateY(0);
}
.visit-card-standalone .vc-btn-print {
    background: var(--success);
    color: #fff;
    box-shadow: 0 4px 12px rgba(5,150,105,0.3);
}

/* زر تسجيل الوصول — زر رئيسي بارز */
#btn-checkin {
    width: 100%;
    max-width: 520px;
    border: none;
    border-radius: 18px;
    padding: 15px 18px;
    margin: 0;
    font-family: 'Tajawal', sans-serif;
    color: #fff;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 14px 30px -10px rgba(16,185,129,.65);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
#btn-checkin .vc-checkin-ic {
    width: 42px; height: 42px; flex: none;
    border-radius: 13px;
    background: rgba(255,255,255,.22);
    display: flex; align-items: center; justify-content: center;
    font-size: 19px;
}
#btn-checkin .vc-checkin-tx {
    display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; text-align: right;
}
#btn-checkin .vc-checkin-tx b { font-size: 16px; font-weight: 800; }
#btn-checkin .vc-checkin-tx small { font-size: 11.5px; font-weight: 600; opacity: .9; }
#btn-checkin:hover { transform: translateY(-1px); box-shadow: 0 18px 34px -10px rgba(16,185,129,.7); filter: brightness(1.03); }
#btn-checkin:active { transform: translateY(1px) scale(.99); box-shadow: 0 8px 18px -8px rgba(16,185,129,.6); }
#btn-checkin:disabled { opacity: .7; cursor: default; }
.visit-card-standalone .vc-btn-back {
    background: #f3f4f6;
    color: #374151;
}
.visit-card-standalone .vc-btn-leave {
    background: var(--gradient-leave);
    color: #fff;
    box-shadow: 0 4px 12px rgba(14,165,233,0.3);
}

@media (max-width: 768px) {
    .visit-card-page {
        padding: 0;
        align-items: stretch;
    }
    .visit-card-standalone {
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
    }
}
@media print {
    .visit-card-page { background: #fff; padding: 0; }
    .visit-card-standalone { box-shadow: none; max-width: 100%; animation: none; }
    .visit-card-standalone .vc-actions,
    .visit-card-standalone .vc-section { display: none; }
}

/* ==================== التجاوب مع الجوال ==================== */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #374151;
    cursor: pointer;
}

@media (max-width: 992px) {
    .sidebar {
        right: -280px !important;
    }
    .sidebar.show {
        right: 0 !important;
    }
    .main-content {
        margin-right: 0;
    }
    .sidebar-toggle {
        display: block;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        touch-action: none;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .page-content {
        padding: 15px;
    }
    .top-navbar {
        padding: 12px 15px;
    }
    .public-card-body {
        padding: 20px;
    }
    .public-page,
    .login-page,
    .scan-page {
        align-items: flex-start;
        padding-top: 30px;
        min-height: 0;
        height: auto;
    }
}

@media (max-width: 768px) {
    .public-page {
        padding: 0;
        align-items: stretch;
    }
    .public-card {
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
    }
    /* بطاقة القلب (front/back) عنصر flex — نجبرها على ملء العرض حتى لا يبقى فراغ جانبي */
    .booking-flip-card,
    .booking-flip-inner,
    .booking-flip-front,
    .booking-flip-back {
        width: 100%;
    }
    .public-card-header {
        padding: 20px;
    }
    .public-card-body {
        padding: 16px;
    }
    .wizard-steps {
        padding: 0;
    }
    .wizard-step-indicator .step-label {
        font-size: 10px;
    }
    .stat-card .stat-number {
        font-size: 24px;
    }
}

/* ===== نافذة تأكيد الوصول المشتركة (arrival check-in) — نُقلت من visit_card بلا تغيير قيم ===== */
.ac-overlay{position:fixed;inset:0;z-index:2000;background:rgba(15,23,42,.55);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);display:flex;align-items:flex-end;justify-content:center;opacity:0;pointer-events:none;transition:opacity .25s;}
.ac-overlay.show{opacity:1;pointer-events:auto;}
.ac-box{background:#fff;width:100%;max-width:460px;border-radius:24px 24px 0 0;padding:26px 22px calc(26px + env(safe-area-inset-bottom));text-align:center;transform:translateY(20px);transition:transform .28s cubic-bezier(.34,1.3,.64,1);box-shadow:0 -10px 40px rgba(0,0,0,.25);}
.ac-overlay.show .ac-box{transform:translateY(0);}
.ac-ic{width:70px;height:70px;border-radius:22px;margin:0 auto 14px;display:flex;align-items:center;justify-content:center;font-size:30px;color:#fff;background:linear-gradient(135deg,#10b981,#059669);box-shadow:0 12px 26px -8px rgba(16,185,129,.6);}
.ac-title{font-size:20px;font-weight:800;color:#0f172a;margin-bottom:6px;}
.ac-sub{font-size:13px;color:#64748b;margin-bottom:22px;line-height:1.6;}
.ac-btns{display:flex;gap:12px;}
.ac-btns button,.ac-btns a{flex:1;border:none;border-radius:15px;padding:15px;font-family:'Tajawal',sans-serif;font-size:16px;font-weight:800;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;transition:transform .12s;text-decoration:none;box-sizing:border-box;}
.ac-btns button:active,.ac-btns a:active{transform:scale(.97);}
.ac-yes{background:linear-gradient(135deg,#10b981,#059669);color:#fff;box-shadow:0 10px 22px -8px rgba(16,185,129,.6);}
.ac-no{background:#f1f5f9;color:#475569;}
/* ===== ثيم اليوم الوطني — خلفية الهيدر علم المملكة + الأخضر السعودي للقائمة والأزرار والأيقونات ===== */
.nat-week{--primary:#006C35;--primary-light:#0a8a45;--primary-dark:#00401f}
.nat-week .public-card-header{background:url("../img/ksa-emblem.svg") 0 0/46px 50px repeat, linear-gradient(135deg,#006C35,#00401f)!important}
/* تخضير أيقونات وأزرار صفحة ولي الأمر خلال أسبوع اليوم الوطني */
.nat-week .stu-av{background:linear-gradient(135deg,#006C35,#00401f)!important;color:#fff!important}
.nat-week .stu-av i{color:#fff!important}
.nat-week .stu-primary{background:#006C35!important;box-shadow:0 12px 26px -12px rgba(0,108,53,.55)!important}
.nat-week .stu-svc-ic{background:#d1fae5!important;color:#006C35!important}
.nat-week .bk-oic{background:#ecfdf5!important;color:#006C35!important}
.nat-week .bk-opt.sel{border-color:#006C35!important;background:#ecfdf5!important}
.nat-week .bk-opt.sel .bk-chk{background:#006C35!important;border-color:#006C35!important}
.nat-week .bk-cta{background:#006C35!important}
.nat-week .bk-cta.ghost{background:#f1f5f9!important;color:#475569!important}
.nat-week .entry-btn.active,.nat-week .rel-btn.active{border-color:#006C35!important;background:linear-gradient(135deg,#ecfdf5,#d1fae5)!important;color:#006C35!important}
.nat-week .entry-btn.active i,.nat-week .rel-btn.active i,.nat-week .entry-btn:hover i,.nat-week .rel-btn:hover i{color:#006C35!important}
.nat-week .bs-hero-icon,.nat-week [class*="bs-"][class*="-icon"]{background:linear-gradient(135deg,#006C35,#00401f)!important}
.nat-week .bs-school-card:active,.nat-week .bs-svc-card:active,.nat-week .bs-student-card:active{border-color:#006C35!important}
.nat-week .stu-svc{border-color:#bbf7d0}
.nat-week .pm-search-btn{background:linear-gradient(135deg,#006C35,#00401f)!important;box-shadow:0 4px 15px rgba(0,108,53,.35)!important}
.nat-week .bs-school-card .sc-icon{background:linear-gradient(135deg,#d1fae5,#a7f3d0)!important;color:#006C35!important}
.nat-week .bs-school-card .sc-count{background:#d1fae5!important;color:#065f46!important}
.nat-week .bs-school-card:active,.nat-week .bs-school-card:active::before{border-color:#006C35!important}
.nat-week .bs-svc-card:active,.nat-week .bs-student-card:active{border-color:#006C35!important}
.nat-week .bs-student-icon{background:linear-gradient(135deg,#d1fae5,#a7f3d0)!important;color:#006C35!important}
.nat-week .bs-student-card:active{border-color:#006C35!important;box-shadow:0 4px 16px rgba(0,108,53,.15)!important}
.nat-week .bs-hero-icon i{color:#fff!important}
.nat-week .bs-student-icon i{color:#fff!important}
