/* assets/css/style.css - أنماط مشتركة لكل صفحات النظام */

:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-success: #16a34a;
    --color-warning: #f59e0b;
    --color-danger: #dc2626;
    --color-bg: #f4f6f9;
    --color-card: #ffffff;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 14px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body[dir="rtl"] { text-align: right; }
body[dir="ltr"] { text-align: left; }

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

.topbar {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar h1 {
    font-size: 20px;
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    min-height: 44px;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-success { background: var(--color-success); color: #fff; }
.btn-warning { background: var(--color-warning); color: #fff; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--color-border); color: var(--color-text); }
.btn-sm { padding: 8px 14px; font-size: 14px; min-height: 36px; }
.btn-block { width: 100%; }

.card {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-light);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    background: #fff;
    color: var(--color-text);
}

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

textarea.form-control { resize: vertical; min-height: 70px; }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-new { background: #dbeafe; color: #1d4ed8; }
.badge-preparing { background: #fef3c7; color: #b45309; }
.badge-ready { background: #dcfce7; color: #15803d; }
.badge-completed { background: #e5e7eb; color: #374151; }
.badge-cancelled { background: #fee2e2; color: #b91c1c; }

.toast-container {
    position: fixed;
    top: 16px;
    inset-inline-end: 16px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 90vw;
}

.toast {
    padding: 14px 18px;
    border-radius: var(--radius);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--shadow-hover);
    animation: toast-in 0.2s ease;
    min-width: 220px;
}

.toast-success { background: var(--color-success); }
.toast-error { background: var(--color-danger); }
.toast-info { background: var(--color-primary); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-light);
}

.empty-state .icon { font-size: 56px; margin-bottom: 12px; }

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
}

.modal-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-hover);
}

.hidden { display: none !important; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.text-muted { color: var(--color-text-light); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }

@media (max-width: 600px) {
    .topbar h1 { font-size: 17px; }
    .btn { font-size: 15px; padding: 11px 16px; }
    .container { padding: 12px; }
}
