@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;700&display=swap');

:root {
    --primary: #0EA5E9;
    --primary-dark: #0284C7;
    --primary-light: #E0F2FE;
    --primary-50: #F0F9FF;
    --success: #10B981;
    --success-light: #D1FAE5;
    --accent: #14B8A6;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #6366F1;
    --info-light: #E0E7FF;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font);
    background: linear-gradient(135deg, #F0F9FF 0%, #F8FAFC 50%, #F0FDF4 100%);
    color: var(--gray-800);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); text-decoration: none; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0C4A6E 0%, #0369A1 25%, #0EA5E9 50%, #38BDF8 75%, #7DD3FC 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(255,255,255,0.05) 0%, transparent 50%);
    animation: shimmer 15s ease-in-out infinite alternate;
}

@keyframes shimmer {
    0% { transform: translateX(-5%) translateY(-5%); }
    100% { transform: translateX(5%) translateY(5%); }
}

.login-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.2);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    margin: 1rem;
    position: relative;
    z-index: 1;
    animation: cardFloat 0.6s ease-out;
}

@keyframes cardFloat {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
    text-align: center;
}

.login-card .subtitle {
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 400;
}

.form-group {
    margin-bottom: 1.125rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--gray-700);
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.875rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: all var(--transition);
    outline: none;
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-800);
}

.form-control:hover {
    border-color: var(--gray-300);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
    background: white;
}

.form-control::placeholder {
    color: var(--gray-400);
}

select.form-control {
    appearance: none;
    background: var(--gray-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 0.875rem center;
    padding-right: 2.25rem;
    cursor: pointer;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; box-shadow: 0 2px 8px rgba(14,165,233,0.3); }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(14,165,233,0.4); }
.btn-success { background: linear-gradient(135deg, var(--success) 0%, #059669 100%); color: white; box-shadow: 0 2px 8px rgba(16,185,129,0.3); }
.btn-success:hover { box-shadow: 0 4px 16px rgba(16,185,129,0.4); }
.btn-warning { background: linear-gradient(135deg, var(--warning) 0%, #D97706 100%); color: white; box-shadow: 0 2px 8px rgba(245,158,11,0.3); }
.btn-danger { background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%); color: white; box-shadow: 0 2px 8px rgba(239,68,68,0.3); }
.btn-info { background: linear-gradient(135deg, var(--info) 0%, #4F46E5 100%); color: white; box-shadow: 0 2px 8px rgba(99,102,241,0.3); }
.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1.5px solid var(--gray-200);
    box-shadow: none;
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-300); box-shadow: var(--shadow); }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; border-radius: 6px; }
.btn-lg { padding: 0.8rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

.alert {
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.alert-danger { background: var(--danger-light); color: #B91C1C; border: 1px solid #FECACA; }
.alert-success { background: var(--success-light); color: #065F46; border: 1px solid #A7F3D0; }
.alert-warning { background: var(--warning-light); color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background: var(--info-light); color: #3730A3; border: 1px solid #C7D2FE; }

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0C4A6E 0%, #0369A1 40%, #0284C7 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.1);
}

.sidebar-header h2 {
    font-size: 1rem;
    color: white;
    font-weight: 700;
}

.sidebar-header small {
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.sidebar-nav {
    padding: 0.5rem 0;
}

.nav-section {
    padding: 1rem 1.25rem 0.375rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.55rem 1.25rem;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font);
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    border-left-color: rgba(255,255,255,0.3);
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    font-weight: 600;
    border-left-color: #38BDF8;
}

.nav-item .icon {
    width: 22px;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 1rem;
    opacity: 0.85;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    height: var(--header-height);
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226,232,240,0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.375rem;
    color: var(--gray-600);
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.menu-toggle:hover { background: var(--gray-100); }

.page-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: -0.01em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, #BAE6FD 100%);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(14,165,233,0.15);
}

.content-area {
    padding: 1.5rem;
}

.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    border: 1px solid rgba(226,232,240,0.5);
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: -0.01em;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius) var(--radius);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(226,232,240,0.5);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card.primary::before { background: linear-gradient(90deg, var(--primary), #38BDF8); }
.stat-card.success::before { background: linear-gradient(90deg, var(--success), #34D399); }
.stat-card.warning::before { background: linear-gradient(90deg, var(--warning), #FBBF24); }
.stat-card.danger::before { background: linear-gradient(90deg, var(--danger), #F87171); }
.stat-card.info::before { background: linear-gradient(90deg, var(--info), #818CF8); }

.stat-card.primary { border-left: none; }
.stat-card.success { border-left: none; }
.stat-card.warning { border-left: none; }
.stat-card.danger { border-left: none; }
.stat-card.info { border-left: none; }

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-800);
    margin: 0.25rem 0;
    letter-spacing: -0.02em;
}

.stat-card .stat-change {
    font-size: 0.8rem;
    font-weight: 500;
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    text-align: left;
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-100);
    background: var(--gray-50);
    white-space: nowrap;
}

table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
    color: var(--gray-700);
}

table tr:hover {
    background: var(--primary-50);
}

table tr:nth-child(even) {
    background: rgba(248,250,252,0.5);
}

table tr:nth-child(even):hover {
    background: var(--primary-50);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge-success { background: var(--success-light); color: #065F46; }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-danger { background: var(--danger-light); color: #B91C1C; }
.badge-info { background: var(--info-light); color: #3730A3; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }

.pagination {
    display: flex;
    gap: 0.375rem;
    justify-content: center;
    padding: 1rem;
}

.pagination button {
    padding: 0.4rem 0.8rem;
    border: 1.5px solid var(--gray-200);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--font);
    transition: all var(--transition);
    color: var(--gray-600);
}

.pagination button:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-50);
}

.pagination button.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(14,165,233,0.3);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15,23,42,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 1rem;
    animation: modalSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    line-height: 1;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.toolbar .search-input {
    flex: 1;
    min-width: 200px;
}

.filter-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    padding: 0.875rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(226,232,240,0.5);
}
.filter-search-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    min-width: 180px;
    max-width: 340px;
}
.filter-search-wrap .filter-search {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex: 1;
    min-width: 0;
}
.btn-search {
    padding: 0.7rem 0.875rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border: 1.5px solid var(--primary);
    font-size: 0.875rem;
    line-height: 1;
    white-space: nowrap;
}
.filter-toolbar .filter-search {
    flex: 1;
    min-width: 180px;
    max-width: 300px;
}
.filter-toolbar .filter-select {
    width: auto;
    min-width: 130px;
    max-width: 200px;
}
.filter-toolbar .filter-date {
    width: auto;
    min-width: 130px;
    max-width: 160px;
}
.filter-date-sep {
    color: var(--gray-400);
    font-size: 0.8rem;
    padding: 0 2px;
}
.filter-buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-400);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    opacity: 0.6;
}

.empty-state p {
    font-size: 0.9rem;
    font-weight: 500;
}

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: 0.8rem; }
.text-muted { color: var(--gray-500); }
.fw-bold { font-weight: 600; }
.w-full { width: 100%; }
.hidden { display: none !important; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--gray-400);
    font-weight: 500;
}

.spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: toastSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 300px;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
}

.toast-success { background: linear-gradient(135deg, var(--success), #059669); color: white; }
.toast-error { background: linear-gradient(135deg, var(--danger), #DC2626); color: white; }
.toast-info { background: linear-gradient(135deg, var(--info), #4F46E5); color: white; }

@keyframes toastSlide {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.stars {
    color: var(--warning);
    font-size: 1rem;
}

.star-input { cursor: pointer; font-size: 1.5rem; transition: transform 0.15s; }
.star-input:hover { color: var(--warning); transform: scale(1.2); }

.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-100);
    margin-bottom: 1rem;
    overflow-x: auto;
    gap: 0.25rem;
}

.tab {
    padding: 0.6rem 1.125rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font);
    font-weight: 500;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab:hover { color: var(--gray-700); background: var(--gray-50); }
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
    background: var(--primary-50);
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15,23,42,0.4);
        backdrop-filter: blur(2px);
        z-index: 99;
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .topbar {
        padding: 0 0.75rem;
    }
    .page-title {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 50vw;
    }
    .user-info .user-name {
        display: none;
    }
    .content-area {
        padding: 1rem 0.75rem;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .stat-card {
        padding: 0.875rem;
    }
    .stat-card .stat-value {
        font-size: 1.35rem;
    }
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .toolbar .search-input {
        min-width: unset;
        width: 100%;
    }
    .filter-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-search-wrap {
        max-width: none;
        min-width: unset;
        width: 100%;
    }
    .filter-toolbar .filter-search,
    .filter-toolbar .filter-select,
    .filter-toolbar .filter-date {
        width: 100%;
        max-width: none;
        min-width: unset;
    }
    .filter-buttons {
        margin-left: 0;
        width: 100%;
    }
    .filter-buttons .btn {
        flex: 1;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
    }
    table th,
    table td {
        padding: 0.5rem 0.625rem;
        font-size: 0.8rem;
    }
    .modal {
        max-width: calc(100vw - 1rem);
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }
    .modal-body {
        padding: 1rem;
    }
    .modal-header {
        padding: 0.75rem 1rem;
    }
    .modal-footer {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }
    .modal-footer .btn {
        flex: 1;
        min-width: 0;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .card-header .btn,
    .card-header .toolbar {
        width: 100%;
    }
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    .login-card {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    .toast-container {
        left: 0.5rem;
        right: 0.5rem;
    }
    .toast {
        min-width: unset;
        width: 100%;
    }
    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stat-card .stat-value {
        font-size: 1.15rem;
    }
    .content-area {
        padding: 0.75rem 0.5rem;
    }
    .topbar {
        padding: 0 0.5rem;
    }
    .page-title {
        font-size: 0.875rem;
        max-width: 40vw;
    }
    .modal {
        margin: 0.25rem;
        max-width: calc(100vw - 0.5rem);
        max-height: calc(100vh - 0.5rem);
        border-radius: var(--radius);
    }
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    table th,
    table td {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
}

.announcement-ticker {
    background: linear-gradient(90deg, #0C4A6E, #0284C7, #0EA5E9);
    color: #fff;
    overflow: hidden;
    position: relative;
    z-index: 100;
}
.announcement-ticker.ticker-landing {
    border-bottom: 2px solid rgba(255,255,255,0.1);
}
.announcement-ticker.ticker-dashboard {
    border-bottom: 1px solid var(--gray-200);
    margin-left: var(--sidebar-width);
}
@media (max-width: 768px) {
    .announcement-ticker.ticker-dashboard {
        margin-left: 0;
    }
}
.ticker-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    white-space: nowrap;
    overflow: hidden;
}
.ticker-row + .ticker-row {
    border-top: 1px solid rgba(255,255,255,0.1);
}
.ticker-label {
    flex-shrink: 0;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 10px;
    margin: 0 12px;
    border-radius: 999px;
}
.ticker-content {
    display: inline-block;
    animation: ticker-scroll 30s linear infinite;
    padding-left: 100%;
    font-size: 0.85rem;
    font-weight: 500;
}
.ticker-content.rtl-text {
    direction: rtl;
    font-family: 'Noto Nastaliq Urdu', var(--font);
}
@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.city-picker {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    background: white;
}
.city-picker-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--gray-100);
}
.city-picker-header .btn {
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
}
.city-picker-search {
    flex: 1;
    min-width: 100px;
    max-width: 200px;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
}
.city-picker-count {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}
.city-picker-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 0.25rem 0.5rem;
}
.city-picker-group {
    margin-bottom: 0.25rem;
}
.city-picker-province {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.35rem 0 0.15rem;
    border-bottom: 1px solid var(--gray-100);
}
.city-picker-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: background var(--transition);
}
.city-picker-item:hover {
    background: var(--primary-50);
}
.city-picker-item input[type="checkbox"] {
    margin: 0;
    accent-color: var(--primary);
}
.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}
.btn-outline {
    background: white;
    color: var(--primary);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.btn-outline:hover {
    background: var(--primary-50);
    border-color: var(--primary);
}
.searchable-select {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.searchable-select .ss-search {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}
.searchable-select .ss-select {
    width: 100%;
}

.social-links-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
    flex-wrap: wrap;
}
.social-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-50);
    color: var(--gray-500);
    transition: all 0.25s ease;
    text-decoration: none;
    border: 1.5px solid var(--gray-100);
}
.social-link-btn:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(14,165,233,0.3);
    border-color: transparent;
}
.social-link-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.analytics-charts { margin-top: 1.5rem; }
.chart-bar-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.chart-bar-label { min-width: 100px; font-size: 0.85rem; color: var(--gray-600); text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.chart-bar-track { flex: 1; height: 24px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 999px; min-width: 2px; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.chart-bar-fill.primary { background: linear-gradient(90deg, var(--primary), #38BDF8); }
.chart-bar-fill.success { background: linear-gradient(90deg, var(--success), #34D399); }
.chart-bar-fill.danger { background: linear-gradient(90deg, var(--danger), #F87171); }
.chart-bar-value { min-width: 90px; font-size: 0.8rem; color: var(--gray-700); font-weight: 700; text-align: right; white-space: nowrap; }
.rve-bars { display: flex; flex-direction: column; gap: 1rem; }
.rve-bar-group { display: flex; flex-direction: column; gap: 0.25rem; }
.rve-bar-label { font-size: 0.85rem; font-weight: 600; color: var(--gray-700); }
.rve-bar-amount { font-size: 0.85rem; color: var(--gray-600); font-weight: 600; }

.notif-wrapper { position: relative; margin-right: 12px; }
.notif-bell { background: none; border: none; cursor: pointer; position: relative; padding: 8px; border-radius: 50%; color: var(--gray-500); transition: all var(--transition); }
.notif-bell:hover { background: var(--primary-50); color: var(--primary); }
.notif-badge { position: absolute; top: 0; right: 0; background: linear-gradient(135deg, var(--danger), #DC2626); color: #fff; font-size: 10px; font-weight: 700; border-radius: 50%; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 0 4px; line-height: 1; box-shadow: 0 2px 4px rgba(239,68,68,0.3); }
.notif-dropdown { position: absolute; right: 0; top: 46px; width: 380px; max-height: 480px; background: white; border-radius: var(--radius); box-shadow: var(--shadow-xl); border: 1px solid var(--gray-100); z-index: 1000; display: flex; flex-direction: column; overflow: hidden; animation: modalSlide 0.25s ease; }
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--gray-100); background: var(--gray-50); }
.notif-list { overflow-y: auto; max-height: 360px; flex: 1; }
.notif-footer { padding: 12px 18px; border-top: 1px solid var(--gray-100); text-align: center; background: var(--gray-50); }
.notif-footer a { color: var(--primary); text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.notif-item { display: flex; gap: 12px; padding: 12px 18px; cursor: pointer; transition: background 0.15s; border-bottom: 1px solid var(--gray-50); border-left: 3px solid transparent; }
.notif-item:hover { background: var(--primary-50); }
.notif-item.unread { background: rgba(14,165,233,0.04); border-left-color: var(--primary); }
.notif-item.unread .notif-title { font-weight: 600; color: var(--gray-900); }
.notif-item.read { opacity: 1; }
.notif-item.read .notif-title { color: var(--gray-500); }
.notif-item.read .notif-msg { color: var(--gray-400); }
.notif-icon { font-size: 1.2rem; flex-shrink: 0; width: 28px; text-align: center; padding-top: 2px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 0.85rem; color: var(--gray-800); margin-bottom: 2px; word-wrap: break-word; overflow-wrap: break-word; }
.notif-msg { font-size: 0.78rem; color: var(--gray-500); word-wrap: break-word; overflow-wrap: break-word; line-height: 1.4; }
.notif-time { font-size: 0.72rem; color: var(--gray-400); margin-top: 3px; font-weight: 500; }
@media (max-width: 480px) {
    .notif-dropdown { width: calc(100vw - 20px); right: -60px; }
}

.delivery-tracker { display: flex; align-items: center; gap: 0; margin: 16px 0; }
.track-step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.track-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--gray-200); color: var(--gray-400); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; z-index: 1; transition: all 0.3s ease; }
.track-dot.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 3px 8px rgba(14,165,233,0.3); }
.track-dot.done { background: linear-gradient(135deg, var(--success), #059669); color: #fff; box-shadow: 0 3px 8px rgba(16,185,129,0.3); }
.track-label { font-size: 0.72rem; color: var(--gray-500); margin-top: 6px; text-align: center; font-weight: 500; }
.track-label.active { color: var(--primary); font-weight: 700; }
.track-line { flex: 1; height: 3px; background: var(--gray-200); min-width: 20px; margin-top: -14px; align-self: flex-start; margin-left: -2px; margin-right: -2px; position: relative; top: 14px; border-radius: 999px; }
.track-line.done { background: linear-gradient(90deg, var(--success), #34D399); }

.lang-toggle {
    font-weight: 600;
    min-width: 44px;
    text-align: center;
    font-family: 'Noto Nastaliq Urdu', var(--font);
}

body.rtl,
[lang="ur"] {
    direction: rtl;
    text-align: right;
    font-family: 'Noto Nastaliq Urdu', 'Noto Naskh Arabic', var(--font);
}

body.rtl .sidebar {
    left: auto;
    right: 0;
}

body.rtl .main-content {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

body.rtl .nav-item {
    text-align: right;
    border-left: none;
    border-right: 3px solid transparent;
}

body.rtl .nav-item:hover {
    border-right-color: rgba(255,255,255,0.3);
}

body.rtl .nav-item.active {
    border-right-color: #38BDF8;
}

body.rtl .nav-item .icon {
    margin-right: 0;
    margin-left: 0.75rem;
}

body.rtl .topbar {
    direction: rtl;
}

body.rtl .topbar-left {
    flex-direction: row-reverse;
}

body.rtl .topbar-right {
    flex-direction: row-reverse;
}

body.rtl .stat-card.primary::before,
body.rtl .stat-card.success::before,
body.rtl .stat-card.warning::before,
body.rtl .stat-card.danger::before,
body.rtl .stat-card.info::before {
    border-radius: var(--radius) var(--radius) 0 0;
}

body.rtl table th {
    text-align: right;
}

body.rtl .text-right {
    text-align: left;
}

body.rtl .modal-footer {
    justify-content: flex-start;
}

body.rtl .modal-header {
    flex-direction: row-reverse;
}

body.rtl .filter-toolbar {
    direction: rtl;
}

body.rtl .filter-buttons {
    margin-left: 0;
    margin-right: auto;
}

body.rtl select.form-control {
    background-position: left 0.75rem center;
    padding-left: 2rem;
    padding-right: 0.75rem;
}

body.rtl .announcement-ticker.ticker-dashboard {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

body.rtl .spinner {
    margin-right: 0;
    margin-left: 0.5rem;
}

body.rtl .toast-container {
    right: auto;
    left: 1rem;
}

body.rtl .notif-dropdown {
    right: auto;
    left: 0;
}

body.rtl .notif-wrapper {
    margin-right: 0;
    margin-left: 12px;
}

body.rtl .card-header {
    flex-direction: row-reverse;
}

body.rtl .badge {
    direction: ltr;
}

@media (max-width: 768px) {
    body.rtl .sidebar {
        transform: translateX(100%);
    }
    body.rtl .sidebar.open {
        transform: translateX(0);
    }
    body.rtl .main-content {
        margin-right: 0;
    }
    body.rtl .announcement-ticker.ticker-dashboard {
        margin-right: 0;
    }
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--gray-300);
    border-radius: 26px;
    transition: background 0.3s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--success), #059669);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.dash-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dash-card {
    border-radius: var(--radius);
    padding: 1.25rem;
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.dash-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-xl);
}

.dash-card-icon {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 2.5rem;
    opacity: 0.2;
    line-height: 1;
}

.dash-card-value {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 2px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.dash-card-label {
    font-size: 0.82rem;
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition);
}

.activity-item:hover {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border-radius: 50%;
}

.activity-text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 500;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--gray-400);
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}

@media (max-width: 768px) {
    .dash-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .dash-card {
        padding: 1rem;
    }
    .dash-card-value {
        font-size: 1.2rem;
    }
    .dash-card-icon {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .dash-cards-grid {
        grid-template-columns: 1fr 1fr;
    }
    .dash-card-value {
        font-size: 1.1rem;
    }
}

.ticker-content-rtl {
    display: inline-block;
    animation: ticker-scroll 30s linear infinite;
    padding-left: 100%;
    font-size: 0.85rem;
    font-weight: 500;
    direction: rtl;
    font-family: 'Noto Nastaliq Urdu', var(--font);
}

.city-picker-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--gray-100);
}

.city-picker-controls .btn {
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
}
