/* نظام السحب العشوائي — التنسيقات */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background: #f0f4f8;
    color: #1e293b;
    min-height: 100vh;
}

nav {
    background: #0f172a;
    display: flex;
    gap: 4px;
    padding: 0 16px;
    flex-wrap: wrap;
}
nav a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 14px 18px;
    font-weight: 600;
    border-bottom: 3px solid transparent;
}
nav a:hover { color: #fff; }
nav a.active { color: #fff; border-bottom-color: #f59e0b; }
nav a.logout { margin-right: auto; color: #f87171; }

.container { max-width: 1000px; margin: 24px auto; padding: 0 16px; }

h1 { font-size: 1.5rem; margin-bottom: 20px; }
h2 { font-size: 1.1rem; margin-bottom: 12px; color: #334155; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card {
    background: #fff; border-radius: 12px; padding: 20px; text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.card-num { font-size: 2rem; font-weight: 800; color: #0f172a; }
.card-label { color: #64748b; margin-top: 4px; font-size: .9rem; }
.card.highlight { background: #0f172a; }
.card.highlight .card-num { color: #f59e0b; }
.card.highlight .card-label { color: #cbd5e1; }

.panel {
    background: #fff; border-radius: 12px; padding: 22px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 20px;
}

.steps { background: #fff; border-radius: 12px; padding: 22px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.steps ol { padding-right: 20px; line-height: 2.1; }

label { display: block; font-weight: 700; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=number], input[type=file], select {
    width: 100%; padding: 11px 12px; border: 1.5px solid #cbd5e1;
    border-radius: 8px; font-size: 1rem; background: #fff;
}
input:focus, select:focus { outline: none; border-color: #f59e0b; }

button, .btn-link {
    margin-top: 16px; background: #0f172a; color: #fff; border: none;
    padding: 12px 24px; border-radius: 8px; font-size: 1rem; font-weight: 700;
    cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .btn-link:hover { background: #1e293b; }
.btn-big { width: 100%; background: #f59e0b; color: #0f172a; font-size: 1.15rem; padding: 15px; }
.btn-big:hover { background: #d97706; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

.notice {
    padding: 13px 16px; border-radius: 8px; margin-bottom: 18px;
    background: #e0f2fe; border-right: 4px solid #0284c7;
}
.notice.ok { background: #dcfce7; border-right-color: #16a34a; }
.notice.error { background: #fee2e2; border-right-color: #dc2626; }
.big-notice { font-size: 1.1rem; font-weight: 700; }

.hint { color: #64748b; font-size: .88rem; margin-top: 12px; line-height: 1.8; }
.muted { color: #94a3b8; font-weight: 400; font-size: .85rem; }

.quota-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.quota-item input { font-size: 1.3rem; text-align: center; font-weight: 700; }

.checkbox-row { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-top: 18px; cursor: pointer; }
.checkbox-row input { width: auto; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 9px 12px; text-align: right; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
th { background: #f8fafc; color: #475569; position: sticky; top: 0; }
tbody tr:hover { background: #fffbeb; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form { flex: 1; min-width: 250px; }
.toolbar .btn-link, .toolbar button { margin-top: 0; }

.danger-zone { border: 1.5px solid #fecaca; }

.login-box {
    max-width: 380px; margin: 12vh auto; background: #fff; padding: 32px;
    border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.1); text-align: center;
}
.login-box h1 { font-size: 1.2rem; margin-bottom: 18px; }
.login-box button { width: 100%; }
.error { color: #dc2626; font-weight: 700; margin-bottom: 10px; }

@media (max-width: 600px) {
    nav a { padding: 12px 10px; font-size: .85rem; }
    h1 { font-size: 1.2rem; }
}

.big-number { font-size: 1.6rem !important; text-align: center; font-weight: 800; }

.mode-tabs { display: flex; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.mode-tab { flex: 1; min-width: 180px; cursor: pointer; margin: 0; }
.mode-tab input { display: none; }
.mode-tab span {
    display: block; text-align: center; padding: 14px; border: 2px solid #cbd5e1;
    border-radius: 10px; font-weight: 700; background: #fff; transition: .15s;
}
.mode-tab input:checked + span { border-color: #f59e0b; background: #fffbeb; }

.gov-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 6px; }
.gov-total-box { min-width: 180px; }
.gov-total-box input { font-size: 1.2rem; text-align: center; font-weight: 800; }
.btn-fill { margin-top: 0; background: #334155; padding: 11px 16px; font-size: .92rem; }
.btn-fill:hover { background: #475569; }
.btn-clear { background: #94a3b8; }
.btn-clear:hover { background: #64748b; }
.gov-table td { white-space: nowrap; }
.gov-table .gov-input { width: 110px; text-align: center; font-weight: 700; padding: 8px; }
#gov-sum { color: #d97706; font-size: 1.05rem; }

.gov-header-row td {
    background: #0f172a; color: #f59e0b; font-weight: 800;
    font-size: .95rem; padding: 10px 12px;
}
.gov-header-row:hover td { background: #0f172a; }