:root {
    --brand-primary: #1e40af;
    --brand-primary-hover: #1d4ed8;
    --brand-dark: #0f172a;
    --brand-light: #f8fafc;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

body {
    background-color: #f1f5f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar Styling & Responsive Fit */
.navbar {
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.025em;
    min-width: 0;
}

.navbar-brand .brand-name {
    max-width: 180px;
    vertical-align: middle;
}

@media (min-width: 1400px) {
    .navbar-brand .brand-name {
        max-width: 280px;
    }
}

.navbar-nav .nav-link {
    font-size: 0.875rem;
    white-space: nowrap;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .navbar-expand-xl .navbar-nav .nav-link {
        padding-left: 0.32rem !important;
        padding-right: 0.32rem !important;
        font-size: 0.82rem;
        letter-spacing: -0.01em;
    }
    .navbar-expand-xl .navbar-nav .nav-link i {
        margin-right: 0.15rem !important;
    }
}

/* Ensure navbar user action buttons never collapse or get cut off */
.nav-actions {
    flex-shrink: 0;
}

.nav-actions .btn {
    white-space: nowrap;
}

.btn-logoff {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-logoff:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(220, 53, 69, 0.3) !important;
}

.main-content {
    flex: 1 0 auto;
}

/* Cards & Containers */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card {
    border-left: 4px solid var(--brand-primary);
}

.stat-card.stat-active {
    border-left-color: #10b981;
}

.stat-card.stat-pending {
    border-left-color: #f59e0b;
}

.stat-card.stat-inactive {
    border-left-color: #64748b;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

/* Status Badges */
.badge-status {
    padding: 0.4em 0.75em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-status-inactive {
    background-color: #f1f5f9;
    color: #475569;
}

.badge-status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

/* Rating Stars */
.star-rating {
    color: #f59e0b;
    letter-spacing: 2px;
}

/* Tables */
.table-hover tbody tr:hover {
    background-color: rgba(30, 64, 175, 0.03);
}

.table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
    border-top: none;
}

/* Audit log timeline */
.timeline {
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px solid #e2e8f0;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-dot {
    position: absolute;
    left: -1.95rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--brand-primary);
    border: 2px solid #fff;
}

/* Footer */
footer {
    flex-shrink: 0;
    background-color: #fff;
    border-top: 1px solid #e2e8f0;
}

/* ==========================================================================
   RTL & Urdu Language Styles
   ========================================================================== */
[dir="rtl"] body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Nastaliq Urdu", "Urdu Typesetting", "Jameel Noori Nastaleeq", Tahoma, Arial, sans-serif;
    text-align: right;
}

[dir="rtl"] .stat-card {
    border-left: none;
    border-right: 4px solid var(--brand-primary);
}

[dir="rtl"] .stat-card.stat-active {
    border-right-color: #10b981;
}

[dir="rtl"] .stat-card.stat-pending {
    border-right-color: #f59e0b;
}

[dir="rtl"] .stat-card.stat-inactive {
    border-right-color: #64748b;
}

[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: 1.5rem;
    border-left: none;
    border-right: 2px solid #e2e8f0;
}

[dir="rtl"] .timeline-dot {
    left: auto;
    right: -1.95rem;
}

[dir="rtl"] .lang-flag {
    font-size: 1.1rem;
    line-height: 1;
}

[dir="rtl"] .navbar-brand {
    text-align: right;
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    [dir="rtl"] .navbar-expand-xl .navbar-nav .nav-link i {
        margin-right: 0 !important;
        margin-left: 0.15rem !important;
    }
}


