@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f7f4ea;
    --surface: #ffffff;
    --surface-soft: #fbf8ef;
    --text: #24301f;
    --muted: #69755f;
    --border: #e5dcc4;
    --shadow: 0 16px 40px rgba(76, 92, 44, 0.12);
    --primary: #6da52d;
    --primary-strong: #4f8b20;
    --secondary: #d7a10d;
    --secondary-strong: #b98500;
    --success: #4f8b20;
    --danger: #dc2626;
    --warning: #b98500;
    --info: #557c2f;
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.25s ease;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: 'Manrope', 'Cairo', sans-serif;
    color: var(--text);
    line-height: 1.6;
    background:
        radial-gradient(circle at 12% 18%, rgba(109, 165, 45, 0.18) 0%, transparent 34%),
        radial-gradient(circle at 88% 4%, rgba(215, 161, 13, 0.14) 0%, transparent 24%),
        var(--bg);
}

[dir="rtl"] body,
html[dir="rtl"] body {
    font-family: 'Cairo', 'Manrope', sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-bottom: 10px;
    line-height: 1.25;
    letter-spacing: -0.01em;
    font-weight: 700;
}

a {
    color: var(--primary-strong);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    opacity: 0.88;
}

.language-select,
.language-switcher select {
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(76, 92, 44, 0.12);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-lockup.brand-lockup-stacked {
    flex-direction: column;
    text-align: center;
}

.brand-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-logo.brand-logo-lg {
    width: 124px;
    height: 124px;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.brand-copy-ar {
    font-family: 'Cairo', sans-serif;
    font-size: 21px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--secondary);
}

.brand-copy-en {
    font-size: 13px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary);
}

.brand-subtitle {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.btn {
    border: none;
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
}

.btn-success {
    color: #fff;
    background: linear-gradient(135deg, var(--success) 0%, #22c55e 100%);
}

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, var(--danger) 0%, #ef4444 100%);
}

.btn-warning {
    color: #fff;
    background: linear-gradient(135deg, var(--warning) 0%, var(--secondary) 100%);
}

.btn-info {
    color: #fff;
    background: linear-gradient(135deg, var(--info) 0%, var(--primary) 100%);
}

.btn-secondary {
    color: #fff;
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.btn-sm {
    padding: 7px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.form-group {
    margin-bottom: 14px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(109, 165, 45, 0.14);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 18px;
}

.card-header {
    color: #fff;
    padding: 18px 20px;
    background: linear-gradient(100deg, #45681e 0%, #6da52d 58%, #d7a10d 100%);
}

.card-header h2 {
    color: #fff;
    margin-bottom: 4px;
}

.card-header p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.86);
}

.card-body {
    padding: 18px 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.table thead {
    background: #f7f3e8;
}

.table th,
.table td {
    text-align: start;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.table th {
    color: #5d671f;
    font-weight: 800;
}

.table tbody tr:hover {
    background: #fbf8ef;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
}

.badge-success { background: #e7f4d7; color: #3f6819; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #faedc7; color: #8a6500; }
.badge-info { background: #e3efcf; color: #4f7023; }

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(2, 20, 39, 0.58);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 18px;
    width: min(92vw, 560px);
    box-shadow: 0 24px 46px rgba(0, 0, 0, 0.24);
    animation: slideIn 0.25s ease;
}

.modal-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 18px 20px;
}

.close {
    color: #5c6a7f;
    font-size: 30px;
    cursor: pointer;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    border: 1px solid;
    font-size: 13px;
    font-weight: 600;
}

.alert-success { background: #ecfdf5; border-color: #86efac; color: #166534; }
.alert-danger { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.alert-info { background: #eff6ff; border-color: #93c5fd; color: #1e3a8a; }

.toast-container {
    position: fixed;
    inset-inline: 0;
    bottom: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    padding-inline: 12px;
}

.toast-alert {
    margin: 0;
    width: min(560px, calc(100vw - 24px));
    box-shadow: 0 14px 28px rgba(8, 28, 50, 0.22);
    transform: translateY(16px);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    pointer-events: auto;
    cursor: pointer;
}

.toast-alert.show {
    transform: translateY(0);
    opacity: 1;
}

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none; }
.loading { opacity: 0.7; pointer-events: none; }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

@keyframes slideIn {
    from { transform: translateY(-10px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .form-row,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .table th,
    .table td {
        padding: 10px 8px;
        font-size: 12px;
    }
}
