/*
 * Lightweight, buildless theme for the booking dashboard.
 * Uses utility-style classes already present in the Blade views so no markup changes are needed.
 */

:root {
    /* خلفيات النظام */
    --bg-1: #0a0f1e;
    --bg-2: #0f172a;
    --bg-3: #1e293b;
    
    /* السطوح */
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --surface-hover: #f1f5f9;
    
    /* الحدود */
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --border-focus: #0ea5e9;
    
    /* النصوص */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* الألوان الرئيسية */
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --accent-active: #0369a1;
    --accent-soft: #e0f2fe;
    --accent-light: #f0f9ff;
    
    /* النجاح */
    --success: #10b981;
    --success-hover: #059669;
    --success-soft: #d1fae5;
    --success-light: #ecfdf5;
    
    /* الخطر */
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-soft: #fee2e2;
    --danger-light: #fef2f2;
    
    /* التحذير */
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --warning-soft: #fef3c7;
    --warning-light: #fffbeb;
    
    /* معلومات */
    --info: #3b82f6;
    --info-hover: #2563eb;
    --info-soft: #dbeafe;
    --info-light: #eff6ff;
    
    /* الظلال */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* أنصاف أقطار الحواف */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Cairo', 'Figtree', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(180deg, var(--surface-muted), #ffffff);
    /* خلفية بيضاء ثلجية نظيفة مع لمسة زرقاء خفيفة جداً */
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
}

a {
    color: var(--accent-strong);
    text-decoration: none;
    transition: color 150ms ease, opacity 150ms ease;
}

a:hover {
    color: #0369a1;
}

main {
    padding-bottom: 48px;
}

/* Layout shells */
.min-h-screen {
    min-height: 100vh;
}

.bg-gray-100 {
    background: #f3f4f6;
}

header {
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(34, 197, 94, 0.08));
    opacity: 0.6;
    pointer-events: none;
}

header > div {
    position: relative;
    z-index: 1;
}

nav {
    background: rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    color: #e5e7eb;
}

nav a {
    color: #e5e7eb;
}

nav a:hover {
    color: #ffffff;
}

nav.bg-white {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.4);
}

/* Cards and panels محسّنة */
.bg-white {
    background: var(--surface);
    color: var(--text-primary);
}

.bg-gray-50 {
    background: var(--surface-muted);
}

.bg-gray-50\/50 {
    background: rgba(248, 250, 252, 0.5);
}

.bg-gray-200 {
    background: #e5e7eb;
}

.bg-gray-900 {
    background: linear-gradient(135deg, #0f172a, #0a0f1e);
    color: #f8fafc;
}

.bg-green-50 {
    background: var(--success-light);
}

.bg-red-50 {
    background: var(--danger-light);
}

.bg-blue-50 {
    background: var(--info-light);
}

.bg-yellow-50 {
    background: var(--warning-light);
}

.bg-indigo-100 {
    background: #e0e7ff;
}

.bg-indigo-50 {
    background: var(--accent-light);
}

/* Shadows محسّنة */
.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow {
    box-shadow: var(--shadow-md);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

/* Cards مع hover effect */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-strong);
}

.card-compact {
    padding: 16px;
    border-radius: var(--radius-lg);
}

.border {
    border: 1px solid var(--border);
}

.border-b {
    border-bottom: 1px solid var(--border);
}

.border-b-2 {
    border-bottom-width: 2px;
    border-bottom-style: solid;
}

.border-t {
    border-top: 1px solid var(--border);
}

.border-dashed {
    border-style: dashed;
}

.border-gray-100 {
    border-color: #f1f5f9;
}

.border-gray-200 {
    border-color: var(--border);
}

.border-gray-300 {
    border-color: #d1d5db;
}

.border-red-200 {
    border-color: #fecdd3;
}

.border-green-200 {
    border-color: #bbf7d0;
}

.border-indigo-400 {
    border-color: #818cf8;
}

.border-indigo-700 {
    border-color: #4338ca;
}

.border-l-4 {
    border-inline-start-width: 4px;
    border-inline-start-style: solid;
}

.border-transparent {
    border-color: transparent;
}

.rounded-md {
    border-radius: 10px;
}

.rounded-lg {
    border-radius: 14px;
}

.rounded {
    border-radius: 8px;
}

.rounded-xl {
    border-radius: 18px;
}

.rounded-full {
    border-radius: 999px;
}

.overflow-hidden {
    overflow: hidden;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-disc {
    list-style-type: disc;
}

/* Typography محسّنة */
.text-xs { font-size: 12px; line-height: 1.5; }
.text-sm { font-size: 14px; line-height: 1.5; }
.text-base { font-size: 15px; line-height: 1.6; }
.text-lg { font-size: 18px; line-height: 1.6; }
.text-xl { font-size: 20px; line-height: 1.5; }
.text-2xl { font-size: 24px; line-height: 1.4; }
.text-3xl { font-size: 30px; line-height: 1.3; }
.text-4xl { font-size: 36px; line-height: 1.2; }

.leading-tight { line-height: 1.25; }
.leading-5 { line-height: 1.35; }
.leading-normal { line-height: 1.6; }
.leading-relaxed { line-height: 1.75; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ألوان النصوص محسّنة */
.text-gray-900 { color: var(--text-primary); }
.text-gray-800 { color: #1e293b; }
.text-gray-700 { color: var(--text-secondary); }
.text-gray-600 { color: var(--text-muted); }
.text-gray-500 { color: var(--text-light); }
.text-gray-400 { color: #94a3b8; }
.text-gray-200 { color: #e2e8f0; }
.text-gray-100 { color: #f1f5f9; }
.text-white { color: #ffffff; }

.text-green-700 { color: var(--success-hover); }
.text-green-600 { color: var(--success); }
.text-red-700 { color: var(--danger-hover); }
.text-red-600 { color: var(--danger); }
.text-blue-600 { color: var(--info); }
.text-blue-700 { color: var(--info-hover); }
.text-yellow-600 { color: var(--warning); }
.text-yellow-700 { color: var(--warning-hover); }
.text-indigo-400 { color: #818cf8; }
.text-indigo-600 { color: var(--accent); }
.text-indigo-700 { color: var(--accent-hover); }
.text-indigo-800 { color: var(--accent-active); }

.font-sans { font-family: 'Cairo', 'Figtree', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* Spacing utilities */
.mx-auto { margin-left: auto; margin-right: auto; }
.my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ms-2 { margin-inline-start: 0.5rem; }
.ms-3 { margin-inline-start: 0.75rem; }
.ms-4 { margin-inline-start: 1rem; }
.ms-10 { margin-inline-start: 2.5rem; }
.ms-auto { margin-inline-start: auto; }
.-me-2 { margin-inline-end: -0.5rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-4 { padding-bottom: 1rem; }

.ps-3 { padding-inline-start: 0.75rem; }
.pe-4 { padding-inline-end: 1rem; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Sizing */
.w-full { width: 100%; }
.md\:w-72 { width: 18rem; }
.w-48 { width: 12rem; }
.min-w-full { min-width: 100%; }
.max-w-5xl { max-width: 960px; }
.max-w-4xl { max-width: 896px; }
.max-w-7xl { max-width: 1200px; }
.max-w-xs { max-width: 20rem; }
.h-4 { height: 1rem; }
.w-4 { width: 1rem; }
.h-6 { height: 1.5rem; }
.w-6 { width: 1.5rem; }
.h-16 { height: 4rem; }

/* Display */
.block { display: block; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-stretch { align-items: stretch; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.inline-flex { display: inline-flex; }
.inline-block { display: inline-block; }

.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.md\:grid-cols-2 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.md\:grid-cols-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.lg\:grid-cols-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.lg\:col-span-2 { grid-column: span 2 / span 2; }
.md\:col-span-2 { grid-column: span 1 / span 1; }
.lg\:col-span-4 { grid-column: span 1 / span 1; }

.flex-col { flex-direction: column; }
.md\:flex-row { flex-direction: row; }
.md\:items-center { align-items: center; }
.md\:justify-between { justify-content: space-between; }

.overflow-x { overflow-x: auto; }

/* Responsive adjustments */
@media (min-width: 640px) {
    .sm\:flex { display: flex; }
    .sm\:hidden { display: none; }
    .sm\:items-center { align-items: center; }
    .sm\:-my-px { margin-top: -1px; margin-bottom: -1px; }
    .sm\:ms-6 { margin-inline-start: 1.5rem; }
    .sm\:ms-10 { margin-inline-start: 2.5rem; }
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .sm\:px-0 { padding-left: 0; padding-right: 0; }
    .sm\:mx-auto { margin-left: auto; margin-right: auto; }
    .sm\:max-w-sm { max-width: 24rem; }
    .sm\:max-w-md { max-width: 28rem; }
    .sm\:max-w-lg { max-width: 32rem; }
    .sm\:max-w-xl { max-width: 36rem; }
    .sm\:max-w-2xl { max-width: 42rem; }
}

@media (min-width: 768px) {
    .md\:flex-row { flex-direction: row; }
    .md\:items-center { align-items: center; }
    .md\:justify-between { justify-content: space-between; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .md\:flex { display: flex; }
}

@media (min-width: 1024px) {
    .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:col-span-4 { grid-column: span 4 / span 4; }
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

input, select, textarea {
    font: inherit;
    color: var(--text-primary);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    /* إزالة width: 100% لنتحكم فيها حسب الحاجة */
}

input:hover, select:hover, textarea:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--accent-light), var(--shadow-sm);
    transform: translateY(-1px);
}

input::placeholder, textarea::placeholder {
    color: var(--text-light);
    opacity: 1;
}

input[readonly], select[disabled], textarea[readonly] {
    background: var(--surface-muted);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
}

input.error, select.error, textarea.error {
    border-color: var(--danger);
    background: var(--danger-light);
}

input.error:focus, select.error:focus, textarea.error:focus {
    box-shadow: 0 0 0 4px var(--danger-soft), var(--shadow-sm);
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
        linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 40px;
    cursor: pointer;
}

select:hover {
    background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
        linear-gradient(135deg, var(--accent) 50%, transparent 50%);
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* أحجام مختلفة للحقول */
input.input-sm, select.input-sm {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: var(--radius-md);
}

input.input-lg, select.input-lg {
    padding: 14px 18px;
    font-size: 16px;
    border-radius: var(--radius-xl);
}

/* Checkbox & Radio محسّنة */
input[type="checkbox"], input[type="radio"] {
    width: 18px;
    height: 18px;
    padding: 0;
    cursor: pointer;
    accent-color: var(--accent);
}

input[type="checkbox"]:hover, input[type="radio"]:hover {
    transform: scale(1.1);
}

/* أنماط Labels */
label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    cursor: pointer;
    transition: color 150ms ease;
}

label:hover {
    color: var(--text-primary);
}

label.required::after {
    content: '*';
    color: var(--danger);
    margin-right: 4px;
}

/* مجموعات الحقول */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
}

.form-group .help-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    display: block;
}

.form-group .field-error {
    font-size: 13px;
    color: var(--danger);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-group .field-error::before {
    content: '⚠';
    font-size: 14px;
}

/* =====================================================
   Form Grid System - حقول بجوار بعض
   ===================================================== */

/* Form Row - صف للحقول */
.form-row {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

/* حقلين بجوار بعض (50% لكل واحد) */
.form-row.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* 3 حقول بجوار بعض (33% لكل واحد) */
.form-row.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* 4 حقول بجوار بعض (25% لكل واحد) */
.form-row.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* حقل يأخذ مساحتين */
.form-col-2 {
    grid-column: span 2;
}

/* حقل يأخذ 3 مساحات */
.form-col-3 {
    grid-column: span 3;
}

/* حقل يأخذ كامل العرض */
.form-col-full {
    grid-column: 1 / -1;
}

/* Responsive: على الموبايل كل الحقول تحت بعض */
@media (max-width: 768px) {
    .form-row.cols-2,
    .form-row.cols-3,
    .form-row.cols-4 {
        grid-template-columns: 1fr;
    }
    
    .form-col-2,
    .form-col-3 {
        grid-column: auto;
    }
}

/* Responsive: على التابلت حقلين بجوار بعض */
@media (min-width: 768px) and (max-width: 1024px) {
    .form-row.cols-3,
    .form-row.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Width Utilities للحقول المفردة */
.w-full { width: 100%; }
.w-1\/2 { width: 50%; }
.w-1\/3 { width: 33.333%; }
.w-2\/3 { width: 66.667%; }
.w-1\/4 { width: 25%; }
.w-3\/4 { width: 75%; }
.w-auto { width: auto; }

/* أحجام ثابتة */
.w-32 { width: 8rem; }   /* 128px */
.w-48 { width: 12rem; }  /* 192px */
.w-64 { width: 16rem; }  /* 256px */
.w-80 { width: 20rem; }  /* 320px */
.w-96 { width: 24rem; }  /* 384px */

/* Max Width للحقول */
.max-w-xs { max-width: 20rem; }   /* 320px */
.max-w-sm { max-width: 24rem; }   /* 384px */
.max-w-md { max-width: 28rem; }   /* 448px */
.max-w-lg { max-width: 32rem; }   /* 512px */
.max-w-xl { max-width: 36rem; }   /* 576px */

/* Buttons محسّنة */
button, .button, [type="submit"], [type="button"] {
    font: inherit;
    border: none;
    cursor: pointer;
    padding: 11px 20px;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-lg);
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

button:hover, .button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

button:active, .button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

button:disabled, .button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Primary Button */
.bg-indigo-600, button[type="submit"]:not([class*="bg-"]) {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.bg-indigo-600:hover, button[type="submit"]:not([class*="bg-"]):hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent-active) 100%);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
}

.hover\:bg-indigo-500:hover {
    background: var(--accent-hover);
}

.hover\:bg-indigo-700:hover {
    background: var(--accent-active);
}

/* Success Button */
.bg-green-600 {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.bg-green-600:hover {
    background: linear-gradient(135deg, var(--success-hover) 0%, #047857 100%);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

/* Danger Button */
.bg-red-600 {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.bg-red-600:hover {
    background: linear-gradient(135deg, var(--danger-hover) 0%, #b91c1c 100%);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

/* Secondary Button */
.bg-white, .bg-gray-100 {
    background: white;
    color: var(--text-primary);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.bg-white:hover, .bg-gray-100:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

/* Ghost Button */
button.ghost, .button-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

button.ghost:hover, .button-ghost:hover {
    background: var(--surface-muted);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* أحجام مختلفة للأزرار */
button.btn-sm, .btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: var(--radius-md);
}

button.btn-lg, .btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius-xl);
}

/* Icon Buttons */
button.icon-only {
    padding: 10px;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-lg);
}

button.icon-only:hover {
    transform: scale(1.05);
}

.hover\:bg-gray-50:hover { background: #f9fafb; }
.hover\:bg-gray-100:hover { background: #f3f4f6; }
.hover\:text-gray-700:hover { color: #374151; }
.hover\:text-gray-800:hover { color: #1f2937; }
.hover\:text-gray-900:hover { color: #111827; }
.hover\:border-gray-300:hover { border-color: #d1d5db; }

.hover\:bg-gray-800:hover { background: #1f2937; }
.active\:bg-gray-950:active { background: #0b1220; }
.active\:bg-gray-100:active { background: #f5f5f5; }
.active\:bg-gray-900:active { background: #0f172a; }

.hover\:text-red-700:hover { color: #b91c1c; }

.disabled\:opacity-50:disabled { opacity: 0.6; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }

.focus\:outline-none:focus { outline: none; }
.focus\:ring-indigo-500:focus { box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25); }
.focus\:border-indigo-500:focus { border-color: var(--accent); }
.focus\:border-indigo-700:focus { border-color: var(--accent-hover); }
.focus\:border-gray-300:focus { border-color: #d1d5db; }
.focus\:bg-indigo-100:focus { background: var(--accent-light); }
.focus\:bg-gray-50:focus { background: #f8fafc; }
.focus\:text-gray-700:focus { color: #374151; }
.focus\:text-indigo-800:focus { color: var(--accent-active); }
.focus-visible\:ring-2:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.focus-visible\:ring-indigo-500:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.focus-visible\:ring-offset-2:focus-visible { outline-offset: 2px; }
.focus-visible\:ring-offset-white:focus-visible { box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px #fff; }

.transition { transition: all 150ms ease; }
.duration-150 { transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }
.ease-in-out { transition-timing-function: ease-in-out; }

/* Tables محسّنة */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

thead {
    background: var(--surface-muted);
}

thead tr {
    border-bottom: 2px solid var(--border);
}

thead th {
    padding: 14px 16px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: all 150ms ease;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--surface-hover);
}

tbody td {
    padding: 16px;
    font-size: 14px;
    color: var(--text-primary);
}

tbody td:first-child {
    font-weight: 500;
}

/* Table في cards */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.table-container table {
    border: none;
}

/* Striped table */
table.striped tbody tr:nth-child(even) {
    background: var(--surface-muted);
}

table.striped tbody tr:hover {
    background: var(--surface-hover);
}

/* Extended palette helpers */
    .bg-white\/95 { background: rgba(255, 255, 255, 0.95); }
    .bg-white\/90 { background: rgba(255, 255, 255, 0.9); }
    .bg-white\/80 { background: rgba(255, 255, 255, 0.8); }
    .bg-slate-50 { background: #f8fafc; }
    .bg-slate-100 { background: #f1f5f9; }
    .bg-slate-900 { background: #0f172a; color: #f8fafc; }
    .bg-slate-900\/10 { background: rgba(15, 23, 42, 0.1); }
    .bg-emerald-50 { background: #ecfdf5; }

    .border-slate-100 { border-color: #f1f5f9; }
    .border-slate-200 { border-color: #e2e8f0; }
    .border-slate-300 { border-color: #cbd5f5; }
    .border-emerald-200 { border-color: #a7f3d0; }

    .text-slate-400 { color: #94a3b8; }
    .text-slate-500 { color: #64748b; }
    .text-slate-600 { color: #475569; }
    .text-slate-700 { color: #334155; }
    .text-slate-800 { color: #1e293b; }
    .text-slate-900 { color: #0f172a; }
    .text-emerald-600 { color: #059669; }
    .text-emerald-800 { color: #065f46; }
    .text-amber-600 { color: #d97706; }
    .text-rose-600 { color: #e11d48; }

    .rounded-2xl { border-radius: 24px; }
    .shadow { box-shadow: 0 25px 60px -35px rgba(15, 23, 42, 0.6); }
    .shadow-xl { box-shadow: 0 35px 80px -40px rgba(15, 23, 42, 0.65); }

    .uppercase { text-transform: uppercase; }
    .tracking-\[0\.4em\] { letter-spacing: 0.4em; }
    .space-y-8 > * + * { margin-top: 2rem; }

    .hover\:bg-slate-50:hover { background: #f8fafc; }
    .hover\:bg-slate-100:hover { background: #f1f5f9; }
    .hover\:bg-slate-800:hover { background: #1f2937; }
    .hover\:text-slate-900:hover { color: #0f172a; }
    .hover\:border-slate-200:hover { border-color: #e2e8f0; }
    .hover\:-translate-y-0\.5:hover { transform: translateY(-2px); }

    .brand-logo {
        width: 64px;
        height: 64px;
        border-radius: 18px;
        border: 1px solid #e2e8f0;
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 60%, #eef2ff 100%);
        padding: 0.35rem;
        font-weight: 600;
    }

    .brand-logo--sm {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        padding: 0.25rem;
    }

    .brand-logo--xl {
        width: 80px;
        height: 80px;
        border-radius: 22px;
    }

    .glass-card {
        border-radius: 18px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(16px);
        box-shadow: 0 35px 80px -45px rgba(15, 23, 42, 0.7);
    }

    .form-shell {
        border-radius: 16px;
        border: 1px solid rgba(148, 163, 184, 0.38);
        background: rgba(255, 255, 255, 0.9);
        padding: 1.25rem;
        box-shadow: 0 20px 60px -45px rgba(15, 23, 42, 0.6);
    }
    
th, td {
    text-align: right;
    white-space: nowrap;
}

th {
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid var(--border);
}

td {
    color: #334155;
}

tbody tr:hover {
    background: #f8fafc;
}

.divide-y > :not([hidden]) ~ :not([hidden]) {
    border-top: 1px solid var(--border);
}

.divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--border);
}

.divide-gray-100 > :not([hidden]) ~ :not([hidden]) {
    border-color: #f1f5f9;
}

/* Badges */
.bg-green-50.text-green-700, .text-green-700 {
    background: var(--success-soft);
    color: #15803d;
}

.bg-red-50.text-red-700, .text-red-700 {
    background: var(--danger-soft);
    color: #b91c1c;
}

/* Utility surfaces */
.card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 24px 60px -40px rgba(0, 0, 0, 0.35);
}

/* Details / summary */
details summary {
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary {
    position: relative;
    padding-inline-end: 18px;
}

details summary::after {
    content: '\\203a';
    position: absolute;
    inset-inline-end: 0;
    transform: rotate(0deg);
    transition: transform 150ms ease;
    color: var(--muted);
}

details[open] summary::after {
    transform: rotate(90deg);
}

/* Pagination */
.pagination {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.pagination a, .pagination span {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: #0f172a;
}

.pagination .active span {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
    border-color: transparent;
}

/* Width helpers */
.max-w-7xl .shadow-sm,
.max-w-5xl .shadow-sm {
    border-radius: 14px;
}

/* Misc */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.text-start { text-align: start; }
.text-end { text-align: end; }

.bg-gray-50 .text-gray-900 {
    color: #0f172a;
}

.rounded-md.bg-gray-50 {
    border: 1px dashed rgba(148, 163, 184, 0.5);
}

.inline-flex.gap-2 > svg {
    width: 18px;
    height: 18px;
}

/* Extended palette helpers */
.bg-white\/95 { background: rgba(255, 255, 255, 0.95); }
.bg-white\/90 { background: rgba(255, 255, 255, 0.9); }
.bg-white\/80 { background: rgba(255, 255, 255, 0.8); }
.bg-slate-50 { background: #f8fafc; }
.bg-slate-100 { background: #f1f5f9; }
.bg-slate-900 { background: #0f172a; color: #f8fafc; }
.bg-slate-900\/10 { background: rgba(15, 23, 42, 0.1); }
.bg-emerald-50 { background: #ecfdf5; }
.bg-indigo-600 { background: #4f46e5; color: #ffffff; }
.bg-red-600 { background: #dc2626; color: #ffffff; }

.border-slate-100 { border-color: #f1f5f9; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-300 { border-color: #cbd5f5; }
.border-emerald-200 { border-color: #a7f3d0; }

.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }
.text-slate-900 { color: #0f172a; }
.text-emerald-600 { color: #059669; }
.text-emerald-800 { color: #065f46; }
.text-amber-600 { color: #d97706; }
.text-rose-600 { color: #e11d48; }

.rounded-2xl { border-radius: 24px; }
.shadow { box-shadow: 0 25px 60px -35px rgba(15, 23, 42, 0.6); }
.shadow-xl { box-shadow: 0 35px 80px -40px rgba(15, 23, 42, 0.65); }

.uppercase { text-transform: uppercase; }
.tracking-\[0\.4em\] { letter-spacing: 0.4em; }
.space-y-8 > * + * { margin-top: 2rem; }

.hover\:bg-slate-50:hover { background: #f8fafc; }
.hover\:bg-slate-100:hover { background: #f1f5f9; }
.hover\:bg-slate-800:hover { background: #1f2937; }
.hover\:bg-indigo-700:hover { background: #4338ca; }
.hover\:bg-red-100:hover { background: #fee2e2; }
.hover\:bg-red-500:hover { background: #ef4444; }
.hover\:text-slate-900:hover { color: #0f172a; }
.hover\:border-slate-200:hover { border-color: #e2e8f0; }
.hover\:-translate-y-0\.5:hover { transform: translateY(-2px); }
.active\:bg-red-700:active { background: #b91c1c; }

.brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 60%, #eef2ff 100%);
    padding: 0.35rem;
    font-weight: 600;
}

.brand-logo--sm {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    padding: 0.25rem;
}

.brand-logo--xl {
    width: 80px;
    height: 80px;
    border-radius: 22px;
}

.glass-card {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    box-shadow: 0 35px 80px -45px rgba(15, 23, 42, 0.7);
}

.form-shell {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    background: rgba(255, 255, 255, 0.9);
    padding: 1.25rem;
    box-shadow: 0 20px 60px -45px rgba(15, 23, 42, 0.6);
}

.focus-visible\:ring-red-500:focus-visible {
    box-shadow: 0 0 0 2px #ef4444, 0 0 0 6px rgba(255, 255, 255, 0.6);
}

/* Tables inside cards */
.min-w-full {
    min-width: 100%;
}

.hover\:bg-gray-50:hover {
    background: #f8fafc;
}

/* Simple skeleton for toast-like alerts */
.bg-green-50, .bg-red-50 {
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 12px;
}

/* Responsive nav toggle */
.sm\:hidden button {
    background: transparent;
}

/* Utility for inline badges */
.inline-flex.items-center.gap-1 > svg {
    width: 14px;
    height: 14px;
}

/* Button helpers for the refreshed shell */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    padding: 10px 18px;
    font-size: 0.92rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    background: linear-gradient(120deg, var(--accent), var(--accent-strong));
    color: #ffffff;
    box-shadow: 0 18px 35px -22px rgba(14, 165, 233, 0.75);
}

.btn--primary:hover {
    filter: brightness(1.05);
}

.btn--secondary {
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow: 0 18px 35px -26px rgba(15, 23, 42, 0.55);
}

.btn--secondary:hover {
    background: #ffffff;
}

.btn--danger {
    background: linear-gradient(120deg, #f87171, #dc2626);
    color: #ffffff;
    box-shadow: 0 18px 35px -22px rgba(220, 38, 38, 0.65);
}

.btn--danger:hover {
    filter: brightness(1.03);
}


/* Print helpers */
.print-only {
    display: none;
}

.screen-only {
    display: block;
}

@media print {
    body {
        background: #ffffff !important;
        color: #0f172a !important;
    }

    nav,
    header::before,
    .print-hidden,
    .screen-only {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    main,
    .max-w-7xl,
    .max-w-5xl,
    .max-w-4xl {
        max-width: none !important;
        width: 100% !important;
    }

    .shadow-sm,
    .border {
        box-shadow: none !important;
        border-color: #d1d5db !important;
    }

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

    .print\:shadow-none {
        box-shadow: none !important;
    }

    .print\:border-slate-300 {
        border-color: #cbd5f5 !important;
    }

    .print\:bg-white {
        background: #ffffff !important;
    }
}

/* =====================================================
   Badges & Status Indicators محسّنة
   ===================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.badge-success {
    background: var(--success-light);
    color: var(--success-hover);
    border-color: var(--success-soft);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger-hover);
    border-color: var(--danger-soft);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-hover);
    border-color: var(--warning-soft);
}

.badge-info {
    background: var(--info-light);
    color: var(--info-hover);
    border-color: var(--info-soft);
}

.badge-primary {
    background: var(--accent-light);
    color: var(--accent-hover);
    border-color: var(--accent-soft);
}

.badge-secondary {
    background: var(--surface-muted);
    color: var(--text-secondary);
    border-color: var(--border);
}

/* =====================================================
   Alert Boxes محسّنة
   ===================================================== */

.alert {
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1.5px solid;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 16px 0;
}

.alert-success {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success-hover);
}

.alert-danger {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger-hover);
}

.alert-warning {
    background: var(--warning-light);
    border-color: var(--warning);
    color: var(--warning-hover);
}

.alert-info {
    background: var(--info-light);
    border-color: var(--info);
    color: var(--info-hover);
}

/* =====================================================
   Loading Spinner
   ===================================================== */

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   Utility Classes إضافية
   ===================================================== */

.hover-lift {
    transition: transform 200ms ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale {
    transition: transform 200ms ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.blur-sm {
    backdrop-filter: blur(8px);
}

.blur-md {
    backdrop-filter: blur(12px);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* تحسين الـ scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--surface-muted);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Selection color */
::selection {
    background: var(--accent-soft);
    color: var(--accent-active);
}

::-moz-selection {
    background: var(--accent-soft);
    color: var(--accent-active);
}

/* =====================================================
   Bootstrap-like Container System
   ===================================================== */

.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        max-width: 640px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

@media (min-width: 1536px) {
    .container {
        max-width: 1536px;
    }
}

.container-fluid {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Row & Column System محسّن */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.col {
    flex: 1 0 0%;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.col-12 { width: 100%; }
.col-11 { width: 91.666667%; }
.col-10 { width: 83.333333%; }
.col-9 { width: 75%; }
.col-8 { width: 66.666667%; }
.col-7 { width: 58.333333%; }
.col-6 { width: 50%; }
.col-5 { width: 41.666667%; }
.col-4 { width: 33.333333%; }
.col-3 { width: 25%; }
.col-2 { width: 16.666667%; }
.col-1 { width: 8.333333%; }

/* Responsive Columns */
@media (min-width: 768px) {
    .col-md-12 { width: 100%; }
    .col-md-6 { width: 50%; }
    .col-md-4 { width: 33.333333%; }
    .col-md-3 { width: 25%; }
}

@media (min-width: 1024px) {
    .col-lg-12 { width: 100%; }
    .col-lg-6 { width: 50%; }
    .col-lg-4 { width: 33.333333%; }
    .col-lg-3 { width: 25%; }
}

/* Display utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }

@media (min-width: 768px) {
    .d-md-none { display: none; }
    .d-md-block { display: block; }
    .d-md-flex { display: flex; }
}

@media (min-width: 1024px) {
    .d-lg-none { display: none; }
    .d-lg-block { display: block; }
    .d-lg-flex { display: flex; }
}

/* Flexbox utilities */
.justify-content-start { justify-content: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }

.align-items-start { align-items: flex-start; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.align-items-stretch { align-items: stretch; }

/* Spacing utilities */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 1rem; }
.m-4 { margin: 1.5rem; }
.m-5 { margin: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

/* Text alignment */
.text-start { text-align: start; }
.text-center { text-align: center; }
.text-end { text-align: end; }

@media (min-width: 768px) {
    .text-md-start { text-align: start; }
    .text-md-center { text-align: center; }
    .text-md-end { text-align: end; }
}

/* Width utilities */
.w-25 { width: 25%; }
.w-50 { width: 50%; }
.w-75 { width: 75%; }
.w-100 { width: 100%; }

.h-100 { height: 100%; }

/* Visibility */
.visible { visibility: visible; }
.invisible { visibility: hidden; }
