/* ================== Persian Font ================== */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* ================== Variables ================== */
:root {
    --primary-color: #2196F3;
    --primary-dark: #1976D2;
    --primary-light: #BBDEFB;
    --secondary-color: #4CAF50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #00bcd4;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
    
    --sidebar-width: 280px;
    --header-height: 70px;
    --transition: all 0.3s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-card: #242424;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #404040;
    --shadow: 0 2px 10px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.4);
}

/* Dark Mode - Table Overrides */
[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-active-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    background-color: transparent;
}

[data-theme="dark"] .table > :not(caption) > * > * {
    background-color: transparent;
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .table thead th {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .table tbody tr {
    background-color: transparent;
}

[data-theme="dark"] .table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .table-responsive {
    background-color: transparent;
}

[data-theme="dark"] .data-table {
    background-color: var(--bg-card);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.25rem rgba(33, 150, 243, 0.25);
}

[data-theme="dark"] .modal-content {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-header {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .modal-footer {
    border-top-color: var(--border-color);
}

[data-theme="dark"] .alert {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

[data-theme="dark"] .alert-info {
    background-color: rgba(0, 188, 212, 0.1);
    border-color: rgba(0, 188, 212, 0.3);
    color: #4dd0e1;
}

[data-theme="dark"] .alert-success {
    background-color: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
    color: #81c784;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.3);
    color: #e57373;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(255, 152, 0, 0.1);
    border-color: rgba(255, 152, 0, 0.3);
    color: #ffb74d;
}

/* Dark Mode - Cards */
[data-theme="dark"] .card {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .card-header {
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .card-body {
    background-color: transparent;
}

/* Dark Mode - Dropdowns */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Dark Mode - Breadcrumb */
[data-theme="dark"] .breadcrumb {
    background-color: transparent;
}

[data-theme="dark"] .breadcrumb-item,
[data-theme="dark"] .breadcrumb-item a {
    color: var(--text-secondary);
}

[data-theme="dark"] .breadcrumb-item.active {
    color: var(--text-primary);
}

/* Dark Mode - List Group */
[data-theme="dark"] .list-group-item {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Dark Mode - Nav Tabs */
[data-theme="dark"] .nav-tabs {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: var(--text-secondary);
    border-color: transparent;
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: var(--border-color) var(--border-color) var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--bg-card);
    border-color: var(--border-color) var(--border-color) var(--bg-card);
    color: var(--text-primary);
}

/* Dark Mode - Input Placeholder */
[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .form-select::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Dark Mode - Text Muted */
[data-theme="dark"] .text-muted {
    color: var(--text-secondary) !important;
}

/* Dark Mode - Border */
[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end {
    border-color: var(--border-color) !important;
}

/* Dark Mode - Background Colors */
[data-theme="dark"] .bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .bg-white {
    background-color: var(--bg-card) !important;
}

/* ================== Base Styles ================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
    direction: rtl;
}

html, body {
    overflow-x: hidden;
}

/* Force Persian Font for All Elements (Except Font Awesome Icons) */
*:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad) {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}

a {
    text-decoration: none;
    color: inherit;
}

input, 
button, 
select, 
textarea,
.form-control,
.btn,
.form-select {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* ================== Theme Toggle ================== */
/* Theme toggle in header inherits from .header-icon */
.header-icon.theme-toggle {
    /* All styles inherited from .header-icon */
}

/* Theme toggle in login page (fixed position) */
.login-page .theme-toggle {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
}

.login-page .theme-toggle:hover {
    box-shadow: var(--shadow-lg);
    transform: scale(1.1);
}

.login-page .theme-toggle:focus {
    outline: none;
}

/* ================== Login Page ================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-card {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
    animation: fadeInUp 0.5s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 20px;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.login-header h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px 10px;
}

.demo-credentials {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: var(--shadow);
}

.demo-credentials h6 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* ================== Dashboard Layout ================== */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
}

/* Sidebar Overlay (for mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 15px;
}

.sidebar-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-primary);
    transition: var(--transition);
    position: relative;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
}

.sidebar-menu a i {
    width: 25px;
    margin-left: 12px;
    text-align: center;
}

.sidebar-badge {
    margin-right: auto;
    background: var(--danger-color);
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.75rem;
}

/* Main Content */
.main-content {
    margin-right: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    background: var(--bg-secondary);
}

/* Header */
.dashboard-header {
    background: var(--bg-card);
    height: var(--header-height);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.search-box {
    position: relative;
}

.search-box input {
    width: 300px;
    padding: 8px 40px 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.header-icon:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.header-icon:focus {
    outline: none;
}

.header-icon:active {
    transform: scale(0.95);
}

.header-icon .badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 25px;
    transition: var(--transition);
    position: relative;
}

.user-menu:hover {
    background: var(--bg-secondary);
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    left: auto;
    width: 220px;
    max-width: calc(100vw - 30px);
    background: var(--bg-card);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
    overflow: hidden;
    animation: fadeInDown 0.3s ease;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    text-align: center;
}

.user-dropdown-header .avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.user-dropdown-header h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
}

.user-dropdown-header small {
    opacity: 0.9;
}

.user-dropdown-menu {
    padding: 10px 0;
}

.user-dropdown-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: right;
}

.user-dropdown-item:hover {
    background: var(--bg-secondary);
}

.user-dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.user-dropdown-item.logout {
    color: var(--danger-color);
    border-top: 1px solid var(--border-color);
    margin-top: 5px;
}

.user-dropdown-item.logout i {
    color: var(--danger-color);
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-info h6 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.user-info small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Content Area */
.content-area {
    padding: 30px;
}

.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
}

/* Cards */
.stat-card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

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

.stat-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.stat-card.primary .icon {
    background: rgba(33, 150, 243, 0.1);
    color: var(--primary-color);
}

.stat-card.success .icon {
    background: rgba(76, 175, 80, 0.1);
    color: var(--secondary-color);
}

.stat-card.danger .icon {
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger-color);
}

.stat-card.warning .icon {
    background: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
}

.stat-card.info .icon {
    background: rgba(0, 188, 212, 0.1);
    color: var(--info-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

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

.stat-change {
    margin-top: 10px;
    font-size: 0.85rem;
}

.stat-change.positive {
    color: var(--secondary-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* Table */
.data-table {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.table {
    color: var(--text-primary);
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    padding: 15px;
}

.table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

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

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.btn-icon {
    width: 35px;
    height: 35px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Forms */
.form-control,
.form-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 15px;
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.25);
}

.form-label {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
}

/* Modal */
.modal-content {
    background: var(--bg-card);
    border-radius: 15px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 25px;
}

.modal-title {
    color: var(--text-primary);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 20px 25px;
}

.btn-close {
    filter: var(--bs-btn-close-filter, invert(1));
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Delete Modal Styles */
.modal-header.bg-danger {
    background-color: var(--danger-color) !important;
    border-bottom: none;
}

.modal-header.bg-danger .modal-title,
.modal-header.bg-danger .btn-close {
    color: white !important;
}

.btn-close-white {
    filter: brightness(0) invert(1);
}

/* Notifications Dropdown */
.notifications-dropdown {
    position: absolute;
    top: 60px;
    left: 0;
    width: 380px;
    background: var(--bg-card);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    display: none;
    max-height: 500px;
    overflow: hidden;
    z-index: 1050;
}

.notifications-dropdown.show {
    display: flex;
    flex-direction: column;
    animation: fadeInDown 0.3s ease;
}

/* Notifications Header */
.notifications-header {
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-header h6 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.notifications-header h6 i {
    color: var(--primary-color);
    margin-left: 8px;
}

.notifications-header .btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: var(--transition);
}

.notifications-header .btn-link:hover {
    background: rgba(33, 150, 243, 0.1);
}

/* Notifications List */
.notifications-list {
    flex: 1;
    overflow-y: auto;
    max-height: 350px;
}

.notifications-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.notifications-empty i {
    font-size: 48px;
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 10px;
}

.notifications-empty p {
    margin: 0;
    font-size: 14px;
}

/* Notification Item */
.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    gap: 12px;
    position: relative;
}

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

.notification-item:hover {
    background: var(--bg-secondary);
}

.notification-item.unread {
    background: rgba(33, 150, 243, 0.05);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
}

.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(33, 150, 243, 0.1);
}

.notification-icon.text-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--secondary-color);
}

.notification-icon.text-warning {
    background: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
}

.notification-icon.text-danger {
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger-color);
}

.notification-icon.text-info {
    background: rgba(0, 188, 212, 0.1);
    color: var(--info-color);
}

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

.notification-title {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.notification-message {
    margin: 0 0 5px 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
}

.notification-time i {
    margin-left: 3px;
}

/* Notifications Footer */
.notifications-footer {
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.notifications-footer .btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.notifications-footer .btn-link:hover {
    color: var(--primary-dark);
}

.notifications-footer .btn-link i {
    margin-right: 5px;
}

/* Badge Pulse Animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
}

.badge.pulse {
    animation: pulse 2s infinite;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ================== Responsive Table Cards ================== */
.table-card {
    display: none;
}

.table-cards-container {
    display: none;
}

/* ================== Responsive Design ================== */

/* Tablet View (992px and below) */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
        width: 100%;
    }
    
    .menu-toggle {
        display: block;
        font-size: 1.5rem;
    }
    
    .search-box input {
        width: 220px;
        font-size: 0.9rem;
    }
    
    .user-info {
        display: none;
    }
    
    .content-area {
        padding: 20px 15px;
    }
    
    .dashboard-header {
        padding: 0 20px;
    }
    
    /* Better modal sizing for tablets */
    .modal-lg {
        max-width: 90%;
    }
}

/* Mobile View (768px and below) */
@media (max-width: 768px) {
    /* ===== Layout Adjustments ===== */
    .content-area {
        padding: 15px 10px;
    }
    
    .dashboard-header {
        height: 60px;
        padding: 0 15px;
    }
    
    .header-left {
        gap: 10px;
    }
    
    .header-right {
        gap: 12px;
    }
    
    .page-title {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }
    
    .page-header {
        margin-bottom: 20px;
    }
    
    /* ===== Hide Search Box on Mobile ===== */
    .search-box {
        display: none;
    }
    
    /* ===== Stat Cards Optimization ===== */
    .stat-card {
        margin-bottom: 15px;
        padding: 20px 15px;
    }
    
    .stat-card .icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: 12px;
    }
    
    .stat-value {
        font-size: 1.6rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    .stat-change {
        font-size: 0.8rem;
        margin-top: 8px;
    }
    
    /* ===== Notifications Dropdown ===== */
    .notifications-dropdown {
        width: calc(100vw - 30px);
        max-width: 350px;
        right: 15px;
        left: auto;
    }
    
    .user-dropdown {
        position: fixed;
        top: 60px;
        right: 15px;
        left: 15px;
        width: auto;
        max-width: none;
    }
    
    /* ===== Header Icons Touch-Friendly ===== */
    .header-icon {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* ===== Table to Card Conversion ===== */
    .table-responsive table {
        display: none;
    }
    
    .table-cards-container {
        display: block;
    }
    
    .table-card {
        display: block;
        background: var(--bg-card);
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: var(--shadow);
        border: 1px solid var(--border-color);
        transition: var(--transition);
    }
    
    .table-card:active {
        transform: scale(0.98);
        box-shadow: var(--shadow-lg);
    }
    
    .table-card-header {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--primary-color);
        margin-bottom: 15px;
        padding-bottom: 12px;
        border-bottom: 2px solid var(--primary-color);
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .table-card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        min-height: 40px;
    }
    
    .table-card-row:last-of-type {
        border-bottom: none;
    }
    
    .table-card-label {
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.85rem;
        flex-shrink: 0;
        min-width: 100px;
    }
    
    .table-card-value {
        color: var(--text-primary);
        text-align: left;
        flex: 1;
        word-break: break-word;
        font-size: 0.9rem;
    }
    
    .table-card-actions {
        display: flex;
        gap: 8px;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 2px solid var(--border-color);
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .table-card-actions .btn {
        flex: 1;
        min-width: 80px;
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    /* ===== Buttons Optimization ===== */
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .btn-icon {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    /* Touch-friendly button spacing */
    .data-table .d-flex.justify-content-between {
        flex-direction: column;
        gap: 15px;
        align-items: stretch !important;
    }
    
    .data-table .d-flex.justify-content-between > div {
        width: 100%;
    }
    
    .data-table .d-flex.justify-content-between .btn {
        width: 100%;
    }
    
    /* ===== Form Improvements ===== */
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 15px;
        border-radius: 8px;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .modal-body .row .col-md-6 {
        margin-bottom: 15px;
    }
    
    /* ===== Modal Optimization ===== */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-lg,
    .modal-xl {
        max-width: calc(100% - 20px);
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0 !important;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    /* ===== Data Table Mobile Optimization ===== */
    .data-table {
        padding: 15px;
        border-radius: 12px;
        margin-bottom: 15px;
    }
    
    .data-table h5 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    /* ===== Sidebar Mobile ===== */
    .sidebar {
        width: 280px;
    }
    
    .sidebar-menu a {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
    
    .sidebar-menu a i {
        font-size: 1.1rem;
    }
    
    /* ===== Breadcrumb Mobile ===== */
    .breadcrumb {
        font-size: 0.85rem;
    }
    
    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 5px;
    }
    
    /* ===== Badge Sizing ===== */
    .badge {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
    
    /* ===== Alert Mobile ===== */
    .alert {
        font-size: 0.9rem;
        padding: 12px 15px;
    }
    
    /* ===== Login Page Mobile ===== */
    .login-card {
        padding: 30px 20px;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
    
    .login-header .logo {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .demo-credentials {
        padding: 15px;
        font-size: 0.9rem;
    }
}

/* Extra Small Mobile (480px and below) */
@media (max-width: 480px) {
    .dashboard-header {
        height: 55px;
        padding: 0 10px;
    }
    
    .content-area {
        padding: 10px 8px;
    }
    
    .page-title {
        font-size: 1.2rem;
    }
    
    .header-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .stat-card {
        padding: 15px 12px;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    .table-card {
        padding: 12px;
    }
    
    .table-card-header {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .table-card-label {
        font-size: 0.8rem;
        min-width: 90px;
    }
    
    .table-card-value {
        font-size: 0.85rem;
    }
    
    .table-card-actions .btn {
        min-width: 70px;
        padding: 7px 10px;
        font-size: 0.8rem;
    }
    
    .btn-icon {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .modal-body {
        padding: 12px;
    }
    
    .modal-header,
    .modal-footer {
        padding: 12px;
    }
    
    .data-table {
        padding: 12px;
    }
    
    .notifications-dropdown {
        width: calc(100vw - 20px);
        right: 10px;
    }
}

@media (max-width: 768px) {
    .user-dropdown {
        position: fixed;
        width: calc(100vw - 20px);
        right: 10px;
        left: auto;
        top: 55px;
        max-width: none;
    }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-body {
        max-height: calc(100vh - 150px);
    }
    
    .sidebar {
        width: 250px;
    }
    
    .dashboard-header {
        height: 55px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn,
    .form-control,
    .form-select,
    a {
        min-height: 44px; /* Apple's recommended minimum */
    }
    
    /* Remove hover effects on touch devices */
    .stat-card:hover {
        transform: none;
    }
    
    /* Add active states instead */
    .btn:active {
        transform: scale(0.96);
    }
    
    .table-card:active {
        transform: scale(0.98);
        background: var(--bg-secondary);
    }
    
    .sidebar-menu a:active {
        background: var(--primary-light);
    }
    
    /* Larger hit areas for icons */
    .header-icon {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .dashboard-header,
    .theme-toggle,
    .btn,
    .page-header {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        width: 100%;
    }
    
    .data-table {
        box-shadow: none;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Loading Spinner */
.spinner-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;
}

.spinner-border-custom {
    width: 3rem;
    height: 3rem;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 90px;
    left: 20px;
    z-index: 9999;
}

.toast {
    background: var(--bg-card);
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: 10px;
    margin-bottom: 10px;
}

.toast-header {
    background: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.toast-body {
    color: var(--text-primary);
}

/* ================== Logout Modal ================== */
#logoutModal .modal-dialog {
    max-width: 450px;
}

#logoutModal .modal-header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-bottom: none;
    padding: 1.5rem;
}

#logoutModal .modal-body {
    padding: 2rem;
}

#logoutModal .modal-body i.fa-exclamation-triangle {
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

#logoutModal .modal-footer {
    border-top: none;
    padding: 1rem 2rem 2rem;
}

#logoutModal .btn {
    min-width: 120px;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#logoutModal .btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

#logoutModal .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Dark Mode Support */
[data-theme="dark"] #logoutModal .modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

/* ================== Avatar Upload ================== */
.user-avatar {
    transition: all 0.3s ease;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#avatarPreviewModal .modal-body img {
    transition: transform 0.3s ease;
}

#avatarPreviewModal .modal-body img:hover {
    transform: scale(1.05);
}

/* Avatar camera button hover effect */
.position-relative .btn-primary {
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.position-relative .btn-primary:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.5);
}

/* Remove avatar button */
#removeAvatarBtn {
    transition: all 0.3s ease;
}

#removeAvatarBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* ================== Bulk Payment Modal ================== */
#bulkPaymentModal .modal-dialog {
    max-width: 1200px;
}

#bulkPaymentModal .modal-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-bottom: none;
    padding: 1.5rem;
}

#bulkPaymentModal .table-responsive {
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#bulkPaymentModal thead {
    background: var(--bg-secondary);
}

#bulkPaymentModal thead th {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

#bulkPaymentModal tbody tr {
    transition: background-color 0.2s ease;
}

#bulkPaymentModal tbody tr:hover {
    background-color: rgba(40, 167, 69, 0.05);
}

#bulkPaymentModal .bulk-loan-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #28a745;
}

#bulkPaymentModal .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

#bulkPaymentSummary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #28a745;
    border-radius: 8px;
    padding: 1.25rem;
}

#bulkPaymentSummary h6 {
    color: #28a745;
    font-weight: 600;
    margin-bottom: 1rem;
}

#bulkPaymentSummary .row > div {
    padding: 0.5rem 0;
}

#bulkSelectedCount {
    font-size: 0.95rem;
}

#bulkSelectedCount strong {
    color: #28a745;
    font-size: 1.1rem;
}

#bulkPaymentSubmitBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#bulkPaymentSubmitBtn:not(:disabled):hover {
    background: #20c997;
    border-color: #20c997;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    transition: all 0.3s ease;
}

/* Select All Checkbox */
#selectAllCheckbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #28a745;
}

#selectAllCheckbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Dark Mode Support for Bulk Payment Modal */
[data-theme="dark"] #bulkPaymentModal .modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] #bulkPaymentModal thead {
    background: var(--bg-secondary);
}

[data-theme="dark"] #bulkPaymentModal tbody tr:hover {
    background-color: rgba(40, 167, 69, 0.1);
}

[data-theme="dark"] #bulkPaymentSummary {
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    border-left-color: #28a745;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #bulkPaymentModal .modal-dialog {
        max-width: 95%;
        margin: 0.5rem auto;
    }
    
    #bulkPaymentModal thead th {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }
    
    #bulkPaymentModal tbody td {
        font-size: 0.85rem;
        padding: 0.5rem 0.25rem;
    }
    
    #bulkPaymentSummary .row > div {
        font-size: 0.85rem;
    }
}

