@font-face {
    font-family: system-ui;
    src: local("Arial");
}

:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --warn-bg: #fef3c7;
    --warn-text: #92400e;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --info-bg: #dbeafe;
    --info-text: #1e40af;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: linear-gradient(180deg, #eef3ff 0%, var(--bg) 260px);
    color: var(--text);
    font-family: Tahoma, Arial, sans-serif;
    line-height: 1.8;
}

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

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

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

.topbar p {
    margin: 4px 0 0;
    color: var(--muted);
}

.topbar nav {
    display: flex;
    gap: 10px;
}

.topbar nav a,
.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 12px;
    border: 0;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.15s ease;
}

.topbar nav a:hover,
.btn:hover,
button:hover {
    background: var(--primary-dark);
}

.btn.secondary {
    background: #e5e7eb;
    color: #111827;
}

.btn.secondary:hover {
    background: #d1d5db;
}

.btn.disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 20px 50px rgba(30, 64, 175, 0.08);
}

.login-wrap {
    min-height: 62vh;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(420px, 100%);
}

.login-card h2 {
    margin-top: 0;
}

form label {
    display: block;
    margin-bottom: 14px;
    color: var(--text);
    font-weight: 700;
}

input {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    direction: ltr;
}

.hint,
small {
    color: var(--muted);
    display: block;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-head h2,
.section-head h3,
.section-head p {
    margin: 0;
}

.section-head p {
    color: var(--muted);
}

.section-head.small {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.badge {
    white-space: nowrap;
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 700;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    vertical-align: top;
}

th {
    color: #374151;
    background: #f9fafb;
}

tr:hover td {
    background: #fafcff;
}

.muted-row td {
    opacity: 0.75;
}

code {
    direction: ltr;
    unicode-bidi: embed;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 3px 7px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    display: inline-block;
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    margin-bottom: 4px;
}

.status.ok {
    background: var(--success-bg);
    color: var(--success-text);
}

.status.warn {
    background: var(--warn-bg);
    color: var(--warn-text);
}

.alert {
    padding: 12px 14px;
    border-radius: 14px;
    margin: 14px 0;
    font-weight: 700;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.alert-warning {
    background: var(--warn-bg);
    color: var(--warn-text);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info-text);
}

.empty {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    color: var(--muted);
    background: #f8fafc;
}

@media (max-width: 720px) {
    .topbar,
    .section-head {
        flex-direction: column;
    }

    .topbar nav {
        width: 100%;
    }

    .topbar nav a,
    .btn,
    button {
        width: 100%;
    }

    .card {
        padding: 16px;
    }
}
