/* ============================================================
   Healing Haven - Complete CSS Stylesheet
   Purple (#860d8d) + Gold (#fad01a) Theme
   With RTL Support
   ============================================================ */

/* ── CSS Variables ── */
:root {
    --primary: #860d8d;
    --primary-dark: #6a0b6f;
    --primary-light: #b830bf;
    --primary-bg: rgba(134, 13, 141, 0.08);
    --gold: #fad01a;
    --gold-dark: #c5a114;
    --gold-bg: rgba(250, 208, 26, 0.12);
    
    --background: #fdfcff;
    --foreground: #262429;
    --card: #ffffff;
    --border: #e5e3e8;
    --sidebar: #faf9fb;
    --muted: #f3f1f5;
    --text: #262429;
    --text-secondary: #6b6675;
    --text-light: #9ca3af;
    --success: #10b981;
    --error: #ef4444;
    --info: #3b82f6;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius: 0.5rem;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    --transition: all 0.2s ease;
    --sidebar-width: 260px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

ul { list-style: none; }

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    color: var(--text);
    font-weight: 700;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* ── Container ── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.btn-gold {
    background: var(--gold);
    color: var(--text);
    border-color: var(--gold);
}
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-outline-white {
    background: transparent;
    color: #fff;
    border-color: #fff;
}
.btn-outline-white:hover { background: #fff; color: var(--primary); }

.btn-danger {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
}
.btn-danger:hover { background: #dc2626; }

.btn-text {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 0.5rem;
}
.btn-text:hover { background: var(--primary-bg); }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Top Bar ── */
.top-bar {
    background: var(--primary-dark);
    color: #fff;
    padding: 0.5rem 0;
    font-size: 0.8125rem;
}
.top-bar .container {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.top-bar-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    opacity: 0.9;
}

/* ── Header / Nav ── */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    gap: 1rem;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary);
}
.logo-img { height: 36px; width: auto; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.nav-link {
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--primary); background: var(--primary-bg); }
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.lang-switcher { display: flex; align-items: center; }
.lang-btn {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--primary-bg);
    color: var(--primary);
    border: 1px solid var(--primary);
    cursor: pointer;
    transition: var(--transition);
}
.lang-btn:hover { background: var(--primary); color: #fff; }

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.mobile-menu-btn span {
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* ── Hero Section ── */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #4a084d 100%);
    color: #fff;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(250,208,26,0.08) 0%, transparent 70%);
}
.hero .container {
    position: relative;
    z-index: 1;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 1rem;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.15);
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.2);
}
.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    color: #fff;
}
.hero-title .highlight {
    color: var(--gold);
}
.hero-subtitle {
    font-size: 1.0625rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 540px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
}
.hero-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.hero-stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gold);
}
.hero-stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}
.hero-image {
    display: flex;
    justify-content: center;
}
.hero-image img {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-height: 420px;
    object-fit: cover;
}

/* ── Features ── */
.features {
    padding: 3rem 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.feature-card {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1.25rem;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary-bg);
    color: var(--primary);
    flex-shrink: 0;
    font-size: 1.25rem;
}
.feature-title { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.25rem; }
.feature-desc { font-size: 0.8125rem; color: var(--text-secondary); }

/* ── Section ── */
.section {
    padding: 4rem 0;
}
.section-alt {
    background: var(--bg-secondary);
}
.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 3rem;
}
.section-title {
    margin-bottom: 0.75rem;
    font-size: 2rem;
}
.section-title .gold { color: var(--gold); }
.section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ── Cards ── */
.card-grid, .card-grid-2, .card-grid-4 {
    display: grid;
    gap: 1.5rem;
}
.card-grid {
    grid-template-columns: repeat(3, 1fr);
}
.card-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.card-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(134,13,141,0.2);
    transform: translateY(-2px);
}
.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.card-body { padding: 1.25rem; }
.card-category {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    background: var(--primary-bg);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.625rem;
}
.card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}
.card-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}
.card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}
.card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Instructor card */
.instructor-card {
    text-align: center;
    padding: 2rem 1.5rem;
}
.instructor-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid var(--primary-bg);
}
.instructor-name { font-size: 1.125rem; margin-bottom: 0.25rem; }
.instructor-specialization {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
}

/* Testimonial card */
.testimonial-card {
    padding: 1.5rem;
}
.testimonial-content {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1.25rem;
    line-height: 1.7;
}
.testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.testimonial-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}
.testimonial-name { font-weight: 700; font-size: 0.875rem; }
.testimonial-role { font-size: 0.8125rem; color: var(--text-secondary); }

/* ── CTA Section ── */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 4rem 0;
}
.cta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.cta-title { font-size: 2rem; margin-bottom: 1rem; color: #fff; }
.cta-subtitle { opacity: 0.9; margin-bottom: 1.5rem; }
.cta-actions { display: flex; gap: 1rem; }

/* CTA Card */
.cta-card {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border-radius: var(--radius-xl);
    padding: 2rem;
    color: var(--text);
}
.cta-card-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}
.cta-card-desc {
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    line-height: 1.7;
    opacity: 0.85;
}

/* ── Contact Form ── */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}
.form-group {
    margin-bottom: 1.25rem;
}
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--text);
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: var(--font);
    transition: var(--transition);
    background: #fff;
    color: var(--text);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}
.form-textarea { min-height: 120px; resize: vertical; }

.contact-info-cards {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.contact-info-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}
.contact-info-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary-bg);
    color: var(--primary);
    flex-shrink: 0;
    font-size: 1.25rem;
}
.contact-info-title { font-weight: 700; font-size: 0.875rem; }
.contact-info-detail { font-size: 0.875rem; color: var(--text-secondary); }

/* ── Star Rating ── */
.star-rating { display: inline-flex; gap: 2px; }
.star { color: #d1d5db; font-size: 1rem; }
.star.filled { color: var(--gold); }

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

/* ── Flash Messages ── */
.flash-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    margin: 1rem auto;
    max-width: 800px;
    font-size: 0.875rem;
    font-weight: 500;
}
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.flash-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: inherit;
    opacity: 0.6;
}
.flash-close:hover { opacity: 1; }

/* ── Footer ── */
.footer {
    background: #111827;
    color: #e5e7eb;
    padding: 3rem 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 2rem;
    padding-bottom: 2rem;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    font-size: 1.125rem;
    color: #fff;
}
.footer-logo-img { height: 32px; width: auto; filter: brightness(0) invert(1); }
.footer-about { font-size: 0.875rem; line-height: 1.7; opacity: 0.8; }
.footer-heading {
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: #d1d5db; font-size: 0.875rem; transition: var(--transition); }
.footer-links a:hover { color: var(--gold); }
.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}
.footer-bottom {
    border-top: 1px solid #374151;
    padding: 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    opacity: 0.7;
}
.footer-bottom-links { display: flex; gap: 1.5rem; }
.footer-bottom-links a { color: #9ca3af; }
.footer-bottom-links a:hover { color: var(--gold); }

/* ── Chatbot Widget ── */
.chatbot-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
}
[dir="rtl"] .chatbot-widget { right: auto; left: 1.5rem; }

.chatbot-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(134,13,141,0.4);
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chatbot-toggle:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(134,13,141,0.5); }
.chatbot-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gold);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.chatbot-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 2rem);
    height: 500px;
    max-height: calc(100vh - 6rem);
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
[dir="rtl"] .chatbot-window { right: auto; left: 0; }

.chatbot-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.chatbot-logo { height: 28px; width: auto; filter: brightness(0) invert(1); }
.chatbot-header h4 { font-size: 0.8125rem; font-weight: 700; }
.chatbot-status { font-size: 0.6875rem; opacity: 0.8; }
.chatbot-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
}
.chatbot-close:hover { opacity: 1; }

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-msg {
    max-width: 85%;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-lg);
    font-size: 0.8125rem;
    line-height: 1.5;
    white-space: pre-line;
}
.chat-msg.bot {
    background: var(--bg-tertiary);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-msg.user {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
[dir="rtl"] .chat-msg.bot { border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: 4px; }
[dir="rtl"] .chat-msg.user { border-bottom-right-radius: var(--radius-lg); border-bottom-left-radius: 4px; }

.chat-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
}
.chat-btn {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(134,13,141,0.3);
    background: #fff;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.chat-btn:hover { background: var(--primary); color: #fff; }

.chat-cards { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.chat-card {
    display: block;
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.chat-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.chat-card-title { font-size: 0.8125rem; font-weight: 700; }
.chat-card-desc { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.25rem; }
.chat-card-price { font-size: 0.8125rem; font-weight: 800; color: var(--primary); margin-top: 0.25rem; }

.chatbot-input {
    border-top: 1px solid var(--border);
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
}
.chatbot-input input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-family: var(--font);
    outline: none;
}
.chatbot-input input:focus { border-color: var(--primary); }
.chatbot-input button {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Auth Pages ── */
.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.auth-logo img { height: 36px; filter: none; }
.auth-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}
.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}
.auth-demo {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.8125rem;
}
.auth-demo-title { font-weight: 700; margin-bottom: 0.375rem; }
.auth-demo p { color: var(--text-secondary); margin-bottom: 0.25rem; font-family: monospace; font-size: 0.75rem; }
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.auth-error {
    background: #fef2f2;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    border: 1px solid #fecaca;
}

/* ── Admin Layout ── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}
/* Admin Sidebar Matches layout.tsx */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}
[dir="rtl"] .admin-sidebar { left: auto; right: 0; border-right: none; border-left: 1px solid var(--border); }

.sidebar-header { padding: 1.25rem 1rem; }
.sidebar-logo { height: 32px; width: auto; object-fit: contain; }
.sidebar-brand { display: flex; flex-direction: column; }
.sidebar-brand-name { font-size: 0.875rem; font-weight: 800; color: var(--foreground); margin: 0; }
.sidebar-brand-tag { font-size: 10px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin: 0; }

.sidebar-separator { height: 1px; background: var(--border); margin: 0.5rem 1rem; opacity: 0.5; }

.sidebar-nav { flex: 1; padding: 1rem 0.75rem; overflow-y: auto; }
.sidebar-group-label { 
    padding: 0.5rem 0.75rem; 
    font-size: 0.6875rem; 
    font-weight: 700; 
    color: var(--text-secondary); 
    text-transform: uppercase; 
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: all 0.2s;
}
.sidebar-link:hover { background: var(--muted); color: var(--primary); }
.sidebar-link.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(134,13,141,0.2); }
.sidebar-link.text-destructive { color: #dc2626; }
.sidebar-link.text-destructive:hover { background: #fef2f2; }
.sidebar-icon { font-size: 1rem; }

.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border); background: var(--sidebar); }
.sidebar-user { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar { 
    width: 32px; height: 32px; 
    background: var(--primary-bg); 
    color: var(--primary); 
    display: flex; align-items: center; justify-content: center; 
    border-radius: 50%; font-size: 0.75rem; font-weight: 700;
    border: 2px solid rgba(134,13,141,0.1);
}
.user-info { min-width: 0; }
.user-name { font-size: 0.75rem; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 10px; color: var(--text-secondary); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Topbar Header Matches layout.tsx Header */
.admin-topbar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-separator { width: 1px; height: 20px; background: var(--border); margin: 0 0.5rem; }
.topbar-title { font-size: 1.125rem; font-weight: 700; color: var(--foreground); }

.admin-main { flex: 1; margin-left: var(--sidebar-width); background: #f9f8fa; min-height: 100vh; display: flex; flex-direction: column; }
[dir="rtl"] .admin-main { margin-left: 0; margin-right: var(--sidebar-width); }

.admin-content { padding: 2rem; flex: 1; }


/* Admin Dashboard Stats */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.stat-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.stat-card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}
.stat-card-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-card-icon-box.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.stat-card-icon-box.yellow { background: rgba(234, 179, 8, 0.1); color: #eab308; }
.stat-card-icon-box.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.stat-card-icon-box.green { background: rgba(34, 197, 94, 0.1); color: #22c55e; }

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #000;
    line-height: 1.2;
}
.stat-card-subtext {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Charts */
.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.chart-section {
    padding: 1.5rem;
    border-radius: 16px;
    min-height: 350px;
    display: flex;
    flex-direction: column;
}
.chart-container {
    flex: 1;
    position: relative;
    margin: 1.5rem 0;
}
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.legend-item { display: flex; align-items: center; gap: 0.375rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }


/* Grids */
.admin-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.text-link {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}
.text-link:hover { color: var(--primary); }

.quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.quick-action-btn {
    padding: 0.75rem;
    background: var(--muted);
    border-radius: 10px;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}
.quick-action-btn:hover { background: var(--primary-bg); color: var(--primary); }



/* Admin Table */
.admin-table-container, .admin-table-wrapper {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow-x: auto;
    margin-bottom: 2rem;
}
.admin-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.75rem;
}
.admin-table-title {
    font-size: 1.125rem;
    font-weight: 700;
}
.admin-table-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.admin-search {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    outline: none;
    width: 200px;
}
.admin-search:focus { border-color: var(--primary); }

.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    text-align: left;
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}
[dir="rtl"] .admin-table th { text-align: right; }
.admin-table td {
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.admin-table tr:hover td { background: var(--bg-secondary); }

.admin-actions {
    display: flex;
    gap: 0.5rem;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}
.action-btn:hover { background: var(--primary-bg); color: var(--primary); }
.action-btn.action-delete:hover { background: #fee2e2; color: var(--error); }

/* Admin Forms */
.admin-section {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.admin-form .form-group {
    margin-bottom: 1.25rem;
}
.admin-form .form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}
.admin-form .form-input, 
.admin-form .form-select, 
.admin-form .form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}
.admin-form .form-input:focus, 
.admin-form .form-select:focus, 
.admin-form .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-bg);
}
.admin-form .form-textarea {
    resize: vertical;
}

/* Page Header */
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
}
.admin-page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}
.admin-page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}
.status-published, .status-active, .status-completed, .status-confirmed {
    background: #d1fae5;
    color: #065f46;
}
.status-draft, .status-pending {
    background: #fef3c7;
    color: #92400e;
}
.status-cancelled, .status-rejected {
    background: #fee2e2;
    color: #991b1b;
}


/* Admin Modal / Form */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.admin-modal {
    background: #fff;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}
.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.admin-modal-title { font-size: 1.125rem; font-weight: 700; }
.admin-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}
.admin-modal-body { padding: 1.5rem; }
.admin-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* Bilingual form fields */
.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.field-grid-full {
    grid-column: 1 / -1;
}

/* ── Detail Page ── */
.detail-page { padding: 2rem 0; }
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}
.detail-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}
.detail-sidebar-card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    position: sticky;
    top: 80px;
}
.detail-sidebar-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1rem;
}
.detail-sidebar-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.detail-sidebar-meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}
.detail-sidebar-meta-label { color: var(--text-secondary); }
.detail-sidebar-meta-value { font-weight: 600; }
.detail-includes {
    margin-bottom: 1.5rem;
}
.detail-includes-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}
.detail-includes-check { color: var(--success); font-size: 1rem; }

/* Lesson list */
.lesson-list { margin-top: 1.5rem; }
.lesson-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}
.lesson-item:hover { border-color: var(--primary); }
.lesson-item.locked { opacity: 0.6; }
.lesson-info { display: flex; align-items: center; gap: 0.75rem; }
.lesson-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}
.lesson-title-text { font-size: 0.875rem; font-weight: 600; }
.lesson-duration { font-size: 0.75rem; color: var(--text-secondary); }
.lesson-badge {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
}
.lesson-badge.preview { background: var(--gold-bg); color: var(--gold-dark); }
.lesson-badge.locked-badge { background: var(--bg-tertiary); color: var(--text-secondary); }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-image { display: none; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .cta-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-sidebar-card { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .top-bar { display: none; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }
    .nav-links.open { display: flex; }
    .nav-actions { margin: 0; flex-wrap: wrap; }
    .mobile-menu-btn { display: flex; }
    .hero { padding: 3rem 0; }
    .hero-title { font-size: 2rem; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .features-grid { grid-template-columns: 1fr; }
    .card-grid, .card-grid-2, .card-grid-4 { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .field-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 0.75rem; text-align: center; }

    /* Admin responsive */
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    [dir="rtl"] .admin-sidebar { transform: translateX(100%); }
    .admin-sidebar.open { transform: translateX(0); }
    [dir="rtl"] .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    [dir="rtl"] .admin-main { margin-right: 0; }
    .sidebar-toggle { display: block; }
    .admin-table { font-size: 0.8125rem; }
    .admin-table th, .admin-table td { padding: 0.5rem 0.75rem; }
    .admin-search { width: 140px; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.625rem; }
    .section { padding: 2.5rem 0; }
    .auth-card { padding: 1.5rem; }
    .stat-grid { grid-template-columns: 1fr; }
    .chatbot-window { width: calc(100vw - 2rem); height: 400px; }
}

/* ── RTL Overrides ── */
[dir="rtl"] .nav-actions { margin-left: 0; margin-right: 1rem; }
[dir="rtl"] .hero-actions { flex-direction: row-reverse; }
[dir="rtl"] .cta-actions { flex-direction: row-reverse; }
[dir="rtl"] .admin-table th { text-align: right; }
[dir="rtl"] .admin-table td { text-align: right; }
[dir="rtl"] .detail-sidebar-meta-item { flex-direction: row-reverse; }
[dir="rtl"] .card-footer { flex-direction: row-reverse; }
[dir="rtl"] .feature-card { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .contact-info-card { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .testimonial-author { flex-direction: row-reverse; }
[dir="rtl"] .activity-item { flex-direction: row-reverse; }
[dir="rtl"] .activity-content { text-align: right; }
[dir="rtl"] .panel-header { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .dashboard-hero { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .dashboard-hero-actions { flex-direction: row; }
[dir="rtl"] .admin-topbar { flex-direction: row-reverse; }
[dir="rtl"] .admin-topbar-right { margin-left: 0; margin-right: auto; }
[dir="rtl"] .sidebar-toggle { margin-left: 1rem; margin-right: 0; }

/* ── Scrollbar Styling ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Utility Classes ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-primary { color: var(--primary); }
.text-gold { color: var(--gold); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.hidden { display: none; }
.w-full { width: 100%; }

/* Pagination */
.pagination {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 2rem;
}
.pagination a, .pagination span {
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.pagination a:hover { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb .separator { color: var(--text-light); }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state-title { font-size: 1.125rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.empty-state-desc { font-size: 0.875rem; max-width: 400px; margin: 0 auto 1.5rem; }

/* Ad Banner */
.ad-banner {
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    margin: 2rem 0;
}
.ad-banner img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.ad-banner-content {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(134,13,141,0.9), rgba(134,13,141,0.6));
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem 2rem;
}
.ad-banner-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.5rem; }
.ad-banner-desc { font-size: 0.875rem; opacity: 0.9; margin-bottom: 1rem; }

/* ============================================================
   Stability fixes + Admin Settings additions
   ============================================================ */
.sidebar-icon,
.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.sidebar-icon svg,
.sidebar-toggle svg,
.lang-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}
.sidebar-link { min-height: 42px; }
.sidebar-logo,
.logo-img,
.footer-logo-img,
.chatbot-logo,
.settings-logo-preview { object-fit: contain; }
.admin-content { overflow-x: hidden; }
.admin-form .full-width { grid-column: 1 / -1; }
.form-help { color: var(--text-secondary); font-size: 0.8125rem; margin-top: 0.35rem; display: block; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.settings-card { margin-bottom: 1.5rem; padding: 1.25rem; }
.settings-preview-row { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.settings-logo-preview { width: 140px; height: 80px; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem; background: #fff; }
.color-input-wrap { display: flex; align-items: center; gap: 0.75rem; }
.color-input-wrap input[type="color"] { width: 52px; height: 42px; border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; background: #fff; cursor: pointer; }
.theme-preview { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.theme-preview-primary,
.theme-preview-secondary { display: inline-flex; align-items: center; justify-content: center; padding: 0.75rem 1rem; border-radius: var(--radius); font-weight: 700; }
.theme-preview-primary { background: var(--primary); color: #fff; }
.theme-preview-secondary { background: var(--gold); color: var(--text); }
.settings-check-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 0.75rem; }
.check-card { display: flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; cursor: pointer; font-weight: 600; }
.check-card input { accent-color: var(--primary); }
.sticky-actions { position: sticky; bottom: 0; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); padding: 1rem; margin: 0 -1rem -1rem; border-top: 1px solid var(--border); z-index: 10; }
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 2rem; align-items: start; }
.contact-info-card,
.contact-form-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 2rem; box-shadow: var(--shadow-sm); }
.contact-info-item { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border-light); }
.contact-info-item:last-child { border-bottom: 0; }
.contact-info-icon { width: 42px; height: 42px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; background: var(--primary-bg); color: var(--primary); font-weight: 800; flex: 0 0 auto; }
.contact-info-item h3 { margin-bottom: 0.2rem; font-size: 1rem; }
.contact-info-item p { margin: 0; font-weight: 700; }
.contact-info-item small { color: var(--text-secondary); }
.contact-form-card > p { color: var(--text-secondary); margin-bottom: 1.25rem; }
@media (max-width: 992px) { .settings-grid, .contact-grid { grid-template-columns: 1fr; } .settings-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 576px) { .settings-check-grid { grid-template-columns: 1fr; } .color-input-wrap { align-items: stretch; flex-direction: column; } }

/* ============================================================
   Client-ready Admin UI polish
   ============================================================ */
.admin-body {
    --admin-bg: #f6f3f8;
    --admin-card: rgba(255,255,255,0.94);
    --admin-soft-border: rgba(134, 13, 141, 0.10);
    background: var(--admin-bg);
}
.admin-main {
    background:
        radial-gradient(circle at top left, rgba(134,13,141,0.10), transparent 28rem),
        radial-gradient(circle at top right, rgba(250,208,26,0.12), transparent 22rem),
        var(--admin-bg);
}
.admin-content {
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
}
.admin-sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #fbf7fc 100%);
    box-shadow: 8px 0 28px rgba(50, 20, 56, 0.06);
}
[dir="rtl"] .admin-sidebar { box-shadow: -8px 0 28px rgba(50, 20, 56, 0.06); }
.sidebar-header {
    padding: 1.25rem 1.1rem 1rem;
}
.sidebar-header a {
    border-radius: 16px;
    padding: 0.6rem;
    background: linear-gradient(135deg, rgba(134,13,141,0.08), rgba(250,208,26,0.10));
}
.sidebar-logo {
    height: 40px;
    width: 40px;
    border-radius: 12px;
    background: #fff;
    padding: 0.25rem;
    box-shadow: var(--shadow-sm);
}
.sidebar-brand-name { font-size: 0.95rem; }
.sidebar-link {
    min-height: 42px;
    border: 1px solid transparent;
}
.sidebar-link:hover {
    background: rgba(134,13,141,0.07);
    border-color: rgba(134,13,141,0.08);
    transform: translateX(2px);
}
[dir="rtl"] .sidebar-link:hover { transform: translateX(-2px); }
.sidebar-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 10px 22px rgba(134,13,141,0.22);
}
.sidebar-icon {
    width: 22px;
    display: inline-flex;
    justify-content: center;
    flex: 0 0 22px;
}
.sidebar-footer {
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(12px);
}
.sidebar-user {
    padding: 0.55rem;
    border: 1px solid rgba(134,13,141,0.08);
    border-radius: 14px;
    background: #fff;
}
.user-avatar, .activity-avatar {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
}
.admin-topbar {
    height: 66px;
    background: rgba(255,255,255,0.84);
    box-shadow: 0 8px 24px rgba(50, 20, 56, 0.04);
}
.sidebar-toggle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.sidebar-toggle:hover {
    color: var(--primary);
    border-color: rgba(134,13,141,0.22);
    background: var(--primary-bg);
}
.topbar-title {
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}
.admin-topbar-right .lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    background: #fff;
    border-color: rgba(134,13,141,0.18);
    box-shadow: var(--shadow-sm);
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(134,13,141,0.96), rgba(88,8,92,0.96)),
        var(--primary);
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(134,13,141,0.22);
}
.dashboard-hero::after {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    right: -80px;
    top: -100px;
    border-radius: 50%;
    background: rgba(250,208,26,0.16);
}
[dir="rtl"] .dashboard-hero::after { right: auto; left: -80px; }
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-eyebrow {
    display: inline-flex;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}
.dashboard-hero h2 {
    color: #fff;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    margin-bottom: 0.35rem;
}
.dashboard-hero p {
    color: rgba(255,255,255,0.82);
    max-width: 680px;
}
.dashboard-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.dashboard-hero .btn-outline {
    color: #fff;
    border-color: rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.08);
}
.dashboard-hero .btn-outline:hover {
    background: #fff;
    color: var(--primary);
}
.dashboard-hero .btn-primary {
    background: var(--gold);
    color: #261d00;
    border-color: var(--gold);
}

.admin-reveal {
    animation: adminFadeUp 0.45s ease both;
}
@keyframes adminFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stat-card {
    position: relative;
    overflow: hidden;
    background: var(--admin-card);
    border: 1px solid var(--admin-soft-border);
    box-shadow: 0 12px 28px rgba(50,20,56,0.06);
}
.stat-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    opacity: 0;
    transition: var(--transition);
}
.stat-card:hover::before { opacity: 1; }
.stat-card-link {
    display: block;
    color: inherit;
}
.stat-card-link:hover {
    color: inherit;
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(50,20,56,0.10);
}
.stat-card-value {
    font-size: clamp(1.7rem, 3vw, 2.25rem);
    letter-spacing: -0.04em;
}
.stat-card-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}
.admin-section,
.admin-table-container,
.admin-table-wrapper {
    background: var(--admin-card);
    border: 1px solid var(--admin-soft-border);
    box-shadow: 0 12px 28px rgba(50,20,56,0.055);
    border-radius: 18px;
}
.admin-table-container, .admin-table-wrapper { overflow: hidden; overflow-x: auto; }
.admin-table th {
    background: #fbf8fc;
    color: #5c5364;
}
.admin-table tbody tr {
    transition: var(--transition);
}
.admin-table tbody tr:hover td {
    background: rgba(134,13,141,0.035);
}
.action-btn {
    border: 1px solid rgba(134,13,141,0.08);
    background: #fff;
}
.admin-page-header {
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--admin-soft-border);
    background: rgba(255,255,255,0.72);
    border-radius: 18px;
    box-shadow: 0 10px 22px rgba(50,20,56,0.04);
}
.admin-page-title {
    letter-spacing: -0.03em;
}

.dashboard-grid-main {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
    margin-bottom: 1.75rem;
}
.dashboard-grid-lower {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    margin-bottom: 1.75rem;
}
.dashboard-grid-main > *, .dashboard-grid-lower > * {
    min-width: 0;
}
.dashboard-grid-lower .messages-panel { grid-column: span 2; }
.dashboard-panel {
    min-height: 100%;
    margin-bottom: 0;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.panel-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}
.section-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
}
.status-bars {
    display: grid;
    gap: 1rem;
}
.status-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}
.progress-track {
    height: 9px;
    background: #f0edf2;
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    min-width: 4px;
}
.status-fill-pending { background: #f59e0b; }
.status-fill-confirmed { background: #3b82f6; }
.status-fill-completed, .status-fill-active { background: #10b981; }
.status-fill-cancelled { background: #ef4444; }
.activity-list {
    display: grid;
    gap: 0.75rem;
}
.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(134,13,141,0.05);
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.5rem;
    overflow: hidden;
    width: 100%;
}
.activity-item:hover {
    border-color: rgba(134,13,141,0.15);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(134,13,141,0.08);
    background: #fdfaff;
}
[dir="rtl"] .activity-item:hover {
    transform: translateX(-5px);
}
.activity-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex: 0 0 42px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    color: #fff;
    box-shadow: 0 4px 10px rgba(134,13,141,0.15);
}
.activity-avatar.soft-gold {
    background: linear-gradient(135deg, #facc15, #fbbf24);
    color: #451a03;
    box-shadow: 0 4px 10px rgba(251,191,36,0.2);
}
.activity-avatar.muted-avatar {
    background: #f3f4f6;
    color: #6b7280;
    box-shadow: none;
}
.activity-content {
    min-width: 0;
    flex: 1;
}
.activity-content strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.15rem;
}
.activity-content small {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.quick-actions-grid.polished {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    border: 1px solid rgba(134,13,141,0.08);
    background: #fff;
    border-radius: 14px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}
.quick-action-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(134,13,141,0.15);
}
.quick-action-btn .btn-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}
.quick-action-btn .btn-text {
    font-size: 0.75rem;
    font-weight: 600;
}
.handoff-card {
    margin-top: 1.25rem;
    padding: 1.25rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%);
    border: 1px solid rgba(134,13,141,0.1);
}
.handoff-card strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #701a75;
}
.handoff-card p {
    font-size: 0.8rem;
    color: #a21caf;
    margin: 0;
}
.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.snapshot-grid div {
    padding: 0.9rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(134,13,141,0.08);
}
.snapshot-grid strong {
    display: block;
    font-size: 1.35rem;
    line-height: 1;
}
.snapshot-grid span {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.76rem;
}
.delivery-checklist {
    display: grid;
    gap: 0.55rem;
    font-size: 0.84rem;
    color: var(--text-secondary);
}
.delivery-checklist li {
    position: relative;
    padding-left: 1.4rem;
}
[dir="rtl"] .delivery-checklist li {
    padding-left: 0;
    padding-right: 1.4rem;
}
.delivery-checklist li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--success);
    font-weight: 900;
}
[dir="rtl"] .delivery-checklist li::before {
    left: auto;
    right: 0;
}
.empty-state.compact {
    padding: 1.25rem;
    border-radius: 14px;
    border: 1px dashed rgba(134,13,141,0.16);
    background: rgba(255,255,255,0.72);
}
.form-input,
.form-select,
.form-textarea,
.admin-form .form-input,
.admin-form .form-select,
.admin-form .form-textarea {
    border-radius: 12px;
    background: #fff;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.admin-form .form-input:focus,
.admin-form .form-select:focus,
.admin-form .form-textarea:focus {
    box-shadow: 0 0 0 4px rgba(134,13,141,0.08);
}
.flash-message {
    border-radius: 14px;
    box-shadow: var(--shadow-md);
}

@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid-lower { grid-template-columns: 1fr; }
    .dashboard-grid-lower .messages-panel { grid-column: auto; }
}
@media (max-width: 900px) {
    .dashboard-grid-main { grid-template-columns: 1fr; }
    .dashboard-hero { align-items: flex-start; flex-direction: column; }
}
@media (min-width: 769px) {
    .sidebar-toggle { display: none; }
}
@media (max-width: 768px) {
    .admin-content { padding: 1rem; }
    .admin-topbar { padding: 0 1rem; }
    .dashboard-hero { padding: 1.25rem; border-radius: 18px; }
    .stat-grid { grid-template-columns: 1fr; }
    .admin-page-header { flex-direction: column; align-items: stretch; }
    .admin-table-header { align-items: stretch; }
    .admin-table-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
    .admin-search { width: 100%; }
    .quick-actions-grid.polished { grid-template-columns: 1fr; }
    .activity-item { align-items: flex-start; }
    .activity-item .status-badge { margin-top: 0.15rem; }
}
@media (max-width: 480px) {
    .topbar-title { font-size: 1rem; }
    .admin-topbar-right .lang-btn span { display: none; }
    .snapshot-grid { grid-template-columns: 1fr; }
}
