/* ============================================================
   نظام إدارة الأسلحة والذخائر - الأنماط الرئيسية
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    --sidebar-w: 265px;
    --sidebar-collapsed-w: 68px;
    --topbar-h: 64px;

    --primary: #1a3a5c;
    --primary-light: #234f7d;
    --primary-dark: #0f2438;
    --accent: #c8963e;
    --accent-light: #dea84a;

    --sidebar-bg: #0c1a28;
    --sidebar-hover: rgba(255,255,255,0.07);
    --sidebar-active-bg: #c8963e;
    --sidebar-text: #b8c5d3;
    --sidebar-text-muted: #5d7285;
    --sidebar-border: rgba(255,255,255,0.07);

    --topbar-bg: #ffffff;
    --page-bg: #f0f2f8;
    --card-bg: #ffffff;
    --card-border: #e8ecf4;
    --text: #1e2a3b;
    --text-muted: #6b7a90;
    --border: #e8ecf4;
    --input-bg: #f5f7fc;

    --green: #15803d;
    --green-bg: #dcfce7;
    --blue: #1d4ed8;
    --blue-bg: #dbeafe;
    --orange: #c2410c;
    --orange-bg: #ffedd5;
    --red: #b91c1c;
    --red-bg: #fee2e2;
    --purple: #6d28d9;
    --purple-bg: #ede9fe;
    --gray: #374151;
    --gray-bg: #f3f4f6;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.09), 0 2px 6px rgba(0,0,0,0.05);
    --shadow-lg: 0 12px 36px rgba(0,0,0,0.13), 0 4px 12px rgba(0,0,0,0.07);
    --radius: 14px;
    --radius-sm: 9px;
    --t: all 0.22s ease;
}

[data-theme="dark"] {
    --topbar-bg: #0c1a28;
    --page-bg: #07111c;
    --card-bg: #0c1a28;
    --card-border: #1a2d42;
    --text: #dde6f0;
    --text-muted: #7a8fa3;
    --border: #1a2d42;
    --input-bg: #132030;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Tajawal', 'Segoe UI', sans-serif;
    background: var(--page-bg);
    color: var(--text);
    direction: rtl;
    overflow-x: hidden;
    font-size: 15px;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ========== الشريط الجانبي ========== */
.sidebar {
    position: fixed;
    top: 0; right: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid var(--sidebar-border);
    transition: width 0.25s ease;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-w); }
.sidebar.collapsed .s-label, .sidebar.collapsed .s-section-title,
.sidebar.collapsed .s-user-info, .sidebar.collapsed .nav-badge,
.sidebar.collapsed .s-logo-text { display: none !important; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 0.7rem 0; }
.sidebar.collapsed .nav-link i { margin: 0 !important; font-size: 1.15rem; }

.s-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.1rem; height: var(--topbar-h);
    background: #09141f;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.s-logo { display: flex; align-items: center; gap: 0.8rem; }
.s-logo-icon {
    width: 38px; height: 38px;
    background: var(--accent);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: white; flex-shrink: 0;
}
.s-logo-text { color: white; font-size: 0.82rem; font-weight: 700; line-height: 1.3; }
.s-logo-text small { display: block; color: var(--accent); font-size: 0.68rem; font-weight: 400; }

.s-toggle-btn {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.06);
    border: none; border-radius: 7px;
    color: var(--sidebar-text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: var(--t); font-size: 0.95rem;
}
.s-toggle-btn:hover { background: rgba(255,255,255,0.12); color: white; }

.s-nav { flex: 1; overflow-y: auto; padding: 0.6rem 0.7rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }
.s-nav::-webkit-scrollbar { width: 3px; }
.s-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.s-section { margin-bottom: 0.25rem; }
.s-section-title {
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--sidebar-text-muted);
    padding: 0.6rem 0.6rem 0.2rem; display: block;
}

.nav-link {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.62rem 0.75rem;
    color: var(--sidebar-text);
    border-radius: 8px;
    transition: var(--t);
    font-size: 0.85rem; font-weight: 500;
    margin-bottom: 1px;
    white-space: nowrap;
}
.nav-link i { width: 18px; text-align: center; color: var(--sidebar-text-muted); font-size: 0.95rem; flex-shrink: 0; transition: var(--t); }
.nav-link:hover { background: var(--sidebar-hover); color: white; }
.nav-link:hover i { color: white; }
.nav-link.active { background: var(--accent); color: white; font-weight: 600; }
.nav-link.active i { color: white; }
.nav-badge { margin-right: auto; margin-left: 0; font-size: 0.65rem; padding: 0.12rem 0.45rem; border-radius: 20px; }

.s-footer {
    padding: 0.9rem 1rem;
    border-top: 1px solid var(--sidebar-border);
    background: #09141f; flex-shrink: 0;
}
.s-user { display: flex; align-items: center; gap: 0.7rem; }
.s-avatar {
    width: 36px; height: 36px; background: var(--primary-light);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.95rem; flex-shrink: 0;
    border: 2px solid var(--accent);
}
.s-user-info { overflow: hidden; min-width: 0; }
.s-user-name { color: white; font-size: 0.8rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-user-role { color: var(--accent); font-size: 0.7rem; }

/* ========== المنطقة الرئيسية ========== */
.main-wrapper { margin-right: var(--sidebar-w); min-height: 100vh; transition: margin 0.25s ease; display: flex; flex-direction: column; }
.main-wrapper.sidebar-collapsed { margin-right: var(--sidebar-collapsed-w); }

/* ========== الشريط العلوي ========== */
.topbar {
    position: sticky; top: 0; z-index: 1040;
    background: var(--topbar-bg); height: var(--topbar-h);
    display: flex; align-items: center; padding: 0 1.5rem; gap: 1rem;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
    transition: background 0.3s;
}
.topbar-start { flex: 1; display: flex; align-items: center; gap: 0.75rem; }
.topbar-end { display: flex; align-items: center; gap: 0.6rem; }
.page-title { font-size: 1.05rem; font-weight: 800; color: var(--text); margin: 0; }
.page-subtitle { font-size: 0.75rem; color: var(--text-muted); margin: 0; }
.topbar-time { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.02em; }
.tb-btn {
    width: 38px; height: 38px; border: 1px solid var(--border);
    background: none; border-radius: 10px; color: var(--text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: var(--t); font-size: 1rem; position: relative;
}
.tb-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.notif-dot { position: absolute; top: 5px; left: 5px; width: 7px; height: 7px; background: var(--red); border-radius: 50%; border: 2px solid var(--topbar-bg); }

/* ========== محتوى الصفحة ========== */
.content { flex: 1; padding: 1.5rem; }

/* ========== البطاقات ========== */
.card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { background: none; border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 0.92rem; font-weight: 700; margin: 0; color: var(--text); }
.card-body { padding: 1.25rem; }
.card-footer { background: var(--input-bg); border-top: 1px solid var(--border); padding: 0.75rem 1.25rem; border-radius: 0 0 var(--radius) var(--radius); }

/* ========== بطاقات الإحصائيات ========== */
.stat-card {
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius); padding: 1.2rem;
    display: flex; align-items: center; gap: 1rem;
    box-shadow: var(--shadow-sm); transition: var(--t);
    position: relative; overflow: hidden;
}
.stat-card::after { content: ''; position: absolute; bottom: 0; right: 0; left: 0; height: 3px; background: var(--sc, var(--primary)); border-radius: 0 0 var(--radius) var(--radius); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.2rem; }
.stat-num { font-size: 1.85rem; font-weight: 800; line-height: 1.1; }
.stat-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ========== الجداول ========== */
.table-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.table { margin: 0; font-size: 0.855rem; }
.table thead th { background: var(--input-bg); color: var(--text-muted); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tbody td { padding: 0.8rem 1rem; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(26,58,92,0.025); }
[data-theme="dark"] .table tbody tr:hover { background: rgba(255,255,255,0.025); }
[data-theme="dark"] .table thead th { background: rgba(255,255,255,0.04); }

/* ========== شارات الحالة ========== */
.badge-status { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.28rem 0.7rem; border-radius: 20px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.badge-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.bs-available { background: var(--green-bg); color: var(--green); }
.bs-issued { background: var(--blue-bg); color: var(--blue); }
.bs-maintenance { background: var(--orange-bg); color: var(--orange); }
.bs-damaged { background: var(--red-bg); color: var(--red); }
.bs-missing { background: #1a0a0a; color: #ff5252; }
.bs-reserved { background: var(--purple-bg); color: var(--purple); }
.bs-active { background: var(--blue-bg); color: var(--blue); }
.bs-overdue { background: var(--red-bg); color: var(--red); }
.bs-completed { background: var(--green-bg); color: var(--green); }
.bs-pending { background: var(--orange-bg); color: var(--orange); }

/* ========== الأزرار ========== */
.btn { font-family: inherit; font-weight: 600; border-radius: var(--radius-sm); transition: var(--t); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-light); border-color: var(--accent-light); color: white; }
.btn-icon { width: 33px; height: 33px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); font-size: 0.82rem; }

/* ========== المدخلات ========== */
.form-control, .form-select { background: var(--input-bg); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); font-family: inherit; transition: var(--t); }
.form-control:focus, .form-select:focus { background: var(--card-bg); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,58,92,0.12); color: var(--text); }
.form-label { font-weight: 700; font-size: 0.83rem; color: var(--text); }
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select { color: var(--text); }
[data-theme="dark"] .form-control:focus, [data-theme="dark"] .form-select:focus { color: var(--text); }

/* ========== المودالات ========== */
.modal-content { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.modal-header { background: var(--primary); color: white; border-radius: var(--radius) var(--radius) 0 0; padding: 1rem 1.5rem; border-bottom: none; }
.modal-title { font-weight: 700; font-size: 0.97rem; }
.modal-header .btn-close { filter: invert(1); opacity: 0.85; }
.modal-body { padding: 1.5rem; }
.modal-footer { border-top: 1px solid var(--border); padding: 0.9rem 1.5rem; background: var(--input-bg); border-radius: 0 0 var(--radius) var(--radius); }

/* ========== Toast ========== */
.toast-container { z-index: 9999; }
.toast { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-family: inherit; min-width: 280px; }
.toast-success { border-right: 4px solid var(--green); }
.toast-warning { border-right: 4px solid var(--orange); }
.toast-danger { border-right: 4px solid var(--red); }
.toast-info { border-right: 4px solid var(--blue); }
.toast-header { background: none; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 0.85rem; }
.toast-body { font-size: 0.83rem; color: var(--text-muted); }

/* ========== Stepper ========== */
.stepper { display: flex; align-items: flex-start; gap: 0; position: relative; margin-bottom: 2rem; }
.stepper-line { flex: 1; height: 2px; background: var(--border); margin-top: 19px; transition: var(--t); }
.stepper-line.done { background: var(--green); }
.step { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; min-width: 60px; }
.step-circle { width: 38px; height: 38px; border-radius: 50%; background: var(--border); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.88rem; transition: var(--t); border: 2px solid var(--border); }
.step.active .step-circle { background: var(--accent); color: white; border-color: var(--accent); }
.step.done .step-circle { background: var(--green); color: white; border-color: var(--green); }
.step-lbl { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); text-align: center; }
.step.active .step-lbl { color: var(--accent); }
.step.done .step-lbl { color: var(--green); }

/* ========== كاميرا محاكاة ========== */
.cam-box { background: #050e17; border-radius: var(--radius); aspect-ratio: 16/9; max-height: 260px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; border: 2px solid var(--accent); }
.scan-frame { width: 55%; height: 55%; border: 2px solid var(--accent); border-radius: 4px; position: relative; }
.scan-frame::before, .scan-frame::after { content: ''; position: absolute; width: 18px; height: 18px; border-color: white; border-style: solid; }
.scan-frame::before { top: -2px; right: -2px; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.scan-frame::after { bottom: -2px; left: -2px; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.scan-line { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--accent); animation: scanY 2s ease-in-out infinite; box-shadow: 0 0 10px var(--accent); }
@keyframes scanY { 0% { top: 0; } 50% { top: 100%; } 100% { top: 0; } }
.cam-label { position: absolute; bottom: 0.75rem; left: 0; right: 0; text-align: center; color: rgba(255,255,255,0.7); font-size: 0.75rem; }

/* ========== بصمة ========== */
.fp-area { width: 120px; height: 160px; background: var(--input-bg); border: 2px dashed var(--border); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; cursor: pointer; transition: var(--t); margin: 0 auto; }
.fp-area:hover { border-color: var(--primary); background: rgba(26,58,92,0.04); }
.fp-area.scanning { border-color: var(--accent); animation: pulseFP 1.2s ease-in-out infinite; }
.fp-area.verified { border-color: var(--green); background: var(--green-bg); }
.fp-icon { font-size: 2.8rem; color: var(--border); transition: var(--t); }
.fp-area:hover .fp-icon { color: var(--primary); }
.fp-area.scanning .fp-icon { color: var(--accent); }
.fp-area.verified .fp-icon { color: var(--green); }
.fp-text { font-size: 0.72rem; color: var(--text-muted); text-align: center; font-weight: 600; }
@keyframes pulseFP { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }

/* ========== جدول زمني ========== */
.timeline { position: relative; padding-right: 1.5rem; }
.timeline::before { content: ''; position: absolute; top: 0; bottom: 0; right: 0.4rem; width: 2px; background: var(--border); border-radius: 2px; }
.tl-item { display: flex; gap: 0.9rem; padding-bottom: 1.1rem; position: relative; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 0.3rem; border: 2px solid var(--card-bg); box-shadow: 0 0 0 2px var(--primary); z-index: 1; position: relative; }
.tl-dot.success { background: var(--green); box-shadow: 0 0 0 2px var(--green); }
.tl-dot.warning { background: var(--orange); box-shadow: 0 0 0 2px var(--orange); }
.tl-dot.danger { background: var(--red); box-shadow: 0 0 0 2px var(--red); }
.tl-content { flex: 1; }
.tl-title { font-size: 0.83rem; font-weight: 700; }
.tl-meta { font-size: 0.73rem; color: var(--text-muted); }

/* ========== صفحة عامة ========== */
.page-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
.page-hdr h1 { font-size: 1.35rem; font-weight: 800; margin: 0; }
.page-hdr p { font-size: 0.78rem; color: var(--text-muted); margin: 0.2rem 0 0; }
.filter-bar { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin-bottom: 1.1rem; display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow-sm); }
.search-wrap { position: relative; flex: 1; min-width: 180px; }
.search-wrap i { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.85rem; }
.search-wrap .form-control { padding-right: 2.2rem; }

/* ========== بطاقة السلاح ========== */
.weapon-hdr { background: linear-gradient(135deg, #0c1a28, #1a3a5c); color: white; padding: 1.5rem; border-radius: var(--radius) var(--radius) 0 0; display: flex; align-items: center; gap: 1.25rem; }
.weapon-img { width: 80px; height: 80px; background: rgba(255,255,255,0.1); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; flex-shrink: 0; }

/* ========== ملف المستفيد ========== */
.profile-hdr { background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: var(--radius); padding: 1.75rem; color: white; margin-bottom: 1.5rem; position: relative; overflow: hidden; }
.profile-hdr::before { content: ''; position: absolute; top: -50px; left: -50px; width: 220px; height: 220px; background: rgba(255,255,255,0.04); border-radius: 50%; }
.profile-avatar { width: 76px; height: 76px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; color: white; border: 3px solid rgba(255,255,255,0.3); flex-shrink: 0; }

/* ========== تقارير ========== */
.rpt-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 1.25rem; cursor: pointer; transition: var(--t); text-align: center; }
.rpt-card:hover { border-color: var(--primary); background: rgba(26,58,92,0.03); transform: translateY(-2px); }
.rpt-card.sel { border-color: var(--accent); background: rgba(200,150,62,0.05); }
.rpt-card i { font-size: 1.8rem; margin-bottom: 0.6rem; }

/* ========== الإشعارات ========== */
.notif-item { display: flex; gap: 0.9rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); transition: var(--t); cursor: pointer; }
.notif-item:hover { background: var(--input-bg); }
.notif-item.unread { background: rgba(26,58,92,0.04); }
[data-theme="dark"] .notif-item.unread { background: rgba(255,255,255,0.03); }
.notif-item:last-child { border-bottom: none; }
.notif-icon-box { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.95rem; }
.n-title { font-size: 0.85rem; font-weight: 700; margin-bottom: 0.2rem; }
.n-msg { font-size: 0.79rem; color: var(--text-muted); line-height: 1.45; }
.n-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.25rem; }
.unread-dot { width: 7px; height: 7px; background: var(--red); border-radius: 50%; flex-shrink: 0; align-self: center; }

/* ========== الصلاحيات ========== */
.role-badge { font-size: 0.72rem; padding: 0.22rem 0.7rem; border-radius: 20px; font-weight: 700; }
.rb-admin { background: rgba(200,150,62,0.15); color: var(--accent); }
.rb-keeper { background: var(--blue-bg); color: var(--blue); }
.rb-auditor { background: var(--green-bg); color: var(--green); }

/* ========== الجرد ========== */
.disc-pos { color: var(--red); font-weight: 700; }
.disc-zero { color: var(--green); font-weight: 700; }
.disc-neg { color: var(--orange); font-weight: 700; }

/* ========== الطباعة ========== */
@media print {
    .sidebar, .topbar, .no-print, .btn, .filter-bar { display: none !important; }
    .main-wrapper { margin-right: 0 !important; }
    .content { padding: 0; }
    body { background: white; color: black; font-size: 12px; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    .stat-card { break-inside: avoid; }
    @page { margin: 1.5cm; }
}

/* ========== التجاوب ========== */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(100%); box-shadow: none; }
    .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-wrapper, .main-wrapper.sidebar-collapsed { margin-right: 0; }
    .s-overlay { display: block !important; }
}
@media (max-width: 767.98px) {
    .content { padding: 1rem; }
    .stat-num { font-size: 1.5rem; }
    .page-hdr { margin-bottom: 1rem; }
}

.s-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 1049; backdrop-filter: blur(3px); }

/* ========== أنيميشن ========== */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.slide-in { animation: slideIn 0.25s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(15px); } to { opacity: 1; transform: translateX(0); } }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== KPI ========== */
.kpi-bar { height: 7px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: 0.35rem; }
.kpi-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }

/* ========== تبديل الثيم ========== */
.theme-switch { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; user-select: none; }
.ts-track { width: 36px; height: 20px; background: var(--border); border-radius: 10px; position: relative; transition: var(--t); }
.ts-track.on { background: var(--primary); }
.ts-knob { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; background: white; border-radius: 50%; transition: var(--t); box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.ts-track.on .ts-knob { right: auto; left: 2px; }

/* ========== صفحة خاصة بالتسليم / الاسترجاع ========== */
.step-panel { display: none; }
.step-panel.active { display: block; animation: fadeIn 0.25s ease; }
.input-method-tabs .btn { border-radius: var(--radius-sm); font-size: 0.83rem; padding: 0.45rem 1rem; }
.weapon-found-card { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: white; border-radius: var(--radius); padding: 1.25rem; }
.condition-btn { border: 2px solid var(--border); background: var(--card-bg); border-radius: var(--radius-sm); padding: 0.7rem 1rem; cursor: pointer; transition: var(--t); text-align: center; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.condition-btn:hover { border-color: var(--primary); color: var(--primary); }
.condition-btn.selected-good { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.condition-btn.selected-clean { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); }
.condition-btn.selected-maint { border-color: var(--orange); background: var(--orange-bg); color: var(--orange); }
.condition-btn.selected-damaged { border-color: var(--red); background: var(--red-bg); color: var(--red); }

/* ========== مؤشر للصفحة الحالية في الشريط الجانبي ========== */
.nav-link.active::before { content: ''; position: absolute; right: -0.7rem; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; background: white; border-radius: 2px; }
.nav-link { position: relative; }
