/* ============================================= */
/* === Revolutionary AW Office UI Framework v9.0 === */
/* ============================================= */

/**
 * Redesigned CSS Framework for AW Office Account Manager Pro
 * Features: Modern Design, Enhanced Responsiveness, 
 * Dynamic Theming, and Improved Accessibility
 * 
 * Author: Abdullah Ibrahim Abdel Aal
 * Version: 9.0.0
 * Last Updated: 2025-08-31
 */

/* Root Variables for Theming */
:root {
    --primary: #4a90e2;
    --primary-dark: #357ABD;
    --primary-light: #6AAEF4;
    --secondary: #50e3c2;
    --accent: #f5a623;
    --success: #7ed321;
    --warning: #f8e71c;
    --danger: #d0021b;
    --info: #9013fe;

    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --bg-tertiary: #f0f0f0;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-color: #e6e6e6;
    --border-primary: #e6e6e6;

    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 50%;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);

    /* Simplified Gradients */
    --primary-gradient: linear-gradient(135deg, var(--primary), var(--primary-light));
    --secondary-gradient: linear-gradient(135deg, var(--secondary), #5EEDC7);
    --success-gradient: linear-gradient(135deg, var(--success), #90E247);
    --warning-gradient: linear-gradient(135deg, var(--warning), #FFE033);
    --danger-gradient: linear-gradient(135deg, var(--danger), #E8132F);

    /* Faster Transitions */
    --transition-fast: all 0.15s ease;
    --transition-normal: all 0.2s ease;
    --transition-slow: all 0.3s ease;

    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.3);

    /* Z-Index */
    --z-dropdown: 1000;
    --z-modal: 9999;
}

/* Base Reset and Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    direction: rtl;
}

/* === TABS SYSTEM === */
.tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 0.5rem;
    margin: 2rem 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow-x: auto;
    gap: 0.25rem;
}

.tab {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: fit-content;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.tab.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tab i {
    font-size: 1rem;
}

#tab-contents {
    position: relative;
}

.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === MAIN CONTAINER === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
}

#main-app-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* === APP TITLE === */
.app-title {
    text-align: center;
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.logo-icon {
    width: 60px;
    height: 60px;
}

/* === CONTROLS === */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
    justify-content: space-between;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-item label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.control-item select, .control-item input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: #fff;
    font-family: 'Tajawal', sans-serif;
}

.control-item select:focus, .control-item input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

/* === BUTTONS === */
.btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
}

.btn-outline {
    background: transparent;
}

.current-date {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* === DASHBOARD === */
.dashboard {
    margin-bottom: 2rem;
}

/* === FORMS === */
.form-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-title {
    color: #fff;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #fff;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* === TABLES === */
.table-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow-x: auto;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.table-title {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    position: sticky;
    top: 0;
}

td {
    color: rgba(255, 255, 255, 0.8);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* === DROPDOWN MENUS === */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 250px;
    z-index: 1000;
}

.badge {
    background: #ff4757;
    color: #fff;
    border-radius: 50%;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    position: absolute;
    top: -5px;
    left: -5px;
}

/* === SETTINGS === */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.settings-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.settings-card h3 {
    color: #fff;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subtle-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.subtle-form .form-control {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.settings-list {
    list-style: none;
    padding: 0;
}

.settings-list li {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
}

/* === REPORTS === */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.report-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.report-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.report-card h3 {
    color: #fff;
    margin-bottom: 1rem;
}

.report-card p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

/* === MODAL === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-title {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.modal-message {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-cancel-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* === NOTIFICATION === */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    z-index: 9999;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification-content h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.notification-content p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.toast-icon {
    font-size: 1.5rem;
    color: #4CAF50;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    #main-app-container {
        padding: 1rem;
        margin: 1rem;
        border-radius: 12px;
    }
    
    .app-title {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-item {
        justify-content: space-between;
    }
    
    .tabs {
        overflow-x: auto;
        padding: 0.25rem;
    }
    
    .tab {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        padding: 1rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
    }
}

/* MAS App Shell */
.mas-app-shell {
    min-height: 100vh;
    background: var(--bg-secondary);
}

/* Header Styles */
.mas-header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md);
    position: sticky;
    top: 0;
    z-index: var(--z-dropdown);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    gap: var(--spacing-lg);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-title {
    font-size: var(--font-size-2xl);
    font-weight: bold;
    margin: 0;
}

.title-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation Pills */
.nav-pills {
    display: flex;
    gap: var(--spacing-sm);
    background: var(--bg-primary);
    padding: var(--spacing-sm);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}

.nav-pill:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-pill.active {
    background: var(--primary);
    color: white;
}

/* Main Container */
.mas-main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    min-height: calc(100vh - 80px);
}

/* Cards */
.mas-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-md);
}

.mas-card h2, .mas-card h3 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

/* Buttons */
.mas-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    line-height: 1;
}

.mas-btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.mas-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.mas-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.mas-btn-secondary:hover {
    background: var(--bg-tertiary);
}

/* Forms */
.mas-form-group {
    margin-bottom: var(--spacing-md);
}

.mas-form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.mas-form-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.mas-form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Tables */
.mas-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-md);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.mas-table th,
.mas-table td {
    padding: var(--spacing-md);
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.mas-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.mas-table tr:hover {
    background: var(--bg-secondary);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }

.d-flex { display: flex; }
.d-none { display: none; }
.d-block { display: block; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .nav-pills {
        flex-wrap: wrap;
    }
    
    .nav-pill {
        font-size: var(--font-size-sm);
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .mas-main-container {
        padding: var(--spacing-md);
    }
}

/* Loading States */
.mas-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

/* Global Loading Overlay */
.mas-global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loader-content {
    text-align: center;
    padding: var(--spacing-xl);
}

.pulse-loader {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    justify-content: center;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

.pulse-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.pulse-dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes pulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.loader-text {
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-lg);
}

.loader-progress {
    width: 200px;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    animation: loadingProgress 3s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Notifications */
.mas-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: var(--spacing-md);
    background: var(--success);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-modal);
    transform: translateX(100%);
    transition: var(--transition-normal);
}

.mas-notification.show {
    transform: translateX(0);
}

.mas-notification.error {
    background: var(--danger);
}

.mas-notification.warning {
    background: var(--warning);
    color: var(--text-primary);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-primary: #1e1e2f;
    --bg-secondary: #2c2c3e;
    --bg-tertiary: #353547;
    --text-primary: #f5f5f5;
    --text-secondary: #cccccc;
    --text-tertiary: #888899;
    --border-color: #444455;
    --border-primary: #444455;
    --glass-bg: rgba(30, 30, 47, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* Notifications */
.mas-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: var(--spacing-md);
    background: var(--success);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-modal);
    transform: translateX(100%);
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 300px;
    max-width: 500px;
}

.mas-notification.show {
    transform: translateX(0);
}

.mas-notification.error {
    background: var(--danger);
}

.mas-notification.warning {
    background: var(--warning);
    color: var(--text-primary);
}

.mas-notification.info {
    background: var(--info);
}

.mas-notification i {
    font-size: 18px;
    flex-shrink: 0;
}

.mas-notification span {
    flex: 1;
    font-weight: 500;
}

.close-notification {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.close-notification:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* View Content Styles */
.view-container {
    width: 100%;
}

.view-content {
    display: none;
    width: 100%;
    padding: var(--spacing-md);
}

.view-content.active {
    display: block;
}

/* Form Styles Enhancement */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.form-actions {
    display: flex;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

/* إضافة chart containers */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.chart-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: 300px;
}

.chart-container h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
    text-align: center;
}

.chart-container canvas {
    max-height: 250px;
}

/* Dashboard improvements */
#dashboard-summary {
    margin-bottom: 2rem;
}

#kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.kpi-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}

.kpi-card .value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Table sorting indicators */
th {
    cursor: pointer;
    position: relative;
}

th:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

th.sorted-asc::after {
    content: '↑';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
}

th.sorted-desc::after {
    content: '↓';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
}

/* File upload improvements */
input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

input[type="file"]:hover {
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

/* Search box improvements */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0 1rem;
}

.search-box i {
    color: var(--text-color-secondary);
    margin-left: 0.5rem;
}

.search-box input {
    background: transparent;
    border: none;
    padding: 0.5rem 0;
    color: var(--text-color);
    flex: 1;
}

.search-box input:focus {
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-color-secondary);
}

/* Settings page improvements */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.settings-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    backdrop-filter: blur(10px);
}

.settings-card h3 {
    color: var(--primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.settings-card h3 i {
    font-size: 1.2em;
}

.subtle-form {
    margin-bottom: var(--spacing-lg);
}

.subtle-form .form-group {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-end;
}

.subtle-form .form-control {
    flex: 1;
    margin-bottom: 0;
}

.settings-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.settings-list li span {
    flex: 1;
    color: var(--text-primary);
}

.settings-list li button {
    background: var(--danger);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.settings-list li button:hover {
    background: var(--danger-dark);
    transform: scale(1.05);
}

.settings-list .empty-message {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
}

/* Legacy Container Support */
.container {
    display: block !important;
}

/* Simplified General Reset */
* { box-sizing: border-box; }

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* App Shell */
.mas-app-shell {
    min-height: 100vh;
    background: var(--bg-primary);
}

/* Header */
.mas-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    padding: var(--spacing-md);
    position: sticky;
    top: 0;
    z-index: var(--z-dropdown);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: var(--spacing-lg);
}

/* Navigation */
.nav-pills {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--bg-secondary);
    padding: var(--spacing-xs);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
}

.nav-pill:hover,
.nav-pill.active {
    background: var(--primary);
    color: white;
}

/* Main Content */
.mas-main-content {
    padding: var(--spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
}

/* Smart Breadcrumb */
.smart-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-primary);
}

.breadcrumb-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.breadcrumb-item:hover, .breadcrumb-item.active {
    background: var(--primary-gradient);
    color: white;
}

.breadcrumb-separator {
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
}

.live-datetime {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.datetime-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-xs);
}

.live-time {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.live-date {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* View Container */
.view-container {
    position: relative;
    min-height: 500px;
}

.view-content {
    display: none;
    animation: view-fade-in 0.5s ease-out;
}

.view-content.active {
    display: block;
}

@keyframes view-fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Section */
.welcome-section { margin-bottom: var(--spacing-2xl); }

.welcome-card {
    background: var(--primary-gradient);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-2xl);
    color: white;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: var(--radius-full);
    transform: translate(100px, -100px);
}

.welcome-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-2xl);
}

.welcome-text { flex: 1; }

.welcome-title {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
}

.user-name {
    background: rgba(255, 255, 255, 0.2);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
}

.welcome-subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin: 0;
}

.welcome-visual { display: flex; align-items: center; justify-content: center; }

.financial-indicator { text-align: center; }

.indicator-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-md);
}

.indicator-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-circle { transition: stroke-dashoffset 2s ease-in-out; }

.indicator-value {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.value-number {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    display: block;
    line-height: 1;
}

.value-percent { font-size: var(--font-size-lg); opacity: 0.8; }
.indicator-label { font-size: var(--font-size-sm); opacity: 0.9; margin: 0; }

/* KPI Section */
.kpi-section { margin-bottom: var(--spacing-xl); }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.kpi-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.card-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-lg);
}

.card-body { margin-bottom: var(--spacing-md); }

.metric-value {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.amount {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.currency, .unit {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.metric-trend.positive { color: var(--success); }
.metric-trend.negative { color: var(--danger); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.btn:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
}

.table th,
.table td {
    padding: var(--spacing-md);
    text-align: right;
    border-bottom: 1px solid var(--border-primary);
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .nav-pills {
        width: 100%;
        overflow-x: auto;
    }
    
    .mas-main-content {
        padding: var(--spacing-md);
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .kpi-card {
        padding: var(--spacing-md);
    }
    
    .amount {
        font-size: var(--font-size-xl);
    }
}

/* Print Styles */
@media print {
    .mas-header, .floating-actions, .notifications-panel, .ai-panel { display: none !important; }
    .mas-main-content { padding: 0; max-width: none; }
    .kpi-card, .chart-card { break-inside: avoid; box-shadow: none; border: 1px solid #000; }
}
