:root {
    --admin-bg: #f8fafc;
    --admin-sidebar-bg: #1E293B;
    --admin-sidebar-hover: #1e293b;
    --admin-primary: #3b82f6;
    --admin-secondary: #64748b;
    --admin-accent: #0ea5e9;
    --admin-text: #1e293b;
    --admin-card-bg: #ffffff;
    --admin-border: #e2e8f0;
    --admin-success: #10b981;
    --admin-danger: #ef4444;
    --admin-warning: #f59e0b;
}

/* Reset and Base Admin Styles */
body.admin-body {
    background-color: var(--admin-bg);
    color: var(--admin-text);
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif !important;
}

/* Sidebar Styles */
.sidebar {
    background: var(--admin-sidebar-bg) !important;
    border: none !important;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05) !important;
}

.sidebar-content {
    background: var(--admin-sidebar-bg) !important;
}

.sidebar-link,
a.sidebar-link {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.7) !important;
    border-radius: 8px !important;
    margin: 4px 12px !important;
    transition: all 0.3s ease !important;
    padding: 10px 16px !important;
    border: none !important;
}

.sidebar-link:hover {
    background: var(--admin-sidebar-hover) !important;
    color: #fff !important;
    transform: translateX(5px);
}

.sidebar-item.active>.sidebar-link {
    background: var(--admin-primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

.sidebar-brand {
    padding: 1.5rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.sidebar-header {
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 0.7rem !important;
    letter-spacing: 1px !important;
    padding-top: 1.5rem !important;
}

/* Top Nav Styles */
.navbar {
    background: var(--admin-sidebar-bg) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 0.75rem 1.5rem !important;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05) !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 600 !important;
}

.nav-link:hover {
    color: #fff !important;
}

.branch-badge-modern {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 0.4rem 1rem !important;
    border-radius: 20px !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
}

/* Royal Black Dropdown Styling */
.bg-dark-royal {
    background-color: #111111 !important;
    /* Royal Black / Jet Black */
    border: 1px solid #333 !important;
    color: #ffffff !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

.bg-dark-royal .dropdown-item {
    color: #cccccc !important;
    transition: all 0.2s ease;
}

.bg-dark-royal .dropdown-item:hover {
    background-color: #333333 !important;
    color: #ffffff !important;
    transform: translateX(5px);
    /* Subtle nudge */
}

.bg-dark-royal .text-muted {
    color: #888888 !important;
}

/* Royal Badge Trigger */
.badge-royal {
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5) !important;
    padding: 8px 16px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.badge-royal:hover {
    background: #000000 !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6) !important;
    transform: translateY(-1px);
}


/* Card Modernization */
.card {
    border: 1px solid var(--admin-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
    overflow: hidden;
    background: var(--admin-card-bg);
    margin-bottom: 1.5rem;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--admin-border) !important;
    padding: 1.25rem !important;
}

.card-title {
    color: var(--admin-text);
    font-weight: 700;
    margin-bottom: 0;
}

/* Statistics Cards */
.stat-card-modern {
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.3s ease;
}

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

.stat-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Table Refinement */
.table {
    margin-bottom: 0 !important;
}

.table thead th {
    background: #f8fafc !important;
    border-bottom: 1px solid var(--admin-border) !important;
    color: var(--admin-secondary) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.5px !important;
}

.table td {
    border-bottom: 1px solid var(--admin-border) !important;
    padding: 1rem 0.75rem !important;
    vertical-align: middle !important;
}

/* Buttons */
.btn-admin-primary {
    background: var(--admin-primary);
    color: #fff;
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
}

.btn-admin-primary:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    color: #fff;
}

/* Responsive RTL/LTR consistency */
[dir="rtl"] .sidebar-link:hover {
    transform: translateX(-5px);
}

/* Fallback for old class usage */
.branch-badge {
    background: #f1f5f9 !important;
    color: var(--admin-primary) !important;
    border: 1px solid var(--admin-border) !important;
    padding: 0.4rem 1rem !important;
    border-radius: 20px !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
}

.dropdown-menu {
    border: 1px solid var(--admin-border) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    padding: 0.5rem !important;
}

.dropdown-item {
    border-radius: 8px !important;
    padding: 0.6rem 1rem !important;
    transition: all 0.2s ease !important;
}

.dropdown-item:hover {
    background: #f1f5f9 !important;
    color: var(--admin-primary) !important;
}

.sidebar-link i,
.sidebar-link svg {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 1.1rem !important;
    width: 20px !important;
    text-align: center !important;
}

.sidebar-item.active .sidebar-link i,
.sidebar-item.active .sidebar-link svg {
    color: #fff !important;
}

.badge {
    padding: 0.4rem 0.75rem !important;
    font-weight: 600 !important;
}

/* Backgrounds for specific stats if still used legacy */
.bg-white {
    background-color: #fff !important;
}

.bg-info-500 {
    background-color: #3b82f6 !important;
}

.bg-orange-500 {
    background-color: #f59e0b !important;
}

/* Custom Scrollbar for Sidebar */
.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Soft Badges */
.bg-blue-900 {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: #3b82f6 !important;
}

.badge-soft-success {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #10b981 !important;
}

.badge-soft-warning {
    background-color: rgba(245, 158, 11, 0.1) !important;
    color: #f59e0b !important;
}

.badge-soft-danger {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
}

.badge-soft-info {
    background-color: rgba(14, 165, 233, 0.1) !important;
    color: #0ea5e9 !important;
}