/* =====================================================
   همَّة الأسنان — ملف الأنماط الكامل
   Part 1/3: الأساسيات (Foundation)
   ===================================================== */

/* =====================================================
   1. المتغيرات (Design Tokens)
   ===================================================== */
:root {
    /* الألوان الأساسية — أخضر طبي */
    --primary-color: #1a7f8e;
    --primary-dark: #146574;
    --primary-darker: #0f4f5b;
    --primary-light: #2b96a6;
    --primary-lighter: #4bb0bf;
    --primary-tint: #1a7f8e12;
    --primary-tint-strong: #1a7f8e22;
    --primary-tint-light: #1a7f8e08;

    /* الألوان الثانوية — ذهبي */
    --accent-color: #5e4560;
    --accent-dark: #4a3449;
    --accent-light: #765c72;
    --accent-tint: #5e45601f;

    /* المحايدات الدافئة */
    --ink-color: #2e2f32;
    --ink-light: #4d4e52;
    --grey-color: #6f7073;
    --grey-light: #8f9092;
    --grey-lighter: #bdbdbf;
    --border-color: #e3e3e5;
    --border-light: #eeeeef;
    --border-dark: #cfcfd2;
    --lightGrey-color: #f3f3f4;
    --lightBlue-color: #fafafa;
    --white-color: #ffffff;
    --black-color: #000000;

    /* الألوان الدلالية */
    --blue-color: #2196F3;
    --blue-dark: #1976D2;
    --blue-light: #eaf3fc;
    --blue-tint: #2196F312;

    --red-color: #c0392b;
    --red-dark: #a03225;
    --red-light: #f8d7da;
    --red-tint: #c0392b12;

    --green-color: #34a853;
    --green-dark: #2a8c45;
    --green-light: #e3f6ee;
    --green-tint: #34a85312;

    --yellow-color: #f0b429;
    --yellow-light: #fde4c4;
    --yellow-dark: #c99340;

    --orange-color: #e67e22;
    --orange-light: #fdebd0;

    /* الفئات العمرية / التصنيفات */
    --cat-1: #1a7f8e;
    --cat-2: #5e4560;
    --cat-3: #6f7073;
    --cat-4: #146574;
    --cat-5: #765c72;
    --cat-6: #8f9092;

    /* الزوايا */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;
    --border-radius: var(--radius-sm);

    /* الظلال */
    --shadow-xs: 0 1px 2px rgba(32, 42, 46, 0.04);
    --shadow-sm: 0 1px 3px rgba(32, 42, 46, 0.06), 0 1px 2px rgba(32, 42, 46, 0.04);
    --shadow-md: 0 4px 12px rgba(32, 42, 46, 0.08);
    --shadow-lg: 0 12px 28px -8px rgba(26, 127, 142, 0.18);
    --shadow-xl: 0 24px 60px rgba(19, 28, 31, 0.15);
    --shadow-2xl: 0 32px 80px rgba(19, 28, 31, 0.2);
    --shadow-inner: inset 0 2px 4px rgba(32, 42, 46, 0.06);

    /* الحركة */
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.4s ease;
    --transition-slower: 0.6s ease;

    /* الخطوط */
    --font-arabic: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-english: 'Inter', 'Cairo', sans-serif;
    --font-mono: 'Courier New', Consolas, monospace;

    /* أحجام النصوص */
    --text-xs: 1.2rem;
    --text-sm: 1.4rem;
    --text-base: 1.6rem;
    --text-lg: 1.8rem;
    --text-xl: 2rem;
    --text-2xl: 2.4rem;
    --text-3xl: 3rem;
    --text-4xl: 3.6rem;
    --text-5xl: 4.8rem;
}

/* =====================================================
   2. Reset & Base
   ===================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    font-family: var(--font-arabic);
    font-weight: 400;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--ink-color);
    background: var(--lightBlue-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-color);
}

a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink-color);
    letter-spacing: -0.01em;
}

h1 { font-size: var(--text-4xl); font-weight: 800; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: 0;
    color: var(--grey-color);
}

p + p {
    margin-top: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

button {
    font-family: inherit;
    cursor: pointer;
    background: none;
    border: none;
    font-size: inherit;
    color: inherit;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: none;
}

ul, ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

hr {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 2rem 0;
}

::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* =====================================================
   3. الحاويات (Containers)
   ===================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.container-narrow {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.container-fluid {
    width: 100%;
    padding: 0 2rem;
}

/* =====================================================
   4. الهيدر (Header)
   ===================================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(253, 251, 248, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 0;
    box-shadow: 0 1px 0 var(--border-color);
    z-index: 1000;
    transition: box-shadow var(--transition);
}

header.scrolled {
    box-shadow: 0 4px 20px rgba(32, 42, 46, 0.08);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

header .logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
    order: -1;
    transition: transform var(--transition);
}

header .logo:hover {
    transform: scale(1.02);
    color: var(--primary-color);
}

header .logo img {
    height: 58px;
    width: auto;
    display: block;
}

header .logo span {
    display: inline-block;
}

/* =====================================================
   5. القائمة (Navigation)
   ===================================================== */
nav {
    display: flex;
    gap: 1.8rem;
    align-items: center;
    flex-wrap: nowrap;
}

nav a {
    color: var(--grey-color);
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
    position: relative;
    padding: 0.4rem 0;
    transition: color var(--transition-fast);
}

nav a:hover {
    color: var(--primary-color);
}

nav a.active {
    color: var(--primary-color);
}

nav a.active::after {
    content: '';
    position: absolute;
    right: 0;
    left: 0;
    bottom: -0.6rem;
    height: 3px;
    border-radius: 3px;
    background: var(--accent-color);
    animation: navUnderline 0.3s ease-out;
}

@keyframes navUnderline {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* =====================================================
   6. المحتوى الرئيسي (Main)
   ===================================================== */
main {
    min-height: 100vh;
    padding-top: 10rem;
    padding-bottom: 3rem;
}

main.no-padding-top {
    padding-top: 0;
}

/* =====================================================
   7. الفوتر (Footer)
   ===================================================== */
footer {
    background: var(--primary-darker);
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    padding: 3rem 0;
    margin-top: 5rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
}

footer p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.5rem;
}

footer a {
    color: var(--accent-color);
    font-weight: 600;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}

/* =====================================================
   8. الكروت (Cards)
   ===================================================== */
.card {
    background: var(--white-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow var(--transition), transform var(--transition);
    position: relative;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.card h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 2.4rem;
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.card-flat {
    box-shadow: none;
}

.card-flat:hover {
    box-shadow: var(--shadow-sm);
    transform: none;
}

.card-no-hover:hover {
    box-shadow: var(--shadow-sm);
    transform: none;
}

.card-bordered {
    border: 2px solid var(--primary-color);
}

.card-gradient {
    background: var(--primary-color);
    color: white;
    border: none;
}

.card-gradient h1,
.card-gradient h2,
.card-gradient h3,
.card-gradient h4,
.card-gradient p {
    color: white;
}

.card-accent {
    background: var(--accent-color);
    color: var(--ink-color);
    border: none;
}

.card-dark {
    background: var(--ink-color);
    color: white;
    border: none;
}

.card-dark h2,
.card-dark h3,
.card-dark p {
    color: white;
}

/* =====================================================
   9. الأزرار (Buttons)
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.2rem 2.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.5rem;
    transition: all var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(26, 127, 142, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--grey-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--ink-color);
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--green-color);
    color: white;
}

.btn-success:hover {
    background: var(--green-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(52, 168, 83, 0.4);
}

.btn-danger {
    background: var(--red-color);
    color: white;
}

.btn-danger:hover {
    background: var(--red-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(192, 57, 43, 0.4);
}

.btn-accent {
    background: var(--accent-color);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(94, 69, 96, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-outline-accent {
    background: transparent;
    color: var(--accent-dark);
    border-color: var(--accent-color);
}

.btn-outline-accent:hover {
    background: var(--accent-color);
    color: var(--ink-color);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.18);
    color: white;
    backdrop-filter: blur(5px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.28);
    color: white;
}

.btn-ghost-dark {
    background: rgba(0, 0, 0, 0.05);
    color: var(--ink-color);
}

.btn-ghost-dark:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--ink-color);
}

.btn-link {
    background: transparent;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-link:hover {
    color: var(--primary-dark);
}

.btn-xs {
    padding: 0.6rem 1rem;
    font-size: 1.2rem;
    gap: 0.4rem;
}

.btn-sm {
    padding: 0.8rem 1.5rem;
    font-size: 1.3rem;
}

.btn-lg {
    padding: 1.5rem 3.5rem;
    font-size: 1.8rem;
}

.btn-xl {
    padding: 1.8rem 4rem;
    font-size: 2rem;
}

.btn-icon {
    padding: 1rem;
    width: 4.2rem;
    height: 4.2rem;
}

.btn-icon.btn-sm {
    width: 3.4rem;
    height: 3.4rem;
    padding: 0.6rem;
}

.btn-icon.btn-lg {
    width: 5.2rem;
    height: 5.2rem;
    padding: 1.4rem;
}

/* =====================================================
   10. الشبكات (Grids)
   ===================================================== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
}

.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.grid-auto-fill-sm {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.grid-auto-fill-lg {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
}

.grid-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* =====================================================
   11. التنبيهات (Alerts)
   ===================================================== */
.alert {
    padding: 1.5rem 2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
    font-size: 1.5rem;
    border-right: 4px solid;
    display: flex;
    align-items: center;
    gap: 1rem;
    line-height: 1.6;
}

.alert i {
    font-size: 2rem;
    flex-shrink: 0;
}

.alert-success {
    background: var(--green-light);
    color: #155724;
    border-color: var(--green-color);
}

.alert-danger {
    background: var(--red-light);
    color: #721c24;
    border-color: var(--red-color);
}

.alert-info {
    background: var(--blue-light);
    color: var(--primary-color);
    border-color: var(--blue-color);
}

.alert-warning {
    background: var(--yellow-light);
    color: #856404;
    border-color: var(--accent-color);
}

/* =====================================================
   12. النماذج (Forms)
   ===================================================== */
.form-group {
    margin-bottom: 2rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--grey-color);
}

.form-group label.required::after {
    content: ' *';
    color: var(--red-color);
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1.2rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1.5rem;
    font-family: inherit;
    transition: all var(--transition);
    background: white;
    color: var(--ink-color);
    -webkit-appearance: none;
    appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--grey-lighter);
}

.form-group input:not([type="checkbox"]):not([type="radio"]):hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--border-dark);
}

.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-tint-strong);
}

.form-group input:not([type="checkbox"]):not([type="radio"]):disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background: var(--lightGrey-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--grey-light);
    font-size: 1.3rem;
}

.form-group .error {
    color: var(--red-color);
    font-size: 1.3rem;
    margin-top: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.form-group-inline {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--ink-color);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: auto;
    cursor: pointer;
    accent-color: var(--primary-color);
    width: 1.8rem;
    height: 1.8rem;
}

select {
    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='%236b7580' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1.2rem center;
    padding-left: 3.5rem;
    cursor: pointer;
}

[dir="rtl"] select {
    background-position: left 1.2rem center;
}

/* =====================================================
   13. الجداول (Tables)
   ===================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th, td {
    padding: 1.5rem;
    text-align: right;
    border-bottom: 1px solid var(--lightGrey-color);
    font-size: 1.5rem;
}

th {
    background: var(--lightGrey-color);
    font-weight: 600;
    color: var(--grey-color);
    font-size: 1.3rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: var(--lightBlue-color);
}

tbody tr:last-child td {
    border-bottom: none;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-striped tbody tr:nth-child(even) {
    background: var(--lightBlue-color);
}

.table-bordered th,
.table-bordered td {
    border: 1px solid var(--border-color);
}

/* =====================================================
   14. الشارات (Badges)
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-full);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.badge-primary {
    background: var(--primary-tint-strong);
    color: var(--primary-color);
}

.badge-success {
    background: var(--green-light);
    color: #155724;
}

.badge-danger {
    background: var(--red-light);
    color: #721c24;
}

.badge-warning {
    background: var(--yellow-light);
    color: #856404;
}

.badge-info {
    background: var(--blue-light);
    color: var(--blue-dark);
}

.badge-accent {
    background: var(--accent-tint);
    color: var(--accent-dark);
}

.badge-dark {
    background: var(--ink-color);
    color: white;
}

.badge-light {
    background: var(--lightGrey-color);
    color: var(--grey-color);
}

.badge-outline {
    background: transparent;
    border: 1px solid currentColor;
    color: var(--primary-color);
}

.badge-lg {
    padding: 0.8rem 1.6rem;
    font-size: 1.5rem;
}

.badge-sm {
    padding: 0.3rem 0.8rem;
    font-size: 1.1rem;
}

/* =====================================================
   15. الأيقونات (Icon Boxes)
   ===================================================== */
.service-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 2rem;
    border-radius: var(--radius-md);
    background: var(--primary-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2rem;
    color: var(--primary-color);
    transition: all var(--transition);
}

.card:hover .service-icon {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.service-icon-sm {
    width: 56px;
    height: 56px;
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
}

.service-icon-lg {
    width: 96px;
    height: 96px;
    font-size: 4rem;
    margin-bottom: 2.5rem;
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    border-radius: var(--radius-md);
    background: var(--primary-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    color: var(--primary-color);
}

.feature-icon-accent {
    background: var(--accent-tint);
    color: var(--accent-dark);
}

.feature-icon-success {
    background: var(--green-tint);
    color: var(--green-color);
}

.feature-icon-danger {
    background: var(--red-tint);
    color: var(--red-color);
}

/* =====================================================
   16. Breadcrumbs
   ===================================================== */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0;
    margin-top: 1rem;
    font-size: 1.4rem;
    color: var(--grey-color);
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--primary-color);
    transition: all var(--transition-fast);
}

.breadcrumbs a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.breadcrumbs span {
    color: var(--border-color);
}

.breadcrumbs .current {
    color: var(--ink-color);
    font-weight: 600;
}

/* =====================================================
   17. البحث (Search Box)
   ===================================================== */
.search-form {
    padding: 0;
}

.search-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-input-wrapper i {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-color);
    font-size: 1.6rem;
    pointer-events: none;
}

[dir="rtl"] .search-input-wrapper i {
    left: auto;
    right: 1.5rem;
}

.search-input-wrapper input {
    width: 100%;
    padding: 1.2rem 1.2rem 1.2rem 4rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1.5rem;
    transition: all var(--transition);
    font-family: inherit;
    background: white;
}

[dir="rtl"] .search-input-wrapper input {
    padding: 1.2rem 4rem 1.2rem 1.2rem;
}

.search-input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-tint-strong);
    outline: none;
}

.search-container .btn {
    padding: 1.2rem 2rem;
    white-space: nowrap;
}

/* =====================================================
   18. الترقيم (Pagination)
   ===================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 4rem;
}

.pagination a,
.pagination span {
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 1.5rem;
    transition: all var(--transition);
    background: var(--lightGrey-color);
    color: var(--primary-color);
    text-decoration: none;
    display: inline-block;
    border: 1px solid var(--border-color);
    font-weight: 600;
    cursor: pointer;
    min-width: 4rem;
    text-align: center;
}

.pagination a:hover {
    background: var(--primary-tint-strong);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(26, 127, 142, 0.15);
}

.pagination .active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 700;
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .disabled:hover {
    background: var(--lightGrey-color);
    transform: none;
    box-shadow: none;
}

/* =====================================================
   19. الحالة الفارغة (Empty State)
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
}

.empty-state-icon {
    font-size: 6rem;
    color: var(--border-color);
    margin-bottom: 2rem;
    display: block;
}

.empty-state h2,
.empty-state h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.8rem;
    max-width: 500px;
    margin: 0 auto;
}

/* =====================================================
   20. الفواصل (Dividers)
   ===================================================== */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    color: var(--grey-light);
    font-size: 1.3rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider-text {
    padding: 0 1rem;
    background: var(--lightBlue-color);
}

/* =====================================================
   21. الحاويات المؤقتة (Placeholder)
   ===================================================== */
.placeholder {
    background: linear-gradient(90deg, var(--lightGrey-color) 25%, var(--border-light) 50%, var(--lightGrey-color) 75%);
    background-size: 200% 100%;
    animation: placeholderShimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes placeholderShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =====================================================
   22. Skeleton Loading
   ===================================================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 1.6rem;
    margin-bottom: 1rem;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-title {
    height: 2.4rem;
    width: 70%;
    margin-bottom: 1.5rem;
}

.skeleton-image {
    height: 200px;
    width: 100%;
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =====================================================
   23. Spinner / Loader
   ===================================================== */
.spinner {
    width: 4rem;
    height: 4rem;
    border: 4px solid var(--primary-tint);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
    display: inline-block;
}

.spinner-sm {
    width: 2rem;
    height: 2rem;
    border-width: 2px;
}

.spinner-lg {
    width: 6rem;
    height: 6rem;
    border-width: 5px;
}

@keyframes spinnerRotate {
    to { transform: rotate(360deg); }
}

.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    backdrop-filter: blur(3px);
}

/* =====================================================
   24. Progress Bar
   ===================================================== */
.progress {
    height: 1rem;
    background: var(--lightGrey-color);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-bar-success { background: var(--green-color); }
.progress-bar-warning { background: var(--yellow-color); }
.progress-bar-danger { background: var(--red-color); }

/* =====================================================
   25. Avatar
   ===================================================== */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-tint);
    color: var(--primary-color);
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-sm { width: 3.2rem; height: 3.2rem; font-size: 1.3rem; }
.avatar-md { width: 4.8rem; height: 4.8rem; font-size: 1.8rem; }
.avatar-lg { width: 6.4rem; height: 6.4rem; font-size: 2.4rem; }
.avatar-xl { width: 9.6rem; height: 9.6rem; font-size: 3.6rem; }

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =====================================================
   26. Tooltip
   ===================================================== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--ink-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* =====================================================
   27. شريط التنبيه العلوي (Top Bar)
   ===================================================== */
.top-bar {
    background: var(--primary-darker);
    color: white;
    padding: 0.8rem 0;
    font-size: 1.3rem;
    text-align: center;
}

.top-bar a {
    color: var(--accent-color);
    font-weight: 600;
    margin-right: 0.5rem;
}

.top-bar a:hover {
    color: white;
}

/* =====================================================
   28. لافتة (Banner)
   ===================================================== */
.banner {
    padding: 2rem;
    border-radius: var(--radius-md);
    background: var(--primary-tint);
    border: 1px solid var(--primary-color);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.banner-icon {
    font-size: 3rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.banner-content {
    flex: 1;
}

.banner-title {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
    font-size: 1.7rem;
}

.banner-desc {
    color: var(--grey-color);
    font-size: 1.4rem;
}
/* ============ شعار الموقع (Logo Image) ============ */
header .logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
    order: -1;
    transition: transform var(--transition);
}

header .logo:hover {
    transform: scale(1.02);
    color: var(--primary-color);
}

header .logo .logo-img {
    height: 58px;
    width: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    /* مهم: لإزالة الخلفية البيضاء لو الصورة مفرغة */
    mix-blend-mode: multiply;
}

header .logo span {
    display: inline-block;
    line-height: 1.2;
}

/* على الجوال - تصغير الشعار */
@media only screen and (max-width: 768px) {
    header .logo {
        font-size: 1.8rem;
    }
    header .logo .logo-img {
        height: 42px;
    }
}

@media only screen and (max-width: 480px) {
    header .logo .logo-img {
        height: 36px;
    }
}
/* =====================================================
   إصلاح الهيدر — الشعار يمين + روابط كأزرار يسار
   ===================================================== */

/* الهيدر container — flex عادي (الشعار أول عنصر بصرياً في RTL) */
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-direction: row;
}

/* الشعار — يظهر على اليمين تلقائياً في RTL */
header .logo {
    order: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
    transition: transform var(--transition);
}

header .logo:hover {
    transform: scale(1.02);
    color: var(--primary-color);
}

header .logo .logo-img {
    height: 55px;
    width: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    mix-blend-mode: multiply;
}

header .logo span {
    display: inline-block;
    line-height: 1.2;
}

/* القائمة — على اليسار */
header nav {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: nowrap;
    order: 1;
}

/* الروابط كأزرار/كبسات */
header nav > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.6rem;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--grey-color);
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all var(--transition);
    border: 2px solid transparent;
    position: relative;
    text-decoration: none;
    cursor: pointer;
}

header nav > a:hover {
    background: var(--primary-tint);
    color: var(--primary-color);
    transform: translateY(-2px);
    border-color: var(--primary-tint-strong);
}

header nav > a.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px -4px rgba(26, 127, 142, 0.4);
}

header nav > a.active::after {
    display: none;
}

/* زر "تغيير التفضيلات" */
header nav .change-preferences-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.6rem;
    background: var(--accent-tint);
    color: var(--accent-dark);
    border-radius: var(--radius-sm);
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid var(--accent-color);
}

header nav .change-preferences-btn:hover {
    background: var(--accent-color);
    color: var(--ink-color);
    transform: translateY(-2px);
}

/* زر اللغة */
header nav .lang-switcher {
    margin-right: 0;
    margin-left: 0;
    padding-right: 0;
    padding-left: 1rem;
    border-right: none;
    border-left: 1px solid var(--border-color);
}

header nav .lang-switcher a {
    padding: 0.9rem 1.4rem;
    border-radius: var(--radius-sm);
    font-size: 1.4rem;
    font-weight: 600;
    background: var(--primary-color);
    color: white !important;
    transition: all var(--transition);
}

header nav .lang-switcher a:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* على الجوال - تصغير */
@media only screen and (max-width: 768px) {
    header .logo {
        font-size: 1.8rem;
    }
    header .logo .logo-img {
        height: 42px;
    }
    header nav {
        display: none;
    }
}

@media only screen and (max-width: 480px) {
    header .logo .logo-img {
        height: 36px;
    }
    header .logo span {
        font-size: 1.4rem;
    }
}
/* =====================================================
   إصلاح الهيدر النهائي — موحد لكل الصفحات
   ===================================================== */

/* ============ Header Container ============ */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(253, 251, 248, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 0;
    box-shadow: 0 1px 0 var(--border-color);
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-direction: row;
    flex-wrap: nowrap;
}

/* ============ الشعار (يمين) ============ */
header .logo {
    order: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
    transition: transform var(--transition);
    text-decoration: none;
}

header .logo:hover {
    transform: scale(1.02);
    color: var(--primary-color);
}

header .logo .logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    mix-blend-mode: multiply;
}

header .logo span {
    display: inline-block;
    line-height: 1.2;
    white-space: nowrap;
}

/* ============ زر القائمة (جوال) ============ */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.6rem;
    z-index: 1002;
    order: 2;
}

.mobile-menu-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--primary-color);
    margin: 5px 0;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ============ القائمة الأفقية (ديسكتوب) ============ */
header nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
    order: 1;
}

header nav > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.5rem;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--grey-color);
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all var(--transition);
    border: 2px solid transparent;
    text-decoration: none;
    cursor: pointer;
}

header nav > a:hover {
    background: var(--primary-tint);
    color: var(--primary-color);
    transform: translateY(-2px);
    border-color: var(--primary-tint-strong);
}

header nav > a.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px -4px rgba(26, 127, 142, 0.4);
}

header nav > a.active::after {
    display: none;
}

header nav .change-preferences-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.5rem;
    background: var(--accent-tint);
    color: var(--accent-dark);
    border-radius: var(--radius-sm);
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid var(--accent-color);
}

header nav .change-preferences-btn:hover {
    background: var(--accent-color);
    color: var(--ink-color);
    transform: translateY(-2px);
}

header nav .lang-switcher {
    margin-right: 0;
    padding-right: 0;
    border-right: none;
    padding-left: 1rem;
    margin-left: 0;
    border-left: 1px solid var(--border-color);
}

header nav .lang-switcher a {
    padding: 0.9rem 1.4rem;
    border-radius: var(--radius-sm);
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--primary-color);
    color: white !important;
    transition: all var(--transition);
}

header nav .lang-switcher a:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ============ Mobile Menu Overlay ============ */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(19, 28, 31, 0.55);
    backdrop-filter: blur(3px);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}

/* ============ Mobile Nav Sidebar ============ */
.mobile-nav {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: white;
    box-shadow: -8px 0 30px rgba(32, 42, 46, 0.15);
    z-index: 1001;
    padding: 8rem 1.5rem 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    visibility: hidden;
}

.mobile-nav.active {
    transform: translateX(0);
    visibility: visible;
}

.mobile-nav a {
    display: block;
    padding: 1.3rem 1rem;
    color: var(--ink-color);
    font-size: 1.6rem;
    font-weight: 600;
    border-bottom: 1px solid var(--lightGrey-color);
    transition: all var(--transition);
    text-decoration: none;
}

.mobile-nav a:hover,
.mobile-nav a.active {
    color: var(--primary-color);
    background: var(--primary-tint);
    padding-right: 1.5rem;
}

.mobile-nav .mobile-lang-switcher {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--lightGrey-color);
}

.mobile-nav .mobile-lang-switcher a {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white !important;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 1.5rem;
    text-align: center;
}

/* ============ استجابة الجوال ============ */
@media only screen and (max-width: 1024px) {
    header nav > a {
        padding: 0.8rem 1rem;
        font-size: 1.4rem;
    }
    header nav .change-preferences-btn {
        padding: 0.8rem 1rem;
        font-size: 1.3rem;
    }
    header nav .change-preferences-btn i {
        display: none;
    }
}

@media only screen and (max-width: 900px) {
    header nav {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: block !important;
    }
    
    .mobile-nav {
        display: block !important;
    }
    
    header .logo {
        font-size: 1.7rem;
    }
    
    header .logo .logo-img {
        height: 42px;
    }
}

@media only screen and (max-width: 480px) {
    header .logo {
        font-size: 1.5rem;
        gap: 0.5rem;
    }
    
    header .logo .logo-img {
        height: 50px;
    }
}
/* =====================================================
   نهاية الدفعة 1 من 3
   ===================================================== */