/* ============================================
   CSS VARIABLES - LIGHT MODE (پیش‌فرض)
   ============================================ */
:root {
    /* Primary Colors */
    --primary: #0a5c7e;
    --primary-dark: #064566;
    --primary-light: #e8f4f8;
    --secondary: #2ecc71;
    --secondary-dark: #27ae60;
    --danger: #e74c3c;
    --danger-dark: #c0392b;
    --warning: #f39c12;
    --warning-dark: #d68910;
    --info: #3498db;
    --info-dark: #2980b9;

    /* Neutral Colors - Light */
    --bg-body: #f0f2f5;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f8f9fa;
    --bg-input: #f8f9fa;
    --bg-table-header: #e8f4f8;
    --bg-table-stripe: #fafbfc;
    
    --text-primary: #1a2a3a;
    --text-secondary: #2c3e50;
    --text-muted: #7f8c8d;
    --text-white: #ffffff;
    
    --border-color: #e8ecf0;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    
    --sidebar-bg: linear-gradient(180deg, #0a2a3a 0%, #064566 50%, #0a5c7e 100%);
    --sidebar-text: rgba(255, 255, 255, 0.7);
    --sidebar-text-hover: #ffffff;
    --sidebar-bg-hover: rgba(255, 255, 255, 0.08);
    --sidebar-bg-active: rgba(255, 255, 255, 0.12);
    
    --radius: 15px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 260px;
    --header-height: 70px;
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
    --bg-body: #0d1117;
    --bg-white: #161b22;
    --bg-card: #1c2333;
    --bg-hover: #252d3f;
    --bg-input: #252d3f;
    --bg-table-header: #1c2333;
    --bg-table-stripe: #161b22;
    
    --text-primary: #e6edf3;
    --text-secondary: #c9d1d9;
    --text-muted: #8b949e;
    
    --border-color: #30363d;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    
    --sidebar-bg: linear-gradient(180deg, #0a0e14 0%, #0d1117 50%, #161b22 100%);
    --sidebar-text: rgba(255, 255, 255, 0.5);
    --sidebar-text-hover: #ffffff;
    --sidebar-bg-hover: rgba(255, 255, 255, 0.05);
    --sidebar-bg-active: rgba(255, 255, 255, 0.08);
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    direction: rtl;
    transition: var(--transition);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.theme-toggle:hover {
    background: var(--primary);
    color: var(--text-white);
    transform: rotate(30deg);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

/* ============================================
   APP LAYOUT
   ============================================ */
#app {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

#sidebar::-webkit-scrollbar {
    width: 4px;
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* ===== LOGO ===== */
#sidebar .logo {
    padding: 25px 20px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

#sidebar .logo h2 {
    color: var(--text-white);
    font-weight: 300;
    font-size: 26px;
    letter-spacing: 1px;
    margin: 0;
}

#sidebar .logo h2 span {
    font-weight: 700;
    color: var(--secondary);
}

#sidebar .logo .subtitle {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    margin-top: 4px;
    letter-spacing: 2px;
}

/* ===== USER INFO IN SIDEBAR ===== */
#sidebar .sidebar-user {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

#sidebar .sidebar-user .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--text-white);
    border: 2px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

#sidebar .sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

#sidebar .sidebar-user .user-name {
    color: var(--text-white);
    font-weight: 600;
    font-size: 14px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#sidebar .sidebar-user .user-role {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    display: block;
}

/* ===== NAVIGATION ===== */
#navMenu {
    padding: 10px 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 22px;
    margin: 2px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: none;
    width: calc(100% - 24px);
}

.nav-item:hover {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-bg-hover);
}

.nav-item.active {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-bg-active);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 30px;
    background: var(--secondary);
    border-radius: 0 4px 4px 0;
}

.nav-item i {
    width: 22px;
    font-size: 17px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item .nav-text {
    flex: 1;
}

.nav-item .nav-badge {
    background: var(--danger);
    color: var(--text-white);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.nav-item .nav-badge.warning {
    background: var(--warning);
}

.nav-item .nav-badge.success {
    background: var(--secondary);
}

/* ===== DIVIDER ===== */
.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 8px 20px;
}

/* ===== SECTION TITLE ===== */
.nav-section {
    color: rgba(255, 255, 255, 0.2);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 15px 22px 8px;
    font-weight: 700;
}

/* ===== FOOTER ===== */
#sidebar .sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

#sidebar .sidebar-footer .version {
    color: rgba(255, 255, 255, 0.2);
    font-size: 11px;
    text-align: center;
}

/* ============================================
   TOGGLE SIDEBAR BUTTON
   ============================================ */
.sidebar-toggle {
    display: none;
    position: fixed;
    right: 15px;
    top: 15px;
    z-index: 1001;
    background: var(--primary);
    color: var(--text-white);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
#mainContent {
    flex: 1;
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   TOP BAR
   ============================================ */
#topBar {
    background: var(--bg-white);
    padding: 0 30px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

#topBar .search-box {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0 18px;
    transition: var(--transition);
    flex: 1;
    max-width: 400px;
}

#topBar .search-box:focus-within {
    background: var(--bg-white);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 92, 126, 0.1);
}

[data-theme="dark"] #topBar .search-box:focus-within {
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.15);
}

#topBar .search-box i {
    color: var(--text-muted);
    font-size: 14px;
}

#topBar .search-box input {
    border: none;
    background: transparent;
    padding: 10px 12px;
    font-size: 14px;
    width: 100%;
    outline: none;
    color: var(--text-primary);
}

#topBar .search-box input::placeholder {
    color: var(--text-muted);
}

#topBar .topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

#topBar .topbar-right .notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    padding: 5px;
}

#topBar .topbar-right .notification-btn:hover {
    color: var(--primary);
}

#topBar .topbar-right .notification-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: var(--text-white);
    font-size: 9px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

#topBar .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

#topBar .user-info:hover {
    background: var(--bg-hover);
}

#topBar .user-info span {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

#topBar .user-info .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
    transition: var(--transition);
}

#topBar .user-info .avatar:hover {
    background: var(--primary);
    color: var(--text-white);
}

/* ============================================
   PAGE CONTENT
   ============================================ */
#pageContent {
    padding: 25px 30px 30px;
    flex: 1;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h1 {
    font-size: 24px;
    color: var(--text-primary);
    margin: 0;
}

.page-header h1 i {
    color: var(--primary);
    margin-left: 10px;
}

.page-header .date-display {
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    padding: 22px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 12px;
}

.stat-card .stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

/* ============================================
   CHARTS GRID
   ============================================ */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.chart-card h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 16px;
}

/* ============================================
   RECENT ACTIVITIES
   ============================================ */
.recent-activities {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 10px;
}

.activity-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.activity-card h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 16px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    transition: var(--transition);
}

.activity-item:hover {
    background: var(--bg-input);
}

.activity-item .time {
    color: var(--text-muted);
    font-size: 12px;
    min-width: 50px;
}

.activity-item .patient {
    font-weight: 600;
    flex: 1;
    color: var(--text-primary);
}

.activity-item .doctor {
    color: var(--primary);
}

.activity-item .phone {
    color: var(--text-muted);
}

.activity-item .date {
    color: var(--text-muted);
    font-size: 12px;
}

/* ============================================
   TABLE
   ============================================ */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    transition: var(--transition);
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
}

.table-container thead {
    background: var(--bg-table-header);
}

.table-container th {
    padding: 14px 15px;
    text-align: right;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table-container td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}

.table-container tbody tr {
    transition: var(--transition);
}

.table-container tbody tr:hover {
    background: var(--bg-hover);
}

.table-container tbody tr:nth-child(even) {
    background: var(--bg-table-stripe);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-blue {
    background: #e8f4f8;
    color: #0a5c7e;
}

[data-theme="dark"] .badge-blue {
    background: #1a3a4a;
    color: #7ab8d4;
}

.badge-pink {
    background: #fce4ec;
    color: #c62828;
}

[data-theme="dark"] .badge-pink {
    background: #4a1a2a;
    color: #e87a8a;
}

.badge-success {
    background: #e8f8ec;
    color: #1a8b4c;
}

[data-theme="dark"] .badge-success {
    background: #1a3a2a;
    color: #5ad88a;
}

.badge-warning {
    background: #fef3e8;
    color: #d68910;
}

[data-theme="dark"] .badge-warning {
    background: #4a3a1a;
    color: #f0c050;
}

.badge-danger {
    background: #fde8e8;
    color: #c0392b;
}

[data-theme="dark"] .badge-danger {
    background: #4a1a1a;
    color: #e87060;
}

.badge-info {
    background: #e8f0fe;
    color: #1a5c8b;
}

[data-theme="dark"] .badge-info {
    background: #1a2a4a;
    color: #6aa8e8;
}

.badge-secondary {
    background: #e8e8e8;
    color: #666666;
}

[data-theme="dark"] .badge-secondary {
    background: #2a2a2a;
    color: #999999;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.03);
}

.btn-success {
    background: var(--secondary);
    color: var(--text-white);
}

.btn-success:hover {
    background: var(--secondary-dark);
    transform: scale(1.03);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-white);
}

.btn-danger:hover {
    background: var(--danger-dark);
    transform: scale(1.03);
}

.btn-secondary {
    background: var(--text-muted);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: var(--text-secondary);
    transform: scale(1.03);
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 16px;
}

.btn-icon {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    margin: 0 3px;
}

.btn-icon:hover {
    background: var(--primary);
    color: var(--text-white);
    transform: scale(1.1);
}

.btn-icon.danger:hover {
    background: var(--danger);
    color: var(--text-white);
}

/* ============================================
   LOADING & ERROR
   ============================================ */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.loading-spinner i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
}

.error-container {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.error-container i {
    font-size: 48px;
    color: var(--danger);
    margin-bottom: 15px;
}

.error-container h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-body);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(46, 204, 113, 0.05) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    z-index: 1;
}

.login-box {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px 35px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-header h1 {
    font-size: 32px;
    color: var(--text-primary);
    margin: 0;
}

.login-header h1 span {
    color: var(--secondary);
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 8px;
    font-weight: 500;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}

.login-box .form-group label i {
    margin-left: 8px;
    color: var(--primary);
}

.login-box .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    transition: var(--transition);
    background: var(--bg-input);
    color: var(--text-primary);
    direction: ltr;
}

.login-box .form-group input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(10, 92, 126, 0.1);
    background: var(--bg-white);
}

[data-theme="dark"] .login-box .form-group input:focus {
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.15);
}

.login-box .form-group input::placeholder {
    color: var(--text-muted);
}

.login-error {
    background: #fde8e8;
    border: 1px solid #f5c6c6;
    color: #c0392b;
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    animation: shake 0.5s ease;
}

[data-theme="dark"] .login-error {
    background: #4a1a1a;
    border-color: #6a2a2a;
    color: #e87060;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    #sidebar {
        transform: translateX(calc(100% + 10px));
        width: 280px;
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #sidebar.open + .sidebar-overlay,
    .sidebar-overlay.active {
        display: block;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #mainContent {
        margin-right: 0;
    }

    #topBar {
        padding: 0 15px;
    }

    #pageContent {
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .recent-activities {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    #sidebar {
        width: 100%;
        max-width: 320px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    #topBar .search-box {
        max-width: 120px;
        padding: 0 10px;
    }

    #topBar .search-box input {
        padding: 8px 8px;
        font-size: 12px;
    }

    #topBar .user-info span {
        display: none;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .login-box {
        padding: 30px 20px;
    }

    .login-header h1 {
        font-size: 26px;
    }
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    width: 95%;
}

.modal-small { max-width: 400px; }
.modal-medium { max-width: 600px; }
.modal-large { max-width: 800px; }

.modal-box .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

.modal-box .modal-header h2 {
    font-size: 20px;
    color: var(--text-primary);
    margin: 0;
}

.modal-box .modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    padding: 5px;
}

.modal-box .modal-close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-box .modal-body {
    margin-bottom: 20px;
    max-height: calc(90vh - 180px);
    overflow-y: auto;
}

.modal-box .modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
}

/* ============================================
   PATIENT PROFILE
   ============================================ */
.patient-profile .profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.patient-profile .avatar-large {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--primary);
    flex-shrink: 0;
}

.patient-profile .profile-info h2 {
    margin: 0 0 6px 0;
    color: var(--text-primary);
}

.patient-profile .profile-info p {
    margin: 4px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.patient-profile .profile-info p i {
    color: var(--primary);
    width: 20px;
}

.patient-profile .profile-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.patient-profile .profile-details-grid div {
    padding: 10px 14px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}

.patient-profile .profile-details-grid div strong {
    color: var(--text-primary);
    display: block;
    font-size: 12px;
    margin-bottom: 2px;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: 100%;
}

.toast {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border-right: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s ease;
    border: 1px solid var(--border-color);
}

.toast.toast-success { border-right-color: var(--secondary); }
.toast.toast-error { border-right-color: var(--danger); }
.toast.toast-warning { border-right-color: var(--warning); }
.toast.toast-info { border-right-color: var(--info); }

.toast i {
    font-size: 20px;
    flex-shrink: 0;
}

.toast.toast-success i { color: var(--secondary); }
.toast.toast-error i { color: var(--danger); }
.toast.toast-warning i { color: var(--warning); }
.toast.toast-info i { color: var(--info); }

.toast span {
    flex: 1;
    font-size: 14px;
}

.toast .toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0 5px;
    transition: var(--transition);
}

.toast .toast-close:hover {
    color: var(--danger);
}

.toast.toast-hide {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination .page-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    color: var(--text-secondary);
}

.pagination .page-btn:hover:not(:disabled):not(.active) {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.pagination .page-btn.active {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary);
}

.pagination .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .pagination-info {
    color: var(--text-muted);
    font-size: 13px;
    margin-right: 10px;
}

/* ============================================
   RESPONSIVE MODAL
   ============================================ */
@media (max-width: 768px) {
    .modal-box {
        padding: 20px;
        max-width: 100%;
        margin: 10px;
        max-height: 95vh;
    }
    
    .modal-small,
    .modal-medium,
    .modal-large {
        max-width: 100%;
    }

    .patient-profile .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .patient-profile .profile-details-grid {
        grid-template-columns: 1fr;
    }

    .modal-box .modal-footer {
        flex-wrap: wrap;
    }

    .modal-box .modal-footer button {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }
}

/* ============================================
   FILTERS BAR - جستجو و فیلترها
   ============================================ */
.filters-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    background: var(--bg-card);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    align-items: center;
    transition: var(--transition);
}

.filters-bar .search-input {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.filters-bar .search-input i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition);
}

.filters-bar .search-input input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: var(--transition);
}

.filters-bar .search-input input:focus {
    border-color: var(--primary);
    outline: none;
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(10, 92, 126, 0.1);
}

[data-theme="dark"] .filters-bar .search-input input:focus {
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.15);
}

.filters-bar .search-input input::placeholder {
    color: var(--text-muted);
}

.filters-bar .filter-select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 120px;
    cursor: pointer;
    transition: var(--transition);
}

.filters-bar .filter-select:focus {
    border-color: var(--primary);
    outline: none;
}

/* ============================================
   BUTTONS - دکمه‌های مختلف
   ============================================ */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(10, 92, 126, 0.3);
}

.btn-success {
    background: var(--secondary);
    color: var(--text-white);
}

.btn-success:hover {
    background: var(--secondary-dark);
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-white);
}

.btn-danger:hover {
    background: var(--danger-dark);
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-secondary {
    background: var(--text-muted);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: var(--text-secondary);
    transform: scale(1.03);
}

.btn-warning {
    background: var(--warning);
    color: var(--text-white);
}

.btn-warning:hover {
    background: var(--warning-dark);
    transform: scale(1.03);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--text-white);
    transform: scale(1.03);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   PATIENT FORM - فرم ثبت بیمار
   ============================================ */
.patient-form {
    padding: 5px 0;
}

.patient-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.patient-form .form-group {
    margin-bottom: 16px;
}

.patient-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.patient-form .form-group label .required {
    color: var(--danger);
    margin-right: 2px;
}

.patient-form .form-group input,
.patient-form .form-group select,
.patient-form .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
}

.patient-form .form-group input:focus,
.patient-form .form-group select:focus,
.patient-form .form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(10, 92, 126, 0.08);
}

[data-theme="dark"] .patient-form .form-group input:focus,
[data-theme="dark"] .patient-form .form-group select:focus,
[data-theme="dark"] .patient-form .form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.12);
}

.patient-form .form-group input::placeholder,
.patient-form .form-group textarea::placeholder {
    color: var(--text-muted);
}

.patient-form .form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.patient-form .form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237f8c8d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 35px;
}

.patient-form .form-group select option {
    background: var(--bg-white);
    color: var(--text-primary);
}

/* ============================================
   FORM VALIDATION
   ============================================ */
.patient-form .form-group .field-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.patient-form .form-group.error input,
.patient-form .form-group.error select,
.patient-form .form-group.error textarea {
    border-color: var(--danger);
    background: rgba(231, 76, 60, 0.04);
}

.patient-form .form-group.error .field-error {
    display: block;
}

/* ============================================
   TABLE CONTAINER
   ============================================ */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    transition: var(--transition);
}

.table-container .table-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.table-container .table-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
}

.table-container .table-header .table-actions {
    display: flex;
    gap: 8px;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
}

.table-container thead {
    background: var(--bg-table-header);
}

.table-container thead th {
    padding: 14px 16px;
    text-align: right;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--bg-table-header);
}

.table-container tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
    vertical-align: middle;
}

.table-container tbody tr {
    transition: var(--transition);
}

.table-container tbody tr:hover {
    background: var(--bg-hover);
}

.table-container tbody tr:nth-child(even) {
    background: var(--bg-table-stripe);
}

.table-container .empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.table-container .empty-state i {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
    color: var(--text-muted);
}

/* ============================================
   TABLE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .table-container table {
        font-size: 13px;
    }
    
    .table-container thead th,
    .table-container tbody td {
        padding: 8px 10px;
    }
    
    .table-container .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-container .table-header .table-actions {
        flex-wrap: wrap;
    }
}

/* ============================================
   PATIENT PROFILE (نمایش اطلاعات بیمار)
   ============================================ */
.patient-profile .profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.patient-profile .avatar-large {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--primary);
    flex-shrink: 0;
    border: 3px solid var(--primary);
}

[data-theme="dark"] .patient-profile .avatar-large {
    background: rgba(10, 92, 126, 0.2);
    border-color: rgba(46, 204, 113, 0.3);
}

.patient-profile .profile-info {
    flex: 1;
}

.patient-profile .profile-info h2 {
    margin: 0 0 6px 0;
    color: var(--text-primary);
    font-size: 22px;
}

.patient-profile .profile-info p {
    margin: 4px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.patient-profile .profile-info p i {
    color: var(--primary);
    width: 22px;
    margin-left: 6px;
}

.patient-profile .profile-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.patient-profile .profile-details-grid > div {
    padding: 10px 14px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.patient-profile .profile-details-grid > div:hover {
    background: var(--bg-input);
}

.patient-profile .profile-details-grid > div strong {
    color: var(--text-primary);
    display: block;
    font-size: 12px;
    margin-bottom: 3px;
    font-weight: 600;
}

/* ============================================
   RESPONSIVE PATIENT PROFILE
   ============================================ */
@media (max-width: 768px) {
    .patient-profile .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .patient-profile .profile-details-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
    width: 100%;
}

.toast {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border-right: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s ease;
    border: 1px solid var(--border-color);
    border-right-width: 4px;
}

.toast-success { border-right-color: var(--secondary); }
.toast-error { border-right-color: var(--danger); }
.toast-warning { border-right-color: var(--warning); }
.toast-info { border-right-color: var(--info); }

.toast i {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-success i { color: var(--secondary); }
.toast-error i { color: var(--danger); }
.toast-warning i { color: var(--warning); }
.toast-info i { color: var(--info); }

.toast span {
    flex: 1;
    font-size: 14px;
}

.toast .toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0 5px;
    transition: var(--transition);
}

.toast .toast-close:hover {
    color: var(--danger);
}

.toast-hide {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(calc(100% + 20px));
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(calc(100% + 20px));
        opacity: 0;
    }
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    padding: 10px 0;
}

.pagination .page-btn {
    padding: 8px 14px;
    min-width: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

.pagination .page-btn:hover:not(:disabled):not(.active) {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .page-btn.active {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary);
}

.pagination .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination .pagination-info {
    color: var(--text-muted);
    font-size: 13px;
    margin-right: 10px;
}

/* ============================================
   STATS MINI
   ============================================ */
.stats-mini {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.stats-mini span {
    color: var(--text-muted);
    font-size: 13px;
}

.stats-mini strong {
    color: var(--text-primary);
    margin-right: 4px;
}

/* ============================================
   MODAL IMPROVEMENTS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    width: 95%;
}

.modal-small { max-width: 400px; }
.modal-medium { max-width: 600px; }
.modal-large { max-width: 850px; }

.modal-box .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

.modal-box .modal-header h2 {
    font-size: 20px;
    color: var(--text-primary);
    margin: 0;
}

.modal-box .modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    padding: 5px 8px;
    border-radius: var(--radius-sm);
}

.modal-box .modal-close:hover {
    color: var(--danger);
    background: rgba(231, 76, 60, 0.1);
}

.modal-box .modal-body {
    margin-bottom: 20px;
    max-height: calc(90vh - 180px);
    overflow-y: auto;
}

.modal-box .modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-box .modal-body::-webkit-scrollbar-track {
    background: var(--bg-body);
}

.modal-box .modal-body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.modal-box .modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters-bar .search-input {
        min-width: auto;
    }
    
    .filters-bar .filter-select {
        min-width: auto;
    }
    
    .modal-box {
        padding: 20px;
        margin: 10px;
        max-height: 95vh;
    }
    
    .modal-small,
    .modal-medium,
    .modal-large {
        max-width: 100%;
    }
    
    .patient-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 576px) {
    .btn {
        font-size: 12px;
        padding: 8px 16px;
    }
    
    .btn-sm {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .filters-bar {
        padding: 12px 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .pagination .page-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 30px;
    }
    
    .toast-container {
        max-width: 95%;
        left: 10px;
        right: 10px;
        top: 10px;
    }
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-actions {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.quick-actions h3 {
    color: var(--text-primary);
    font-size: 16px;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-actions h3 i {
    color: var(--warning);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-hover);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
    width: 100%;
}

.quick-action-btn:hover {
    background: var(--bg-input);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.quick-action-btn .quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.quick-action-btn .quick-action-info {
    flex: 1;
    min-width: 0;
}

.quick-action-btn .quick-action-title {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.quick-action-btn .quick-action-desc {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

/* ============================================
   RESPONSIVE QUICK ACTIONS
   ============================================ */
@media (max-width: 992px) {
    .quick-actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .quick-action-btn {
        padding: 12px 14px;
        flex-direction: column;
        text-align: center;
    }
    
    .quick-action-btn .quick-action-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
    
    .quick-action-btn .quick-action-desc {
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    .quick-actions {
        padding: 15px;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .quick-action-btn {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .quick-action-btn .quick-action-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .quick-action-btn .quick-action-title {
        font-size: 12px;
    }
    
    .quick-action-btn .quick-action-desc {
        display: none;
    }
}

/* ============================================
   INLINE PATIENT FORM
   ============================================ */
#inlinePatientForm {
    animation: slideDown 0.3s ease;
}

#inlinePatientForm .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

#inlinePatientForm .form-group {
    margin-bottom: 10px;
}

#inlinePatientForm .form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

#inlinePatientForm .form-group input,
#inlinePatientForm .form-group select,
#inlinePatientForm .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-white);
    color: var(--text-primary);
    transition: var(--transition);
}

#inlinePatientForm .form-group input:focus,
#inlinePatientForm .form-group select:focus,
#inlinePatientForm .form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 92, 126, 0.1);
}

#inlinePatientForm .btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

@media (max-width: 768px) {
    #inlinePatientForm .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   APPOINTMENT FORM
   ============================================ */
.appointment-form {
    padding: 5px 0;
}

.appointment-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.appointment-form .form-group {
    margin-bottom: 18px;
}

.appointment-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.appointment-form .form-group label .required {
    color: var(--danger);
    margin-right: 2px;
}

.appointment-form .form-group input,
.appointment-form .form-group select,
.appointment-form .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
}

.appointment-form .form-group input:focus,
.appointment-form .form-group select:focus,
.appointment-form .form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(10, 92, 126, 0.08);
}

[data-theme="dark"] .appointment-form .form-group input:focus,
[data-theme="dark"] .appointment-form .form-group select:focus,
[data-theme="dark"] .appointment-form .form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.12);
}

.appointment-form .form-group input::placeholder,
.appointment-form .form-group textarea::placeholder {
    color: var(--text-muted);
}

.appointment-form .form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.appointment-form .form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237f8c8d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 35px;
}

.appointment-form .form-group select option {
    background: var(--bg-white);
    color: var(--text-primary);
}

/* ============================================
   INLINE PATIENT FORM (داخل فرم نوبت)
   ============================================ */
#inlinePatientForm {
    animation: slideDown 0.3s ease;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 15px;
    margin-top: 10px;
}

#inlinePatientForm .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

#inlinePatientForm .form-group {
    margin-bottom: 10px;
}

#inlinePatientForm .form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

#inlinePatientForm .form-group label .required {
    color: var(--danger);
}

#inlinePatientForm .form-group input,
#inlinePatientForm .form-group select,
#inlinePatientForm .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-white);
    color: var(--text-primary);
    transition: var(--transition);
}

#inlinePatientForm .form-group input:focus,
#inlinePatientForm .form-group select:focus,
#inlinePatientForm .form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 92, 126, 0.1);
}

#inlinePatientForm .form-group textarea {
    min-height: 50px;
}

/* ============================================
   RESPONSIVE APPOINTMENT FORM
   ============================================ */
@media (max-width: 768px) {
    .appointment-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    #inlinePatientForm .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .appointment-form .form-group {
        margin-bottom: 14px;
    }
}

/* ============================================
   APPOINTMENT FORM
   ============================================ */
.appointment-form {
    padding: 5px 0;
}

.appointment-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.appointment-form .form-group {
    margin-bottom: 18px;
}

.appointment-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.appointment-form .form-group label .required {
    color: var(--danger);
    margin-right: 2px;
}

.appointment-form .form-group .form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
}

.appointment-form .form-group .form-control:focus {
    border-color: var(--primary);
    outline: none;
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(10, 92, 126, 0.08);
}

[data-theme="dark"] .appointment-form .form-group .form-control:focus {
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.12);
}

.appointment-form .form-group .form-control::placeholder {
    color: var(--text-muted);
}

.appointment-form .form-group textarea.form-control {
    resize: vertical;
    min-height: 60px;
}

.appointment-form .form-group select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237f8c8d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 35px;
}

.appointment-form .form-group select.form-control option {
    background: var(--bg-white);
    color: var(--text-primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .appointment-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .appointment-form .form-group {
        margin-bottom: 14px;
    }
}

/* ============================================
   APPOINTMENT FORM - NEW STYLES
   ============================================ */
.appointment-form .form-help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.appointment-form .patient-info-section,
.appointment-form .appointment-info-section {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-bottom: 18px;
    border: 1px solid var(--border-color);
}

.appointment-form .section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.appointment-form .section-title i {
    color: var(--primary);
}

.appointment-form .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
    margin-top: 5px;
}

.appointment-form .form-actions .btn {
    min-width: 120px;
    justify-content: center;
}

/* ============================================
   APPOINTMENT FORM - COMPLETE STYLES
   ============================================ */
.appointment-form .form-help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.appointment-form .patient-info-section,
.appointment-form .appointment-info-section {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-bottom: 18px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.appointment-form .patient-info-section:hover,
.appointment-form .appointment-info-section:hover {
    border-color: var(--primary);
}

.appointment-form .section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.appointment-form .section-title i {
    color: var(--primary);
}

.appointment-form .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
    margin-top: 5px;
}

.appointment-form .form-actions .btn {
    min-width: 120px;
    justify-content: center;
}

.appointment-form .form-group select:disabled,
.appointment-form .form-group input:disabled,
.appointment-form .form-group textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-input);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .appointment-form .form-actions {
        flex-direction: column-reverse;
    }
    
    .appointment-form .form-actions .btn {
        width: 100%;
    }
}

/* ============================================
   DOCTOR FORM
   ============================================ */
.doctor-form {
    padding: 5px 0;
}

.doctor-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.doctor-form .form-group {
    margin-bottom: 16px;
}

.doctor-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.doctor-form .form-group label .required {
    color: var(--danger);
    margin-right: 2px;
}

.doctor-form .form-group input,
.doctor-form .form-group select,
.doctor-form .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
}

.doctor-form .form-group input:focus,
.doctor-form .form-group select:focus,
.doctor-form .form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(10, 92, 126, 0.08);
}

[data-theme="dark"] .doctor-form .form-group input:focus,
[data-theme="dark"] .doctor-form .form-group select:focus,
[data-theme="dark"] .doctor-form .form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.12);
}

.doctor-form .form-group input::placeholder,
.doctor-form .form-group textarea::placeholder {
    color: var(--text-muted);
}

.doctor-form .form-group textarea {
    resize: vertical;
    min-height: 60px;
}

@media (max-width: 768px) {
    .doctor-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

}

/* ============================================
   LAB FORM
   ============================================ */
.lab-form {
    padding: 5px 0;
}

.lab-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.lab-form .form-group {
    margin-bottom: 16px;
}

.lab-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.lab-form .form-group label .required {
    color: var(--danger);
    margin-right: 2px;
}

.lab-form .form-group input,
.lab-form .form-group select,
.lab-form .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
}

.lab-form .form-group input:focus,
.lab-form .form-group select:focus,
.lab-form .form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(10, 92, 126, 0.08);
}

[data-theme="dark"] .lab-form .form-group input:focus,
[data-theme="dark"] .lab-form .form-group select:focus,
[data-theme="dark"] .lab-form .form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.12);
}

.lab-form .form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.lab-form .form-help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

@media (max-width: 768px) {
    .lab-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}


/* ============================================
   LAB FORM - COMPLETE STYLES
   ============================================ */
.lab-form {
    padding: 5px 0;
}

.lab-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.lab-form .form-group {
    margin-bottom: 16px;
}

.lab-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.lab-form .form-group label .required {
    color: var(--danger);
    margin-right: 2px;
}

.lab-form .form-group input,
.lab-form .form-group select,
.lab-form .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
}

.lab-form .form-group input:focus,
.lab-form .form-group select:focus,
.lab-form .form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(10, 92, 126, 0.08);
}

[data-theme="dark"] .lab-form .form-group input:focus,
[data-theme="dark"] .lab-form .form-group select:focus,
[data-theme="dark"] .lab-form .form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.12);
}

.lab-form .form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.lab-form .form-help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.lab-form .patient-info-section,
.lab-form .lab-info-section {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-bottom: 18px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.lab-form .patient-info-section:hover,
.lab-form .lab-info-section:hover {
    border-color: var(--primary);
}

.lab-form .section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lab-form .section-title i {
    color: var(--primary);
}

.lab-form .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
    margin-top: 5px;
}

.lab-form .form-actions .btn {
    min-width: 120px;
    justify-content: center;
}

@media (max-width: 768px) {
    .lab-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .lab-form .form-actions {
        flex-direction: column-reverse;
    }
    
    .lab-form .form-actions .btn {
        width: 100%;
    }
}

/* ============================================
   TRANSACTION FORM
   ============================================ */
.transaction-form {
    padding: 5px 0;
    transition: border-color 0.3s ease;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    padding: 15px;
}

.transaction-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.transaction-form .form-group {
    margin-bottom: 16px;
}

.transaction-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.transaction-form .form-group label .required {
    color: var(--danger);
    margin-right: 2px;
}

.transaction-form .form-group input,
.transaction-form .form-group select,
.transaction-form .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
}

.transaction-form .form-group input:focus,
.transaction-form .form-group select:focus,
.transaction-form .form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(10, 92, 126, 0.08);
}

[data-theme="dark"] .transaction-form .form-group input:focus,
[data-theme="dark"] .transaction-form .form-group select:focus,
[data-theme="dark"] .transaction-form .form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.12);
}

.transaction-form .form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.transaction-form .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
    margin-top: 5px;
}

.transaction-form .form-actions .btn {
    min-width: 120px;
    justify-content: center;
}

@media (max-width: 768px) {
    .transaction-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .transaction-form .form-actions {
        flex-direction: column-reverse;
    }
    
    .transaction-form .form-actions .btn {
        width: 100%;
    }
}

/* ============================================
   FINANCE PAGE
   ============================================ */
.finance-page {
    padding: 0;
}

/* Stats Cards */
.finance-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.finance-stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.finance-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.finance-stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.finance-stat-card.income .stat-icon {
    background: #e8f8ec;
    color: #2ecc71;
}

.finance-stat-card.expense .stat-icon {
    background: #fde8e8;
    color: #e74c3c;
}

.finance-stat-card.balance .stat-icon {
    background: #e8f4f8;
    color: #0a5c7e;
}

.finance-stat-card.profit .stat-icon {
    background: #f0e8fe;
    color: #9b59b6;
}

.finance-stat-card.appointment .stat-icon {
    background: #e8f0fe;
    color: #3498db;
}

.finance-stat-card.lab .stat-icon {
    background: #fef3e8;
    color: #f39c12;
}

.finance-stat-card .stat-info {
    flex: 1;
}

.finance-stat-card .stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 2px;
}

.finance-stat-card .stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Filters */
.finance-filters {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.finance-filters .filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.finance-filters .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    transition: var(--transition);
    flex: 1;
    min-width: 150px;
}

.finance-filters .filter-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 92, 126, 0.08);
}

.finance-filters .filter-group i {
    color: var(--text-muted);
    font-size: 14px;
}

.finance-filters .filter-group input,
.finance-filters .filter-group select {
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 14px;
    width: 100%;
    outline: none;
    color: var(--text-primary);
}

.finance-filters .filter-group select {
    cursor: pointer;
}

.finance-filters .filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

/* Table */
.finance-table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.finance-table-container table {
    width: 100%;
    border-collapse: collapse;
}

.finance-table-container thead {
    background: var(--bg-table-header);
}

.finance-table-container th {
    padding: 14px 16px;
    text-align: right;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.finance-table-container td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
    vertical-align: middle;
}

.finance-table-container tbody tr:hover {
    background: var(--bg-hover);
}

.finance-table-container .amount {
    font-weight: 700;
}

.finance-table-container .amount.income {
    color: #2ecc71;
}

.finance-table-container .amount.expense {
    color: #e74c3c;
}

.finance-table-container .category-badge {
    background: var(--bg-hover);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.finance-table-container .empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.finance-table-container .empty-state i {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .finance-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .finance-filters .filter-row {
        flex-direction: column;
    }
    
    .finance-filters .filter-group {
        width: 100%;
        min-width: auto;
    }
    
    .finance-table-container {
        overflow-x: auto;
    }
    
    .finance-table-container table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .finance-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   FINANCE TABLE - ADDITIONAL STYLES
   ============================================ */
.finance-table-container .badge-info {
    background: #e8f4f8;
    color: #0a5c7e;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
}

[data-theme="dark"] .finance-table-container .badge-info {
    background: #1a3a4a;
    color: #7ab8d4;
}

.finance-table-container .badge-warning {
    background: #fef3e8;
    color: #d68910;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
}

[data-theme="dark"] .finance-table-container .badge-warning {
    background: #4a3a1a;
    color: #f0c050;
}

.finance-table-container .badge-secondary {
    background: #e8e8e8;
    color: #666;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
}

[data-theme="dark"] .finance-table-container .badge-secondary {
    background: #2a2a2a;
    color: #999;
}