/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #1F2937;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --info-color: #3B82F6;
    --light-bg: #F9FAFB;
    --white: #ffffff;
    --text-dark: #111827;
    --text-light: #6B7280;
    --border-color: #E5E7EB;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --sidebar-width: 280px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    color: var(--text-dark);
    direction: rtl;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1F2937 0%, #111827 100%);
    color: var(--white);
    padding: 0;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-header i {
    margin-left: 0.75rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 0;
}

.sidebar-menu li {
    margin: 0.25rem 0.75rem;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.sidebar-menu li a i {
    margin-left: 1rem;
    font-size: 1.25rem;
    width: 1.5rem;
}

.sidebar-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--white);
    transform: translateX(-2px);
}

.sidebar-menu li.active a {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.sidebar-menu li.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--white);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ===== Main Content ===== */
.main-content {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    transition: margin 0.3s ease;
}

/* ===== Header ===== */
.header {
    background: var(--white);
    padding: 1.25rem 2rem;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.98);
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0.625rem;
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-sidebar:hover {
    background-color: var(--light-bg);
    transform: scale(1.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    background: var(--light-bg);
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.user-info:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.user-info i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

/* ===== Pages ===== */
.page {
    display: none;
    padding: 30px;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.page-header h1 {
    color: var(--text-dark);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn i {
    font-size: 16px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #4338CA;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #DC2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

.btn-secondary {
    background: var(--text-light);
    color: var(--white);
}

.btn-secondary:hover {
    background: #6c757d;
}

/* ===== Statistics Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 3px solid var(--primary-color);
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--primary-color);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--white);
    background: var(--primary-color);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.stat-success .stat-icon {
    background: var(--success-color);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.stat-success::before {
    background: var(--success-color);
}

.stat-warning .stat-icon {
    background: var(--warning-color);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.stat-warning::before {
    background: var(--warning-color);
}

.stat-info .stat-icon {
    background: var(--info-color);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.stat-info::before {
    background: var(--info-color);
}

.stat-primary .stat-icon {
    background: #8B5CF6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.stat-primary::before {
    background: #8B5CF6;
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

/* ===== Charts ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.chart-card h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 600;
}

/* ===== Tables ===== */
.table-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.table-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom, #FAFAFA, #FFFFFF);
}

.table-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--secondary-color);
    color: var(--white);
}

.data-table th {
    padding: 1rem 1.25rem;
    text-align: right;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.data-table tbody tr:hover {
    background-color: #F9FAFB;
    transform: scale(1.001);
}

.data-table tbody tr:nth-child(even) {
    background-color: #FAFAFA;
}

.data-table tbody tr:nth-child(even):hover {
    background-color: #F3F4F6;
}

.data-table td {
    padding: 1rem 1.25rem;
    text-align: right;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

/* ===== Status Badges ===== */
.badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-primary {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.badge-secondary {
    background: rgba(107, 114, 128, 0.1);
    color: #6B7280;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* ===== Filter Section ===== */
.filter-section {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 180px;
    flex: 1;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.filter-input {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #FAFAFA;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: var(--white);
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-input {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: #FAFAFA;
    transition: all 0.2s ease;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: var(--white);
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    bottom: -1px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.875rem;
    letter-spacing: -0.01em;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    background: #FAFAFA;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: var(--white);
    transform: translateY(-1px);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* ===== Settings ===== */
.settings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.settings-card {
    background: var(--white);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.settings-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.settings-card h3 {
    margin-bottom: 1.25rem;
    color: var(--text-dark);
    font-size: 1.125rem;
    font-weight: 600;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: -0.01em;
}

.settings-section {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.settings-section h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 600;
}

.status-list {
    margin-bottom: 20px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
    margin-bottom: 10px;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    padding: 1.25rem;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, #FAFAFA, #FFFFFF);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-full);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.75rem;
}

.modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #FAFAFA;
}

/* ===== Action Buttons ===== */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
}

.action-btn-view {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.action-btn-view:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn-edit {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.action-btn-edit:hover {
    background: var(--warning-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.action-btn-delete:hover {
    background: var(--danger-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.action-btn-success:hover {
    background: var(--success-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== Location Card ===== */
.location-card {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.location-card h4 {
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 16px;
}

.location-areas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.area-tag {
    background: var(--white);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-dark);
}

/* ===== Stat Value ===== */
.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 10px;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .settings-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page {
        padding: 20px 15px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filter-section {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    .modal {
        max-width: 100%;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 15px;
    }

    .user-info {
        font-size: 14px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        margin: 0 auto;
    }

    .btn {
        padding: 10px 15px;
        font-size: 13px;
    }

    .action-buttons {
        flex-direction: column;
    }
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #9CA3AF 0%, #6B7280 100%);
    border-radius: var(--radius-full);
    border: 2px solid #F3F4F6;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6B7280 0%, #4B5563 100%);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.empty-state p {
    font-size: 14px;
}

/* ===== Loading Spinner ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Animation Keyframes ===== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* ===== Hover Effects ===== */
.stat-card:hover {
    animation: pulse 0.5s ease;
}

.action-btn:active {
    animation: pulse 0.2s ease;
}

/* ===== Loading States ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===== Tooltip ===== */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--text-dark);
    color: var(--white);
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    animation: fadeIn 0.3s ease;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-dark);
    z-index: 1000;
}

/* ===== Success Animation ===== */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.success-checkmark .check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid var(--success-color);
}

.success-checkmark .check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.success-checkmark .check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

@keyframes rotate-circle {
    0% {
        transform: rotate(-45deg);
    }
    5% {
        transform: rotate(-45deg);
    }
    12% {
        transform: rotate(-405deg);
    }
    100% {
        transform: rotate(-405deg);
    }
}

/* ===== Custom Scrollbar for Modal ===== */
.modal::-webkit-scrollbar {
    width: 6px;
}

.modal::-webkit-scrollbar-track {
    background: transparent;
}

.modal::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 3px;
}

/* ===== Ripple Effect ===== */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* ===== Skeleton Loading ===== */
.skeleton {
    animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
    0% {
        background-color: hsl(200, 20%, 80%);
    }
    100% {
        background-color: hsl(200, 20%, 95%);
    }
}

.skeleton-text {
    width: 100%;
    height: 0.7rem;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
}

.skeleton-text:last-child {
    margin-bottom: 0;
    width: 80%;
}

/* ===== Notifications ===== */
.notifications {
    position: relative;
    margin-left: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.notifications:hover {
    background: rgba(79, 70, 229, 0.08);
}

.notifications i {
    font-size: 1.25rem;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.notifications:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, var(--danger-color), #DC2626);
    color: white;
    border-radius: var(--radius-full);
    width: 1.125rem;
    height: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: bold;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    border: 2px solid white;
}

.notification-dropdown {
    position: absolute;
    top: 3.75rem;
    left: 1.25rem;
    width: 22rem;
    max-height: 31.25rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--light-bg);
}

.notification-header h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-dark);
}

.btn-clear-all {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.btn-clear-all:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: start;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.notification-item:hover {
    background-color: #F9FAFB;
    transform: translateX(-2px);
}

.notification-item.unread {
    background-color: rgba(79, 70, 229, 0.05);
    border-left: 3px solid var(--primary-color);
}

.notification-item.empty {
    text-align: center;
    color: var(--text-light);
    cursor: default;
}

.notification-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.notification-icon.callback {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(79, 70, 229, 0.15));
    color: var(--primary-color);
}

.notification-icon.followup {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.15));
    color: #8B5CF6;
}

.notification-icon.shipment {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.15));
    color: var(--success-color);
}

.notification-icon.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.15));
    color: var(--warning-color);
}

.notification-content {
    flex: 1;
}

.notification-message {
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 5px;
    line-height: 1.4;
}

.notification-time {
    font-size: 12px;
    color: var(--text-light);
}

.notification-callback-time {
    font-size: 12px;
    color: var(--primary-color);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.notification-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.notification-close:hover {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

/* ===== Status Breakdown ===== */
.status-breakdown {
    margin: 20px 0;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.breakdown-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.breakdown-card h3 {
    margin-bottom: 15px;
    color: var(--text-dark);
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: var(--light-bg);
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.breakdown-item:hover {
    transform: translateX(-5px);
}

.breakdown-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
}

.breakdown-item-count {
    font-weight: bold;
    color: var(--primary-color);
}

/* ===== Areas List ===== */
.areas-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.area-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--light-bg);
    border-radius: 8px;
    margin-bottom: 10px;
}

.area-item span {
    color: var(--text-dark);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.btn-icon:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

/* ===== Status Badge with Icon ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: white;
}

/* ===== Header Actions ===== */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== Filters Card ===== */
.filters-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 5px;
    font-weight: 500;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ===== Form Card ===== */
.form-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-card h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
}

/* ===== Card Header ===== */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    margin: 0;
}

.stats-badge {
    background: var(--light-bg);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

.stats-badge strong {
    color: var(--primary-color);
    font-size: 18px;
    margin-right: 5px;
}

/* ===== Text Colors ===== */
.text-success {
    color: var(--success-color) !important;
    font-weight: 500;
}

.text-danger {
    color: var(--danger-color) !important;
    font-weight: 500;
}

.text-warning {
    color: var(--warning-color) !important;
    font-weight: 500;
}

/* ===== Total Row in Tables ===== */
.total-row {
    background-color: var(--light-bg);
    font-weight: bold;
}

.total-row td {
    padding: 15px 12px !important;
}

/* ===== Print Styles ===== */
@media print {
    .sidebar,
    .header,
    .btn,
    .action-buttons,
    .filter-section,
    .filters-card,
    .tabs {
        display: none !important;
    }

    .main-content {
        margin: 0;
    }

    .page {
        padding: 0;
    }

    .table-card,
    .chart-card,
    .stat-card {
        box-shadow: none;
        page-break-inside: avoid;
    }
}

/* ===== Warehouse Specific Styles ===== */
.settlement-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settlement-info-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.settlement-info-card h3 {
    margin-bottom: 15px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.settlement-info-card p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 20px;
}

.settlement-actions {
    margin: 20px 0;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 16px;
}

.settlement-summary {
    background-color: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.settlement-summary h4 {
    margin-bottom: 15px;
    color: var(--text-dark);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-label {
    font-size: 14px;
    color: var(--text-light);
}

.summary-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background-color: var(--light-bg);
    border-radius: 8px;
}

.detail-item strong {
    font-size: 13px;
    color: var(--text-light);
}

.detail-item span {
    font-size: 15px;
    color: var(--text-dark);
}

.settlement-details {
    max-height: 70vh;
    overflow-y: auto;
}

.settlement-details h4 {
    color: var(--text-dark);
    margin-bottom: 10px;
}

/* ===== Status Badge Variants ===== */
.status-badge.status-success {
    background-color: var(--success-color);
}

.status-badge.status-warning {
    background-color: var(--warning-color);
}

.status-badge.status-danger {
    background-color: var(--danger-color);
}

.status-badge.status-info {
    background-color: var(--info-color);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .notification-dropdown {
        width: 300px;
        left: 10px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
    }

    .breakdown-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }
}

/* Profit Reports Styles */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

#profit-reports-page .stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

#profit-reports-page .table-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

#profit-reports-page .table-responsive {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

#profit-reports-page .data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#profit-reports-page .data-table thead th {
    color: white;
    font-weight: 600;
    padding: 12px;
}

#profit-reports-page .data-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Enhanced Profit Reports Styles */
#profit-reports-page .stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

#profit-reports-page .stat-card:hover {
    transform: translateY(-5px);
}

#profit-reports-page .stat-icon {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

#profit-reports-page .table-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

#profit-reports-page .table-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

#profit-reports-page .table-responsive {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

#profit-reports-page .data-table {
    margin: 0;
}

#profit-reports-page .data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#profit-reports-page .data-table thead th {
    color: white;
    font-weight: 600;
    padding: 15px 12px;
    border: none;
}

#profit-reports-page .data-table tbody tr {
    transition: all 0.2s ease;
}

#profit-reports-page .data-table tbody tr:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
}

#profit-reports-page .data-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
}

#profit-reports-page .badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#profit-reports-page .btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

#profit-reports-page .btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
}

#profit-reports-page .btn-sm:hover {
    transform: translateY(-2px);
