/* =========================================================================
   نظام إدارة المؤسسات - Professional Theme (RTL)
   Bootstrap 5 RTL + Cairo / Tajawal
   ========================================================================= */

:root {
    /* Brand */
    --primary-900: #0b1437;
    --primary-800: #111c44;
    --primary-700: #1a1a2e;
    --primary-600: #16213e;
    --primary-500: #0f3460;
    --accent-color: #e94560;
    --accent-hover: #d63850;
    --accent-secondary: #0f3460;
    --primary-gradient: linear-gradient(160deg, #0b1437 0%, #16213e 50%, #1a3168 100%);

    /* Surfaces */
    --bg-page: #f4f7fe;
    --card-bg: #ffffff;
    --border-color: rgba(11, 20, 55, 0.08);
    --border-strong: rgba(11, 20, 55, 0.16);

    /* Text */
    --text-primary: #1a1a2e;
    --text-secondary: #707eae;
    --text-muted: #a3aed0;

    /* Status */
    --success: #28a745;
    --success-bg: rgba(40, 167, 69, 0.10);
    --warning: #d39e00;
    --warning-bg: rgba(255, 193, 7, 0.15);
    --danger: var(--accent-color);
    --danger-bg: rgba(233, 69, 96, 0.10);

    /* Shadows */
    --shadow-soft: 0 4px 20px rgba(11, 20, 55, 0.05);
    --shadow-medium: 0 8px 40px rgba(11, 20, 55, 0.08);
    --shadow-deep: 0 14px 60px rgba(11, 20, 55, 0.12);

    /* Layout */
    --sidebar-width: 280px;
    --header-height: 80px;

    /* Animation */
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(11,20,55,.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(11,20,55,.3); }

/* =====================================================================
   LOGIN
   ===================================================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-gradient);
    position: relative; overflow: hidden;
}
.login-wrapper::before, .login-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.login-wrapper::before {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(233,69,96,.18) 0%, transparent 70%);
    top: -200px; right: -200px;
    animation: pulse 8s ease-in-out infinite;
}
.login-wrapper::after {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(15,52,96,.25) 0%, transparent 70%);
    bottom: -120px; left: -120px;
    animation: pulse 10s ease-in-out infinite reverse;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity:.5;} 50% { transform: scale(1.1); opacity:.8;} }

.login-card {
    position: relative; z-index: 10;
    background: rgba(255,255,255,0.98);
    border-radius: 24px;
    padding: 50px 45px;
    width: 100%; max-width: 460px;
    box-shadow: var(--shadow-deep);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
}
.login-logo {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, var(--accent-color), #ff6b85);
    border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 28px;
    box-shadow: 0 12px 30px rgba(233,69,96,.35);
}
.login-logo i { font-size: 38px; color: #fff; }
.login-title { font-size: 26px; font-weight: 700; text-align: center; margin: 0 0 8px; color: var(--primary-900); }
.login-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 36px; font-size: 14px; }

.btn-primary-custom {
    background: var(--accent-color);
    border: none; border-radius: 12px;
    padding: 14px 32px; color: #fff;
    font-weight: 600; font-size: 16px;
    width: 100%;
    transition: var(--transition-smooth);
    cursor: pointer;
}
.btn-primary-custom:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(233,69,96,.4);
    color: #fff;
}

/* =====================================================================
   APP LAYOUT
   ===================================================================== */
.app-wrapper { min-height: 100vh; }

/* ============== Sidebar ============== */
.sidebar {
    position: fixed;
    top: 0; right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    background: var(--primary-gradient);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 16px 12px 12px;
    transition: transform 0.3s ease;
    box-shadow: -2px 0 30px rgba(11,20,55,.1);
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 6px 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 10px;
    flex-shrink: 0;
}
.sidebar-brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent-color), #ff6b85);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(233,69,96,.35);
}
.sidebar-brand-icon i { font-size: 20px; color: #fff; }
.sidebar-brand-text {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}
.sidebar-brand-sub {
    font-size: 10px;
    color: rgba(255,255,255,.5);
    margin-top: 2px;
    letter-spacing: 0.5px;
}

.sidebar-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 4px;
    margin: 0 -4px;
}
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }

.sidebar-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,.35);
    padding: 0 12px;
    margin: 8px 0 6px;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-menu-item { margin-bottom: 2px; }

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: rgba(255,255,255,.72);
    font-weight: 500;
    font-size: 13.5px;
    transition: var(--transition-smooth);
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: right;
    position: relative;
    line-height: 1.2;
}
.sidebar-menu-link:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
    transform: translateX(-2px);
}
.sidebar-menu-link.active {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 6px 18px rgba(233,69,96,.35);
}
.sidebar-menu-link.active::before {
    content: '';
    position: absolute;
    right: -16px; top: 50%; transform: translateY(-50%);
    width: 4px; height: 24px;
    background: var(--accent-color);
    border-radius: 4px 0 0 4px;
}
.sidebar-menu-link i {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,.08);
    margin: 10px 0 4px;
}

/* Sidebar Footer (User + Logout) - pinned to bottom */
.sidebar-footer {
    flex-shrink: 0;
    padding: 10px 4px 0;
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: 8px;
    background: transparent;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,.04);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.06);
    margin-bottom: 8px;
}
.sidebar-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), #ff6b85);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.sidebar-user-role {
    color: rgba(255,255,255,.5);
    font-size: 10px;
}

.logout-button {
    width: 100%;
    background: rgba(233,69,96,.12);
    color: #ff8d9f;
    border: 1px solid rgba(233,69,96,.2);
    padding: 8px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 12.5px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.logout-button:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}
.logout-button i { font-size: 15px; }

/* Mobile sidebar toggle */
.sidebar-toggle {
    position: fixed;
    top: 14px; right: 14px;
    width: 44px; height: 44px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #fff;
    box-shadow: var(--shadow-soft);
    z-index: 1100;
    cursor: pointer;
    color: var(--primary-700);
    font-size: 22px;
}
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 900;
    display: none;
}
body.sidebar-open .sidebar-backdrop { display: block; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(100%); }
    body.sidebar-open .sidebar { transform: translateX(0); }
}

/* ============== Main Content ============== */
.main-content {
    margin-right: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    padding: 28px 32px;
}
@media (max-width: 991.98px) {
    .main-content {
        margin-right: 0;
        width: 100%;
        padding: 70px 16px 24px;
    }
}

/* ============== Top Header ============== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
    flex-wrap: wrap;
}
.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-900);
    margin: 0;
    line-height: 1.2;
}
.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 6px 0 0;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    position: relative;
    width: 44px; height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition-smooth);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 18px;
}
.btn-icon:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: var(--shadow-soft);
}
.badge-dot {
    position: absolute;
    top: 10px; left: 10px;
    width: 8px; height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    border: 2px solid #fff;
}

.user-dropdown { position: relative; }
.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 8px;
    background: #fff;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--text-primary);
}
.user-dropdown-btn:hover { border-color: var(--accent-color); box-shadow: var(--shadow-soft); }

.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent-color), #ff6b85);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}
.user-info { text-align: right; }
.user-name { font-weight: 600; font-size: 13px; color: var(--text-primary); line-height: 1.1; }
.user-role { font-size: 11px; color: var(--text-secondary); }

.dropdown-menu {
    border-radius: 14px !important;
    padding: 8px !important;
    border: 1px solid var(--border-color) !important;
    margin-top: 8px !important;
    min-width: 220px;
}
.dropdown-item {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--transition-smooth);
}
.dropdown-item:hover { background: rgba(11,20,55,.04); }
.dropdown-item.text-danger:hover { background: var(--danger-bg); }

/* ============== Cards ============== */
.content-card {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 26px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 22px;
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}
.content-card:hover { box-shadow: var(--shadow-medium); }

.card-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}
.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-900);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}
.card-title i {
    color: var(--accent-color);
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--danger-bg);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px;
}

/* ============== Buttons ============== */
.btn-action {
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn-action-primary { background: var(--accent-color); color: #fff; }
.btn-action-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233,69,96,.3);
    color: #fff;
}
.btn-action-secondary { background: var(--accent-secondary); color: #fff; }
.btn-action-secondary:hover { background: #0a2647; transform: translateY(-2px); color: #fff; }
.btn-action-outline {
    background: #fff;
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
}
.btn-action-outline:hover { border-color: var(--accent-color); color: var(--accent-color); }

.btn-icon-sm {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: rgba(15,52,96,.06);
    color: var(--accent-secondary);
    display: inline-flex; align-items: center; justify-content: center;
    margin: 0 2px;
    transition: var(--transition-smooth);
    border: none;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}
.btn-icon-sm:hover { background: var(--accent-secondary); color: #fff; }
.btn-icon-sm.text-danger { background: var(--danger-bg); color: var(--accent-color); }
.btn-icon-sm.text-danger:hover { background: var(--accent-color); color: #fff; }
.btn-icon-sm.text-success { background: var(--success-bg); color: var(--success); }
.btn-icon-sm.text-success:hover { background: var(--success); color: #fff; }
.btn-icon-sm.text-warning { background: var(--warning-bg); color: var(--warning); }
.btn-icon-sm.text-warning:hover { background: var(--warning); color: #fff; }

/* ============== Tables ============== */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
}
.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.table-custom thead th {
    background: #f8fafc;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.table-custom thead th:first-child { border-radius: 0 10px 0 0; }
.table-custom thead th:last-child { border-radius: 10px 0 0 0; }
.table-custom tbody td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 14px;
    color: var(--text-primary);
}
.table-custom tbody tr { transition: var(--transition-smooth); }
.table-custom tbody tr:hover { background: rgba(233,69,96,.025); }
.table-custom tbody tr:last-child td { border-bottom: none; }

/* ============== Status Badge ============== */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.status-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.status-badge.active   { background: var(--success-bg); color: var(--success); }
.status-badge.pending  { background: var(--warning-bg); color: var(--warning); }
.status-badge.inactive { background: var(--danger-bg);  color: var(--accent-color); }

/* ============== Form Controls ============== */
.form-label-custom {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary-900);
    margin-bottom: 6px;
    display: block;
}
.form-control-custom {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    font-size: 14px;
    transition: var(--transition-smooth);
    background: #fafbfc;
    font-family: inherit;
    color: var(--text-primary);
}
.form-control-custom::placeholder { color: var(--text-muted); }
.form-control-custom:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(233,69,96,.1);
    background: #fff;
}
.form-select-custom {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23707eae' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 01.753 1.659l-4.796 5.48a1 1 0 01-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    padding-left: 42px;
}

.form-floating > .form-control {
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    height: 56px;
    padding: 1rem;
    font-size: 14px;
    transition: var(--transition-smooth);
    background: #fafbfc;
}
.form-floating > .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(233,69,96,.1);
    background: #fff;
}
.form-floating > label { padding: 1rem; color: var(--text-secondary); }

.form-check-input:checked { background-color: var(--accent-color); border-color: var(--accent-color); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(233,69,96,.15); border-color: var(--accent-color); }

/* ============== Stats Cards ============== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: var(--accent-color);
    opacity: .8;
}
.stat-card:nth-child(2)::before { background: var(--accent-secondary); }
.stat-card:nth-child(3)::before { background: var(--success); }
.stat-card:nth-child(4)::before { background: var(--warning); }

.stat-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.stat-icon.employees { background: var(--danger-bg);  color: var(--accent-color); }
.stat-icon.vehicles  { background: rgba(15,52,96,.1); color: var(--accent-secondary); }
.stat-icon.archives  { background: var(--success-bg); color: var(--success); }
.stat-icon.users     { background: var(--warning-bg); color: var(--warning); }

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-900);
    line-height: 1;
}
.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500;
}

/* ============== Tabs ============== */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
    gap: 6px;
    margin-bottom: 20px !important;
}
.nav-tabs .nav-link {
    border: none;
    border-radius: 10px 10px 0 0;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    background: transparent;
}
.nav-tabs .nav-link:hover { color: var(--accent-color); background: var(--danger-bg); }
.nav-tabs .nav-link.active {
    color: #fff;
    background: var(--accent-color);
    box-shadow: 0 4px 14px rgba(233,69,96,.25);
}

/* ============== Alerts ============== */
.alert { border-radius: 12px; border: none; padding: 14px 18px; font-size: 14px; }
.alert-success { background: var(--success-bg); color: #1a6c2e; }
.alert-danger  { background: var(--danger-bg); color: #b32340; }
.alert-warning { background: var(--warning-bg); color: #856404; }

/* ============== Lists ============== */
.list-group-item {
    border: none;
    padding: 12px 14px;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}
.list-group-item:last-child { border-bottom: none; }

dl.row dt { color: var(--text-secondary); font-weight: 600; font-size: 13px; }
dl.row dd { color: var(--text-primary); font-size: 14px; }

/* ============== Animations ============== */
.content-card, .stat-card { animation: fadeInUp 0.4s ease both; }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============== Photo Upload ============== */
.photo-upload-area {
    border: 2px dashed var(--border-strong);
    border-radius: 14px;
    padding: 30px 20px;
    text-align: center;
    transition: var(--transition-smooth);
    cursor: pointer;
    background: #fafbfc;
}
.photo-upload-area:hover,
.photo-upload-area.dragover {
    border-color: var(--accent-color);
    background: rgba(233, 69, 96, .03);
}
.photo-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}
.photo-preview-container img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    box-shadow: var(--shadow-soft);
}
.photo-name {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}
.photo-upload-text {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
    margin: 12px 0 4px;
}
.photo-upload-hint {
    font-size: 13px;
    color: var(--text-secondary);
}
.file-upload-icon {
    width: 64px; height: 64px;
    background: rgba(233, 69, 96, .08);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto;
}
.file-upload-icon i {
    font-size: 26px;
    color: var(--accent-color);
}

/* ============== Row avatar (in tables) ============== */
.row-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}
.row-avatar-placeholder {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--danger-bg);
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* ============== Details photo ============== */
.details-photo {
    width: 160px; height: 160px;
    border-radius: 16px;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    box-shadow: var(--shadow-medium);
}
.details-photo-placeholder {
    width: 160px; height: 160px;
    border-radius: 16px;
    background: var(--danger-bg);
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 70px;
    margin: 0 auto;
}

/* ============== Modal-style card (Archive Create/Edit) ============== */
.modal-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    animation: fadeInUp 0.4s ease both;
}
.modal-card-header {
    background: var(--primary-gradient);
    padding: 20px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}
.modal-card-header > div > i {
    width: 44px; height: 44px;
    background: var(--accent-color);
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 20px;
    box-shadow: 0 6px 16px rgba(233,69,96,.35);
}
.modal-card-title {
    font-size: 22px; font-weight: 600; color: #fff;
    margin: 0;
}
.modal-card-title span {
    color: var(--accent-color);
}
.modal-card-close {
    width: 38px; height: 38px;
    background: rgba(255,255,255,.1);
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px;
    text-decoration: none;
    transition: var(--transition-smooth);
}
.modal-card-close:hover {
    background: rgba(233,69,96,.4);
    color: #fff;
}
.modal-card-body { padding: 28px 26px; }
.modal-card-footer {
    padding: 18px 26px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    background: #fafbfc;
}

/* ============== Quill editor host ============== */
.quill-host {
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition-smooth);
    background: #fafbfc;
}
.quill-host:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(233,69,96,.1);
    background: #fff;
}
.quill-host .ql-toolbar {
    border: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    background: #f8fafc;
    padding: 10px 14px !important;
}
.quill-host .ql-container {
    border: none !important;
    min-height: 180px;
    font-family: 'Cairo', 'Tajawal', sans-serif !important;
    font-size: 14px;
    direction: rtl;
}
.quill-host .ql-editor {
    min-height: 180px;
    text-align: right;
}
.quill-host .ql-editor.ql-blank::before {
    color: var(--text-muted);
    font-style: normal;
    right: 14px;
    left: auto;
}

/* ============== Input with right icon ============== */
.input-icon-group {
    position: relative;
}
.input-icon-group .form-control-custom {
    padding-left: 42px;
}
.input-icon-group > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 16px;
    pointer-events: none;
}

/* ============== File drop zone ============== */
.file-drop-zone {
    border: 2px dashed var(--border-strong);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    transition: var(--transition-smooth);
    cursor: pointer;
    background: #fafbfc;
}
.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--accent-color);
    background: rgba(233,69,96,.03);
}
.file-drop-content { pointer-events: none; }
.file-drop-icon {
    width: 70px; height: 70px;
    background: rgba(233,69,96,.08);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
}
.file-drop-icon i {
    font-size: 28px;
    color: var(--accent-color);
}
.file-drop-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.file-drop-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============== File list (uploaded items) ============== */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition-smooth);
}
.file-item:hover { border-color: var(--accent-color); }
.file-item-icon {
    width: 42px; height: 42px;
    background: #fff;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}
.file-item-info { flex: 1; min-width: 0; }
.file-item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    display: block;
}
a.file-item-name:hover { color: var(--accent-color); }
.file-item-size {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.file-item-remove {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--danger-bg);
    color: var(--accent-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}
.file-item-remove:hover {
    background: var(--accent-color);
    color: #fff;
}

/* ============== Target photo box (Reports) ============== */
.target-photo-box {
    width: 110px;
    height: 110px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: #fafbfc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 38px;
}
.target-photo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============== Movements table styling (Reports) ============== */
.movements-table .movements-thead th {
    background: #1a1a2e;
    color: #fff;
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
}
.movements-table thead th:first-child { border-radius: 0 8px 0 0; }
.movements-table thead th:last-child  { border-radius: 8px 0 0 0; }
.movements-table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
}
.movements-table tbody tr:hover { background: rgba(11,20,55,0.02); }
.movements-table .row-number {
    text-align: center;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Info button variant */
.btn-action-info {
    background: #2563eb;
    color: #fff;
}
.btn-action-info:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    color: #fff;
    box-shadow: 0 6px 20px rgba(37,99,235,.25);
}

/* ============== Section title with icon ============== */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-900);
    font-size: 16px;
    font-weight: 700;
}
.section-title i {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--danger-bg);
    color: var(--accent-color);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.section-title.section-info i { background: rgba(37,99,235,.10); color: #2563eb; }
.section-title.section-success i { background: var(--success-bg); color: var(--success); }

/* ============== Form label with icon ============== */
.form-label-custom i {
    color: var(--accent-color);
    margin-left: 6px;
    font-size: 13px;
}

/* ============== Empty state ============== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state-icon {
    width: 90px; height: 90px;
    border-radius: 50%;
    background: rgba(11,20,55,.04);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    color: var(--text-muted);
    margin-bottom: 18px;
}
.empty-state-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-900);
    margin-bottom: 6px;
}
.empty-state-hint {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 360px;
    margin: 0 auto;
}

/* ============== Page header banner ============== */
.page-header-banner {
    background: linear-gradient(135deg, var(--primary-900), var(--primary-500));
    color: #fff;
    border-radius: 18px;
    padding: 22px 26px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
}
.page-header-banner::after {
    content: '';
    position: absolute;
    top: -40px; left: -40px;
    width: 160px; height: 160px;
    background: radial-gradient(circle, rgba(233,69,96,.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.page-header-banner-icon {
    width: 60px; height: 60px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}
.page-header-banner-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}
.page-header-banner-sub {
    font-size: 13px;
    color: rgba(255,255,255,.7);
    margin-top: 4px;
}

/* ============== Refined badge variants ============== */
.badge-soft-info { background: rgba(37,99,235,.10); color: #2563eb; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.badge-soft-warning { background: var(--warning-bg); color: var(--warning); padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.badge-soft-success { background: var(--success-bg); color: var(--success); padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.badge-soft-danger { background: var(--danger-bg); color: var(--accent-color); padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; }

/* ============== Card hover lift ============== */
.lift-on-hover { transition: var(--transition-smooth); }
.lift-on-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-medium); }

/* ============== Responsive ============== */
@media (max-width: 575.98px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 22px; }
    .content-card { padding: 18px; }
    .header-actions .user-info { display: none; }
    .modal-card-header { padding: 16px 20px; }
    .modal-card-body, .modal-card-footer { padding: 18px 20px; }
    .page-header-banner { padding: 16px 18px; flex-direction: column; align-items: flex-start; }
}
