:root {
    /* Dark Theme Colors */
    --primary-color: #2b5cff; /* Keeping the Mews blue for accents */
    --primary-hover: #1e45ca;
    --secondary-color: #ffffff; /* White text for dark theme */
    --bg-color: #111827; /* Dark background */
    --surface-color: #1f2937; /* Slightly lighter for cards/sidebar */
    --text-muted: #9ca3af;
    --border-color: #374151;
    
    /* Functional Colors */
    --color-urgent: #f05252; /* Red */
    --color-attention: #ff8a4c; /* Orange */
    --color-success: #31c48d; /* Green */
    --color-neutral: #6b7280; /* Dark Grey */

    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px; 
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);

    --sidebar-width: 280px;
    --header-height: 56px; /* Slightly slimmer like the screenshot */
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--secondary-color);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

button {
    font-family: var(--font-family);
    cursor: pointer;
    border: none;
    background: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--secondary-color);
}

/* Utilities */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.w-full { width: 100%; }

/* RTL specific spacing */
html[dir="rtl"] .stat-icon { margin-left: 1rem; margin-right: 0; }
html[dir="rtl"] .menu-title .icon { margin-left: 0.75rem; margin-right: 0; }
html[dir="rtl"] .menu-title .chevron { margin-right: auto; margin-left: 0; }
html[dir="rtl"] .submenu a { padding: 0.5rem 3.25rem 0.5rem 1.5rem; }
html[dir="rtl"] .header-search input { padding: 0.5rem 2.5rem 0.5rem 1rem; }
html[dir="rtl"] .search-wrapper i { right: 1rem; left: auto; }
html[dir="rtl"] .status-dot { margin-left: 0.5rem; margin-right: 0; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full); 
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

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

/* --- LOGIN PAGE --- */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
}

.login-card {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.login-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: right;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--secondary-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* --- NEW SPLIT-SCREEN LOGIN LAYOUT --- */
.login-split-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    background-color: var(--bg-color);
    overflow: hidden;
}

/* Left Side - Showcase */
.login-showcase {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 3rem;
    position: relative;
    border-right: 1px solid var(--border-color);
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed;
}

.showcase-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
}

.showcase-content {
    position: relative;
    z-index: 2;
    max-width: 350px;
    animation: slideUp 0.6s ease-out;
}

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

.showcase-logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(43, 92, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(43, 92, 255, 0.4);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    margin-bottom: 1.5rem;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary-color);
}

.badge-icon {
    font-size: 16px;
}

.badge-text {
    color: rgba(255, 255, 255, 0.9);
}

.showcase-text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.showcase-title {
    font-size: 28px;
    font-weight: 700;
    color: white;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.showcase-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Right Side - Login Form */
.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background-color: var(--bg-color);
}

.login-card-redesigned {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
}

.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2.5rem;
    text-align: center;
}

.login-logo-redesigned {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), rgba(43, 92, 255, 0.7));
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(43, 92, 255, 0.3);
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.login-description {
    font-size: 14px;
    color: var(--text-muted);
}

/* Form Redesigned */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group-redesigned {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label-redesigned {
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary-color);
    text-align: right;
}

.form-input-redesigned {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: var(--surface-color);
    border: 1.5px solid var(--border-color);
    color: var(--secondary-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
}

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

.form-input-redesigned:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: rgba(43, 92, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(43, 92, 255, 0.1);
}

/* Form Footer - Remember & Forgot */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.5rem 0 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.remember-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.remember-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.forgot-link {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Login Primary Button */
.btn-login-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(43, 92, 255, 0.3);
}

.btn-login-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(43, 92, 255, 0.4);
}

.btn-login-primary:active {
    transform: translateY(0);
}

/* Divider Section */
.divider-section {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.divider-text {
    display: inline-block;
    padding: 0 1rem;
    background-color: var(--bg-color);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

.divider-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border-color);
    z-index: 1;
}

/* Google Login Button */
.btn-google-login {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background-color: var(--surface-color);
    border: 1.5px solid var(--border-color);
    color: var(--secondary-color);
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-google-login:hover {
    background-color: rgba(43, 92, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Responsive Design - Comprehensive for All Devices */

/* Extra Large Screens (1920px and above) - Large Laptops/Desktops */
@media (min-width: 1920px) {
    .login-split-container {
        height: 100vh;
    }

    .login-showcase {
        padding: 4rem;
    }

    .showcase-title {
        font-size: 32px;
        line-height: 1.4;
    }

    .showcase-logo-badge {
        font-size: 14px;
        padding: 0.6rem 1.2rem;
    }

    .login-form-side {
        padding: 4rem;
    }

    .login-card-redesigned {
        max-width: 480px;
    }

    .login-title {
        font-size: 32px;
    }

    .login-description {
        font-size: 15px;
    }

    .form-input-redesigned {
        padding: 1rem 1.2rem;
        font-size: 15px;
    }

    .btn-login-primary,
    .btn-google-login {
        padding: 1rem 2rem;
        font-size: 15px;
    }
}

/* Large Screens (1440px - 1919px) - Standard Laptops */
@media (min-width: 1440px) and (max-width: 1919px) {
    .login-showcase {
        padding: 3.5rem;
    }

    .showcase-title {
        font-size: 30px;
    }

    .login-form-side {
        padding: 3.5rem;
    }

    .login-card-redesigned {
        max-width: 450px;
    }

    .login-title {
        font-size: 30px;
    }
}

/* Medium Screens (1024px - 1439px) - Smaller Laptops & Large Tablets */
@media (min-width: 1024px) and (max-width: 1439px) {
    .login-showcase {
        padding: 3rem;
    }

    .showcase-title {
        font-size: 26px;
    }

    .login-form-side {
        padding: 3rem;
    }

    .login-card-redesigned {
        max-width: 400px;
    }

    .login-title {
        font-size: 26px;
    }
}

/* Tablets in Landscape (1024px) */
@media (max-width: 1024px) {
    .login-split-container {
        flex-direction: row;
        height: auto;
        min-height: 100vh;
    }

    .login-showcase {
        flex: 0.6;
        border-right: 1px solid var(--border-color);
        border-bottom: none;
        min-height: 100vh;
        padding: 2.5rem;
        justify-content: flex-end;
    }

    .showcase-title {
        font-size: 24px;
        line-height: 1.3;
    }

    .showcase-logo-badge {
        font-size: 12px;
        padding: 0.5rem 1rem;
    }

    .login-form-side {
        flex: 0.4;
        padding: 2rem;
        justify-content: center;
        min-height: 100vh;
        display: flex;
        align-items: center;
    }

    .login-card-redesigned {
        max-width: 100%;
        width: 100%;
    }

    .login-header {
        margin-bottom: 2rem;
    }

    .login-title {
        font-size: 24px;
    }

    .form-input-redesigned {
        padding: 0.8rem 1rem;
    }
}

/* iPad/Tablet in Portrait (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .login-split-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .login-showcase {
        flex: 0 0 auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        min-height: 350px;
        padding: 2.5rem;
        align-items: flex-end;
    }

    .showcase-title {
        font-size: 22px;
    }

    .showcase-subtitle {
        font-size: 12px;
    }

    .login-form-side {
        flex: 0 0 auto;
        padding: 2.5rem;
        min-height: auto;
    }

    .login-card-redesigned {
        max-width: 420px;
        width: 100%;
    }

    .login-title {
        font-size: 24px;
    }
}

/* Small Tablets/Large Mobile Landscape (600px - 767px) */
@media (max-width: 767px) and (min-width: 600px) {
    .login-split-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding: 0;
    }

    .login-showcase {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        min-height: 280px;
        padding: 2rem;
        align-items: flex-end;
    }

    .showcase-logo-badge {
        font-size: 12px;
        padding: 0.4rem 0.8rem;
        margin-bottom: 1rem;
    }

    .showcase-title {
        font-size: 20px;
        line-height: 1.2;
    }

    .showcase-subtitle {
        font-size: 12px;
    }

    .login-form-side {
        padding: 2rem;
        min-height: auto;
    }

    .login-card-redesigned {
        max-width: 100%;
        width: 100%;
    }

    .login-header {
        margin-bottom: 2rem;
    }

    .login-logo-redesigned {
        width: 48px;
        height: 48px;
        margin-bottom: 1rem;
    }

    .login-title {
        font-size: 22px;
        margin-bottom: 0.3rem;
    }

    .login-description {
        font-size: 13px;
    }

    .form-group-redesigned {
        margin-bottom: 1.2rem;
    }

    .form-input-redesigned {
        padding: 0.75rem 1rem;
        font-size: 14px;
    }

    .form-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin: 0.5rem 0 1rem 0;
    }

    .forgot-link {
        align-self: flex-end;
    }

    .btn-login-primary,
    .btn-google-login {
        padding: 0.8rem 1.5rem;
        font-size: 13px;
    }
}

/* Mobile Phones (481px - 599px) */
@media (max-width: 599px) and (min-width: 481px) {
    .login-split-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding: 0;
    }

    .login-showcase {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        min-height: 250px;
        padding: 1.5rem;
        align-items: flex-end;
    }

    .showcase-logo-badge {
        font-size: 11px;
        padding: 0.4rem 0.8rem;
        margin-bottom: 1rem;
    }

    .showcase-title {
        font-size: 18px;
        line-height: 1.2;
    }

    .showcase-subtitle {
        font-size: 11px;
    }

    .login-form-side {
        padding: 1.5rem;
        min-height: auto;
    }

    .login-card-redesigned {
        max-width: 100%;
    }

    .login-header {
        margin-bottom: 1.8rem;
    }

    .login-logo-redesigned {
        width: 44px;
        height: 44px;
        margin-bottom: 1rem;
    }

    .login-title {
        font-size: 20px;
        margin-bottom: 0.3rem;
    }

    .login-description {
        font-size: 12px;
    }

    .form-group-redesigned {
        margin-bottom: 1rem;
    }

    .form-label-redesigned {
        font-size: 12px;
    }

    .form-input-redesigned {
        padding: 0.7rem 0.9rem;
        font-size: 13px;
    }

    .form-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin: 0.4rem 0 0.8rem 0;
    }

    .remember-checkbox {
        font-size: 12px;
    }

    .forgot-link {
        font-size: 12px;
        align-self: flex-end;
    }

    .divider-section {
        margin: 1rem 0;
    }

    .divider-text {
        font-size: 11px;
        padding: 0 0.8rem;
    }

    .btn-login-primary,
    .btn-google-login {
        padding: 0.7rem 1.2rem;
        font-size: 13px;
    }
}

/* Small Mobile Phones (375px - 480px) */
@media (max-width: 480px) and (min-width: 375px) {
    .login-split-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding: 0;
    }

    .login-showcase {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        min-height: 220px;
        padding: 1.2rem;
        align-items: flex-end;
    }

    .showcase-logo-badge {
        font-size: 10px;
        padding: 0.3rem 0.6rem;
        margin-bottom: 0.8rem;
        gap: 0.3rem;
    }

    .badge-icon {
        font-size: 14px;
    }

    .showcase-title {
        font-size: 16px;
        line-height: 1.15;
    }

    .showcase-subtitle {
        font-size: 10px;
    }

    .login-form-side {
        padding: 1.2rem;
        min-height: auto;
    }

    .login-card-redesigned {
        max-width: 100%;
    }

    .login-header {
        margin-bottom: 1.5rem;
    }

    .login-logo-redesigned {
        width: 40px;
        height: 40px;
        margin-bottom: 0.8rem;
    }

    .login-logo-redesigned svg {
        width: 32px;
        height: 32px;
    }

    .login-title {
        font-size: 18px;
        margin-bottom: 0.25rem;
    }

    .login-description {
        font-size: 11px;
    }

    .form-group-redesigned {
        margin-bottom: 0.9rem;
    }

    .form-label-redesigned {
        font-size: 11px;
    }

    .form-input-redesigned {
        padding: 0.6rem 0.8rem;
        font-size: 12px;
        border-radius: 6px;
    }

    .form-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        margin: 0.3rem 0 0.6rem 0;
    }

    .remember-checkbox {
        font-size: 11px;
    }

    .remember-checkbox input[type="checkbox"] {
        width: 14px;
        height: 14px;
    }

    .forgot-link {
        font-size: 11px;
        align-self: flex-end;
    }

    .divider-section {
        margin: 0.8rem 0;
    }

    .divider-text {
        font-size: 10px;
        padding: 0 0.6rem;
    }

    .btn-login-primary,
    .btn-google-login {
        padding: 0.65rem 1rem;
        font-size: 12px;
    }

    .btn-google-login {
        gap: 0.3rem;
    }

    .btn-google-login svg {
        width: 16px;
        height: 16px;
    }
}

/* Extra Small Mobile Phones (320px - 374px) */
@media (max-width: 374px) {
    body {
        font-size: 13px;
    }

    .login-split-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding: 0;
    }

    .login-showcase {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        min-height: 200px;
        padding: 1rem;
        align-items: flex-end;
    }

    .showcase-logo-badge {
        font-size: 9px;
        padding: 0.25rem 0.5rem;
        margin-bottom: 0.6rem;
        gap: 0.2rem;
    }

    .badge-icon {
        font-size: 12px;
    }

    .showcase-title {
        font-size: 14px;
        line-height: 1.1;
    }

    .showcase-subtitle {
        font-size: 9px;
    }

    .login-form-side {
        padding: 1rem;
        min-height: auto;
    }

    .login-card-redesigned {
        max-width: 100%;
    }

    .login-header {
        margin-bottom: 1.2rem;
    }

    .login-logo-redesigned {
        width: 36px;
        height: 36px;
        margin-bottom: 0.6rem;
    }

    .login-logo-redesigned svg {
        width: 28px;
        height: 28px;
    }

    .login-title {
        font-size: 16px;
        margin-bottom: 0.2rem;
    }

    .login-description {
        font-size: 10px;
    }

    .form-group-redesigned {
        margin-bottom: 0.8rem;
    }

    .form-label-redesigned {
        font-size: 10px;
    }

    .form-input-redesigned {
        padding: 0.55rem 0.7rem;
        font-size: 11px;
        border-radius: 5px;
    }

    .form-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
        margin: 0.2rem 0 0.5rem 0;
    }

    .remember-checkbox {
        font-size: 10px;
    }

    .remember-checkbox input[type="checkbox"] {
        width: 13px;
        height: 13px;
    }

    .forgot-link {
        font-size: 10px;
        align-self: flex-end;
    }

    .divider-section {
        margin: 0.6rem 0;
    }

    .divider-text {
        font-size: 9px;
        padding: 0 0.5rem;
    }

    .btn-login-primary,
    .btn-google-login {
        padding: 0.6rem 0.8rem;
        font-size: 11px;
    }

    .btn-google-login {
        gap: 0.25rem;
    }

    .btn-google-login svg {
        width: 14px;
        height: 14px;
    }
}

/* Orientation Adjustments */
@media (orientation: landscape) and (max-height: 600px) {
    .login-split-container {
        height: 100vh;
    }

    .login-showcase {
        padding: 1.5rem;
        min-height: auto;
    }

    .showcase-title {
        font-size: 16px;
        margin-bottom: 0.5rem;
    }

    .showcase-logo-badge {
        margin-bottom: 0.8rem;
    }

    .login-form-side {
        padding: 1.5rem;
    }

    .login-header {
        margin-bottom: 1.2rem;
    }

    .login-title {
        font-size: 18px;
    }

    .form-group-redesigned {
        margin-bottom: 0.8rem;
    }

    .btn-login-primary,
    .btn-google-login {
        padding: 0.6rem 1rem;
    }
}

/* --- DASHBOARD LAYOUT --- */
.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header Full Width */
.top-header {
    height: var(--header-height);
    background-color: #000000;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    color: white;
    justify-content: space-between;
}

.header-left-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 300px; /* Align search relatively */
}

.menu-toggle {
    color: white;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    color: var(--primary-color);
}

.header-brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    color: white;
    display: flex;
    align-items: center;
}

.header-center-section {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

.search-wrapper input {
    background-color: #1f2937;
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border-radius: var(--radius-sm);
    width: 400px;
    font-family: var(--font-family);
    transition: width 0.3s ease, border-color 0.2s, box-shadow 0.2s;
}
.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43,92,255,0.12);
    width: 450px;
}
.search-wrapper input::placeholder {
    color: #6b7280;
}

.search-wrapper {
    position: relative;
}

.search-wrapper i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    width: 16px;
}

.header-right-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-icon {
    color: var(--text-muted);
    font-size: 1.25rem;
    position: relative;
}

.header-icon:hover {
    color: white;
}

.header-divider {
    width: 1px;
    height: 24px;
    background-color: var(--border-color);
    margin: 0 0.5rem;
}

.user-profile-img {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.user-profile-img img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #000000;
}

.status-dot-avatar {
    position: absolute;
    bottom: -2px;
    right: -2px; /* For RTL it will be on the right side of the circle */
    width: 10px;
    height: 10px;
    background-color: #10b981; /* Green status */
    border-radius: 50%;
    border: 2px solid #000000;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--color-urgent);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 10px;
    line-height: 1;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* App Body (Sidebar + Content) */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: #000000; /* Pure premium black, seamlessly unified with header */
    border-left: 1px solid rgba(255, 255, 255, 0.08); /* Soft translucent white border (RTL) */
    display: flex;
    flex-direction: column;
    transition: margin 0.3s ease;
    z-index: 10;
}

.sidebar.hidden {
    margin-right: calc(-1 * var(--sidebar-width));
}

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

/* Scrollbar for sidebar */
.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.menu-item {
    margin-bottom: 0.25rem;
}

.menu-title {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #a3a3a3; /* Premium neutral light silver-gray */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-title:hover {
    background-color: rgba(255, 255, 255, 0.05); /* Soft premium hover overlay */
    color: #ffffff; /* White text on hover */
}

.menu-title .icon {
    margin-left: 0.75rem;
    color: #737373; /* Elegant neutral gray icon */
    width: 20px;
    text-align: center;
    transition: color 0.2s ease;
}

.menu-title:hover .icon {
    color: #ffffff;
}

.menu-title .chevron {
    margin-right: auto;
    transition: transform 0.3s;
    font-size: 12px;
}

.menu-item.active .menu-title {
    color: #ffffff; /* Premium white for active menu group */
}
.menu-item.active .menu-title .icon {
    color: #ffffff;
}

.menu-item.active .chevron {
    transform: rotate(180deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: #0a0a0a; /* Onyx black for elegant depth contrast */
}

.menu-item.active .submenu {
    max-height: 500px; 
}

.submenu a {
    display: block;
    padding: 0.5rem 3.25rem 0.5rem 1.5rem; /* RTL padding */
    color: #8e8e93; /* Premium silver gray for links */
    font-size: 13px;
    transition: all 0.2s ease;
}

.submenu a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.04);
}

.submenu a.active {
    color: #ffffff;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.06);
    border-right: 3px solid #ffffff; /* Pure white active indicator line */
    padding-right: 3.0625rem; /* Compensate for the active line */
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Dashboard Content */
.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.page-title {
    font-size: 24px;
    margin-bottom: 1.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-left: 1rem; /* RTL */
}

.stat-icon.blue { background-color: rgba(43, 92, 255, 0.1); color: var(--primary-color); }
.stat-icon.green { background-color: rgba(49, 196, 141, 0.1); color: var(--color-success); }
.stat-icon.orange { background-color: rgba(255, 138, 76, 0.1); color: var(--color-attention); }
.stat-icon.red { background-color: rgba(240, 82, 82, 0.1); color: var(--color-urgent); }

.stat-details h3 {
    font-size: 24px;
    margin-bottom: 0.25rem;
}

.stat-details p {
    color: var(--text-muted);
    font-size: 13px;
}

/* Status Indicators */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 0.5rem; /* RTL */
}
.status-dot.red { background-color: var(--color-urgent); }
.status-dot.orange { background-color: var(--color-attention); }
.status-dot.green { background-color: var(--color-success); }

/* Table styling for lists */
.card {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

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

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

.table th, .table td {
    padding: 1rem;
    text-align: right; /* RTL */
    border-bottom: 1px solid var(--border-color);
}

.table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Status Tags */
.tag {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}
.tag-green { background-color: rgba(49, 196, 141, 0.1); color: var(--color-success); }
.tag-orange { background-color: rgba(255, 138, 76, 0.1); color: var(--color-attention); }

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 220px;
    z-index: 50;
    transition: all 0.2s ease;
    transform-origin: top left;
}

.user-dropdown.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
}

.dropdown-header {
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.dropdown-name {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 14px;
}

.dropdown-role {
    font-size: 12px;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--secondary-color);
    transition: background-color 0.2s;
    font-size: 13px;
    gap: 0.75rem;
}

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

.dropdown-item i {
    width: 16px;
    color: var(--text-muted);
}

.dropdown-item.text-red {
    color: var(--color-urgent);
}

.dropdown-item.text-red i {
    color: var(--color-urgent);
}

/* --- NEW MEWS DASHBOARD GRID --- */
.mews-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.mews-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.mews-card.span-2 {
    grid-column: span 2;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-section {
    margin-bottom: 1.5rem;
}

.card-section:last-child {
    margin-bottom: 0;
}

.link-list {
    list-style: none;
    margin-bottom: 1rem;
}

.link-list li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.link-list a {
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: underline;
}

.link-list a:hover {
    color: var(--primary-color);
}

/* Donut Charts CSS */
.donut-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.donut-chart {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-inner {
    width: 64px;
    height: 64px;
    background-color: var(--surface-color);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--secondary-color);
    z-index: 2;
    gap: 1px;
}

/* Chart Colors */
.chart-tasks { background: conic-gradient(var(--color-attention) 100%, #374151 0); }
.chart-arr { background: conic-gradient(var(--secondary-color) 100%, #374151 0); } /* Black/white ring */
.chart-dep { background: conic-gradient(var(--primary-color) 33%, var(--secondary-color) 0); }
.chart-spaces { background: conic-gradient(var(--color-attention) 60%, var(--primary-color) 60% 70%, var(--color-success) 70% 90%, var(--color-urgent) 90%); }
.chart-cust-1 { background: conic-gradient(var(--primary-color) 88%, #374151 0); }
.chart-cust-2 { background: conic-gradient(var(--primary-color) 93%, #374151 0); }

.legend-list {
    list-style: none;
}

.legend-item {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-blue { background-color: var(--primary-color); }
.dot-orange { background-color: var(--color-attention); }
.dot-green { background-color: var(--color-success); }
.dot-red { background-color: var(--color-urgent); }
.dot-white { background-color: var(--secondary-color); }

/* Integrations Logos Grid */
.logos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
}

.logos-grid img {
    height: 24px;
    opacity: 0.7;
    filter: grayscale(100%);
    transition: all 0.2s;
}

.logos-grid img:hover {
    opacity: 1;
    filter: none;
}

/* ==========================================================
   STATE-OF-THE-ART RESPONSIVE DESIGN FOR ALL DEVICES
   ========================================================== */

/* ── LAPTOP & DESKTOP (Large Screens & General Refinements) ── */
@media (max-width: 1400px) {
    .search-wrapper input:focus {
        width: 380px;
    }
}

/* ── SMALL DESKTOP / TABLET LANDSCAPE (max-width: 1200px) ── */
@media (max-width: 1200px) {
    .mews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .search-wrapper input {
        width: 300px;
    }
    .search-wrapper input:focus {
        width: 320px;
    }
}

/* ── TABLET PORTRAIT & SMALL NETBOOKS (max-width: 992px) ── */
@media (max-width: 992px) {
    /* Hide non-essential header controls to prevent overflow */
    .header-right-section .header-icon[title="ترتيب"],
    .header-right-section .header-icon[title="إضافة"],
    .header-right-section .header-icon[title="التقويم"],
    .header-right-section .header-icon[title="الرسائل"],
    .header-right-section .header-icon[title="الدعم الفني"],
    .header-right-section .header-icon[title="الإعلانات"],
    .header-right-section .header-divider {
        display: none !important;
    }

    .header-left-section {
        width: auto;
    }

    .header-right-section {
        gap: 0.75rem;
    }
    
    /* Layout stacking on Profile & Change Password */
    .profile-body, .cp-layout {
        grid-template-columns: 1fr !important;
    }

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

/* ── MOBILE SCREENS (max-width: 768px) ── */
@media (max-width: 768px) {
    /* Hide search bar entirely on mobile headers */
    .header-center-section {
        display: none !important;
    }

    /* Seamless Sidebar Toggling (Works 100% with JS toggling .hidden class) */
    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        height: 100vh;
        z-index: 1000;
        box-shadow: var(--shadow-lg);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        margin-right: 0 !important;
    }
    
    /* When not hidden, slide into view */
    .sidebar:not(.hidden) {
        transform: translateX(0);
    }

    /* Content and wrapper responsive corrections */
    .content-area {
        padding: 1rem !important;
    }

    .mews-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .mews-card.span-2 {
        grid-column: span 1 !important;
    }
    
    .page-title {
        font-size: 20px;
        margin-bottom: 1rem;
    }
}

/* ── VERY SMALL PHONES (max-width: 576px) ── */
@media (max-width: 576px) {
    .login-card {
        padding: 1.75rem;
        margin: 1rem;
    }

    .profile-hero-content {
        flex-direction: column !important;
        text-align: center !important;
        gap: 1.5rem !important;
    }

    .profile-hero-actions {
        margin-right: auto !important;
        margin-left: auto !important;
        justify-content: center !important;
        width: 100% !important;
    }

    .profile-meta {
        justify-content: center !important;
    }

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

    .form-grid {
        grid-template-columns: 1fr !important;
    }
}
