:root {
    /* Color Palette */
    --primary: #4F46E5; /* Indigo */
    --primary-hover: #4338CA;
    --secondary: #10B981; /* Emerald */
    --background: #F3F4F6;
    --surface: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    
    /* Status Colors */
    --status-pending: #F59E0B; /* Amber */
    --status-approved: #10B981; /* Emerald */
    --status-rejected: #EF4444; /* Red */
    --status-revision: #3B82F6; /* Blue */

    /* Typography */
    --font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Shadows & Radii */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.3s ease;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

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

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

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

.main-content {
    flex: 1;
    padding: 2rem;
    margin-right: 260px; /* Sidebar width */
    margin-left: 0;
    transition: var(--transition);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-success { background-color: #D1FAE5; color: #065F46; }
.alert-danger { background-color: #FEE2E2; color: #991B1B; }
.alert-info { background-color: #DBEAFE; color: #1E40AF; }

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.badge-pending { background-color: #FEF3C7; color: #B45309; }
.badge-approved { background-color: #D1FAE5; color: #065F46; }
.badge-approved_conf { background-color: #D1FAE5; color: #059669; }
.badge-approved_pub { background-color: #A7F3D0; color: #047857; }
.badge-rejected { background-color: #FEE2E2; color: #991B1B; }
.badge-revision { background-color: #DBEAFE; color: #1E40AF; }

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background-color: #F9FAFB;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
    background-color: var(--surface);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: #F3F4F6;
}

/* Auth Cards */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 1rem;
}

.auth-card {
    background: var(--surface);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
}

/* Tables */
.table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    overflow-y: hidden;
    margin-top: 1.5rem;
    width: 100%;
}

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

.table th, .table td {
    padding: 1rem 1.5rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table th {
    background-color: #F9FAFB;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tr:hover {
    background-color: #F9FAFB;
}

/* Global Navbar/Landing */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

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

/* CKEditor RTL Specific overrides */
.ck-editor__editable {
    min-height: 200px;
    direction: rtl;
    text-align: right;
    font-family: var(--font-family) !important;
}
.ck-content {
    font-family: var(--font-family) !important;
}

/* Mobile & Tablet Responsiveness Rules */
@media (max-width: 1024px) {
    .dashboard-layout {
        flex-direction: column;
    }
    .main-content {
        margin-right: 0 !important;
        padding: 1rem;
        padding-top: 80px; /* Leave space for the sticky mobile top header */
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }
    .table {
        min-width: 100% !important;
        border: none !important;
    }
    .table thead {
        display: none;
    }
    .table tbody, .table tr, .table td {
        display: block;
    }
    .table tr {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        margin-bottom: 1.25rem;
        padding: 1rem 1.5rem;
        box-shadow: var(--shadow-sm);
    }
    .table td {
        text-align: right !important;
        padding: 0.75rem 0 !important;
        border-bottom: 1px dashed #E5E7EB !important;
        white-space: normal !important;
    }
    .table td:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
        padding-top: 1rem !important;
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    .table-container {
        background: transparent !important;
        box-shadow: none !important;
        overflow-x: visible !important;
        border: none !important;
        margin-top: 1rem;
    }
    .auth-card {
        padding: 1.5rem;
    }
}

