:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --bg: #0f172a;
    --surface: #111827;
    --surface-soft: #1f2937;
    --surface-muted: #334155;
    --text: #e5eefb;
    --text-soft: #94a3b8;
    --border: rgba(148, 163, 184, 0.18);
    --shadow: 0 24px 50px rgba(15, 23, 42, 0.28);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
}

body {
    font-family: "IBM PG Arabic", "Inter", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 26%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 24%),
        linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: var(--text);
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.card {
    background: rgba(17, 24, 39, 0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-danger {
    background: rgba(220, 38, 38, 0.12);
    color: #fecaca;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.btn-small {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
}

.field {
    display: grid;
    gap: 8px;
}

.field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
}

.input,
.select {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.75);
    color: var(--text);
}

.input:focus,
.select:focus {
    outline: 2px solid rgba(59, 130, 246, 0.35);
    border-color: rgba(59, 130, 246, 0.4);
}

.status {
    display: none;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.status.show {
    display: block;
}

.status.error {
    background: rgba(220, 38, 38, 0.12);
    color: #fecaca;
}

.status.success {
    background: rgba(22, 163, 74, 0.12);
    color: #bbf7d0;
}

.muted {
    color: var(--text-soft);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.badge.online {
    background: rgba(22, 163, 74, 0.16);
    color: #bbf7d0;
}

.badge.offline {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
}

.badge.admin {
    background: rgba(217, 119, 6, 0.18);
    color: #fde68a;
}

.badge.user {
    background: rgba(59, 130, 246, 0.16);
    color: #bfdbfe;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 6, 23, 0.72);
    z-index: 30;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: min(460px, 100%);
    padding: 24px;
}

.modal-header {
    margin-bottom: 18px;
}

.modal-header h3 {
    font-size: 20px;
    margin-bottom: 6px;
}

.modal-body {
    display: grid;
    gap: 14px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100%, calc(100% - 20px));
    }
}
