:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f766e;
    --accent: #06b6d4;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --bg: #f3f7fb;
    --surface: #ffffff;
    --surface-soft: #eef5ff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #dbe7f3;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fa 100%);
    color: var(--text);
    direction: rtl;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #06b6d4 100%);
    color: #fff;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.site-header .container {
    padding: 28px 20px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.brand h1 {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 800;
}

.brand p {
    margin: 0;
    color: rgba(255,255,255,0.85);
    font-size: 15px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-links a {
    color: #fff;
    background: rgba(255,255,255,0.12);
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 700;
    transition: 0.2s ease;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.22);
    transform: translateY(-1px);
}

.hero-card,
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 28px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f2f8ff 100%);
}

.section-title {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.subtle {
    color: var(--muted);
    font-size: 15px;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.stat-card {
    padding: 22px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card .label {
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 34px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.stat-card .note {
    margin-top: 8px;
    color: var(--text);
}

.card {
    padding: 24px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
    color: var(--text);
}

input,
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    font-size: 15px;
    background: #fff;
    color: var(--text);
    transition: 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.btn {
    display: inline-block;
    border: 0;
    border-radius: 16px;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.25);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #22c55e 100%);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #ef4444 100%);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #f59e0b 100%);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th, td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: right;
}

th {
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 800;
}

tr:hover td {
    background: #f8fbff;
}

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-weight: 700;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.site-footer {
    padding: 18px 0 30px;
    color: var(--muted);
    text-align: center;
}

.auth-shell {
    max-width: 760px;
    margin: 0 auto 30px;
}

.auth-card {
    padding: 28px;
}

.split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.kpi-note {
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 768px) {
    .brand h1 {
        font-size: 24px;
    }

    .section-title {
        font-size: 20px;
    }

    .stat-card .value {
        font-size: 28px;
    }

    .site-header .container,
    .hero-card,
    .card,
    .auth-card {
        padding: 20px;
    }
}