/* OSR - Styles */
/* Brand Colors: Primary Red #EA0029, White #F3F3F3, Dark #333333 */

:root {
    /* Brand Colors */
    --sal-red: #EA0029;
    --sal-red-dark: #c70023;
    --sal-dark-red: #660033;

    /* Light Theme */
    --bg-primary: #F3F3F3;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e0e0e0;
    --input-bg: #F9FAFB;
    --input-border: #D1D5DB;
    --sidebar-bg: #EA0029;
    --sidebar-text: #ffffff;

    /* Status Colors */
    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.1);
    --error: #EF4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.1);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition: all 0.3s ease;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #16213e;
    --text-primary: #F3F3F3;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --border-color: #2a2a4a;
    --input-bg: #1a1a2e;
    --input-border: #3a3a5a;
    --sidebar-bg: #0f0f1a;
    --sidebar-text: #F3F3F3;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

[dir="rtl"] {
    font-family: 'Segoe UI', 'Arial', Tahoma, sans-serif;
}

/* ============== Sidebar ============== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* الشعار المدموج SAL|إمداد صورة واحدة بكامل عرض القائمة - العرض ثابت زي ما هو */
.sidebar-lockup {
    width: 100%;
    height: auto;
    display: block;
}

/* legacy - kept only so old cached pages don't break */
.sidebar-logo {
    height: 33px;
    width: auto;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #ffffff;
}

[dir="rtl"] .nav-item.active::before {
    left: auto;
    right: 0;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background-color: #ffffff;
    color: var(--sal-red);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
}

[dir="rtl"] .nav-badge {
    margin-left: 0;
    margin-right: auto;
}

.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item.logout:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ============== Main Wrapper ============== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin 0.3s ease;
}

[dir="rtl"] .main-wrapper {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

/* ============== Top Header ============== */
.top-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Collapsible sidebar on desktop: the toggle slides the menu away and lets the
   content take the full width. State lives on <html> so it can be restored
   before first paint (see base.html). */
@media (min-width: 769px) {
    .menu-toggle { display: flex; }

    .sidebar-collapsed .sidebar { transform: translateX(-100%); }
    [dir="rtl"] .sidebar-collapsed .sidebar { transform: translateX(100%); }

    .sidebar-collapsed .main-wrapper { margin-left: 0; }
    [dir="rtl"] .sidebar-collapsed .main-wrapper { margin-right: 0; }
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background-color: var(--sal-red);
    border-color: var(--sal-red);
    color: #ffffff;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Theme Toggle Icons */
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.lang-toggle {
    font-weight: 600;
    font-size: 0.875rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-color);
}

[dir="rtl"] .user-info {
    padding-left: 0;
    padding-right: 0.75rem;
    border-left: none;
    border-right: 1px solid var(--border-color);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--sal-red);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ============== Page Content ============== */
.page-content {
    padding: 1.5rem;
    min-height: calc(100vh - var(--header-height));
}

/* ============== Alerts ============== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-error {
    background-color: var(--error-bg);
    color: var(--error);
    border: 1px solid var(--error);
}

.alert-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

/* ============== Cards ============== */
.card {
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.25rem;
}

/* ============== Stats Cards ============== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--sal-red);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.red {
    background-color: rgba(234, 0, 41, 0.1);
    color: var(--sal-red);
}

.stat-icon.green {
    background-color: var(--success-bg);
    color: var(--success);
}

.stat-icon.orange {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.stat-icon.blue {
    background-color: var(--info-bg);
    color: var(--info);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============== Buttons ============== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background-color: var(--sal-red);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--sal-red-dark);
}

.btn-secondary {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background-color: #1da34a;
}

.btn-danger {
    background-color: var(--error);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* ============== Forms ============== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--sal-red);
    box-shadow: 0 0 0 3px rgba(234, 0, 41, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ============== Tables ============== */
.table-container {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

.table th {
    background-color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: var(--bg-primary);
}

/* ============== Status Badges ============== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success);
}

.badge-error {
    background-color: var(--error-bg);
    color: var(--error);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.badge-info {
    background-color: var(--info-bg);
    color: var(--info);
}

.badge-secondary {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
}

.badge-returned {
    background-color: #fff8e1;
    color: #e65100;
}

/* ============== Comments / Conversation ============== */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* Show ~4 comments, then scroll */
    max-height: 25rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.comment-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--bg-primary);
    border-radius: 8px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--sal-red);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.comment-author {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.comment-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-type-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.comment-type-badge.return {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.comment-type-badge.resubmit {
    background-color: var(--info-bg);
    color: var(--info);
}

.comment-type-badge.approve {
    background-color: var(--success-bg);
    color: var(--success);
}

.comment-type-badge.reject {
    background-color: var(--error-bg);
    color: var(--error);
}

/* ============== Grid Layout ============== */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ============== Employee Cards ============== */
.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.employee-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    transition: var(--transition);
    cursor: pointer;
}

.employee-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--sal-red);
}

.employee-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.employee-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--sal-red);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
}

.employee-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.employee-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.employee-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.employee-info-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.employee-info-row svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* ============== Request Cards ============== */
.request-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

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

.request-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.request-id {
    font-weight: 600;
    color: var(--sal-red);
}

.request-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    font-size: 0.875rem;
}

.request-meta-item {
    color: var(--text-secondary);
}

.request-meta-item strong {
    color: var(--text-primary);
}

/* ============== Approval Timeline ============== */
.approval-timeline {
    position: relative;
    padding-left: 2rem;
}

[dir="rtl"] .approval-timeline {
    padding-left: 0;
    padding-right: 2rem;
}

.approval-step {
    position: relative;
    padding-bottom: 1.5rem;
}

.approval-step:last-child {
    padding-bottom: 0;
}

.approval-step::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}

[dir="rtl"] .approval-step::before {
    left: auto;
    right: -1.5rem;
}

.approval-step:last-child::before {
    display: none;
}

.approval-dot {
    position: absolute;
    left: -1.75rem;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background-color: var(--bg-secondary);
}

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

.approval-step.approved .approval-dot {
    border-color: var(--success);
    background-color: var(--success);
}

.approval-step.rejected .approval-dot {
    border-color: var(--error);
    background-color: var(--error);
}

.approval-step.pending .approval-dot {
    border-color: var(--warning);
    background-color: var(--warning);
}

.approval-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.approval-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============== Tabs ============== */
.tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--sal-red);
    border-bottom-color: var(--sal-red);
}

/* ============== Empty State ============== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* ============== Progress Bar ============== */
.progress {
    height: 8px;
    background-color: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--sal-red);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ============== Mobile Sidebar ============== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* ============== Action Buttons Group ============== */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============== Section Header ============== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============== Filters ============== */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.search-box input {
    padding-left: 2.5rem;
}

[dir="rtl"] .search-box input {
    padding-left: 0.875rem;
    padding-right: 2.5rem;
}

.search-box svg {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

[dir="rtl"] .search-box svg {
    left: auto;
    right: 0.875rem;
}

.filter-select {
    min-width: 150px;
}

/* ============== View Toggle ============== */
.view-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.view-toggle button {
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-secondary);
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.view-toggle button:hover {
    background-color: var(--bg-primary);
}

.view-toggle button.active {
    background-color: var(--sal-red);
    color: #ffffff;
}

.view-toggle button svg {
    width: 18px;
    height: 18px;
}

/* ============== Modal ============== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    background-color: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .modal-content {
    background-color: #1a1a2e;
}

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

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

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

    .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    [dir="rtl"] .main-wrapper {
        margin-right: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .user-name {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .form-row, .form-row-3 {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .employee-grid {
        grid-template-columns: 1fr;
    }

    .request-meta {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 1rem;
    }

    .top-header {
        padding: 0 1rem;
    }

    .page-title {
        font-size: 1rem;
    }
}

/* ============== Print Styles ============== */
@media print {
    .sidebar,
    .top-header,
    .btn,
    .filters {
        display: none !important;
    }

    .main-wrapper {
        margin: 0 !important;
    }

    .page-content {
        padding: 0;
    }
}

/* Prominent "New Request" button at top of the sidebar */
.nav-new-request {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0.75rem 1rem;
    padding: 0.75rem 1rem;
    background: #ffffff;
    color: var(--sal-red);
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: var(--transition);
}
.nav-new-request:hover {
    background: #fff5f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.nav-new-request svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
