* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f4f6;
    color: #111827;
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    background: #111827;
    color: white;
    min-height: 64px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand strong {
    font-size: 17px;
}

.brand span {
    color: #cbd5e1;
    font-size: 13px;
}

.topbar nav {
    display: flex;
    gap: 18px;
    align-items: center;
}

.topbar nav a {
    font-weight: bold;
}

.topbar nav a:hover {
    color: #93c5fd;
}

.container {
    width: min(1180px, calc(100% - 28px));
    margin: 24px auto;
}

.page-head {
    margin-bottom: 18px;
}

.page-head h1 {
    margin: 0;
    font-size: 30px;
}

.page-head p {
    margin: 7px 0 0;
    color: #6b7280;
}

.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.card h2 {
    margin-top: 0;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 18px;
}

.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.stat-card span {
    color: #6b7280;
    display: block;
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 34px;
}

.form-grid {
    display: grid;
    gap: 10px;
}

label {
    font-weight: bold;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    background: white;
}

textarea {
    resize: vertical;
}

button,
.btn {
    border: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: #2563eb;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

button:hover,
.btn:hover {
    background: #1d4ed8;
}

.btn.gray,
button.gray {
    background: #6b7280;
}

.btn.gray:hover,
button.gray:hover {
    background: #4b5563;
}

.small {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 7px;
}

.ok-btn {
    background: #15803d;
}

.ok-btn:hover {
    background: #166534;
}

.warn-btn {
    background: #d97706;
}

.warn-btn:hover {
    background: #b45309;
}

.danger-btn {
    background: #dc2626;
}

.danger-btn:hover {
    background: #b91c1c;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

th,
td {
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px;
    vertical-align: top;
}

th {
    background: #f9fafb;
    font-size: 13px;
    text-transform: uppercase;
    color: #374151;
}

td small {
    color: #6b7280;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.badge.ok {
    background: #dcfce7;
    color: #166534;
}

.badge.warn {
    background: #fef3c7;
    color: #92400e;
}

.badge.bad {
    background: #fee2e2;
    color: #991b1b;
}

.inline-form {
    display: grid;
    gap: 6px;
    min-width: 150px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: bold;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert.warning {
    background: #fef3c7;
    color: #92400e;
}

.muted {
    color: #6b7280;
}

.info-box {
    margin-top: 16px;
    background: #eff6ff;
    color: #1e40af;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.max-600 {
    max-width: 600px;
}

.footer {
    text-align: center;
    color: #6b7280;
    padding: 20px;
    font-size: 13px;
}

.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #111827, #1e3a8a);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: min(420px, 100%);
    background: white;
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

.login-card h1 {
    margin: 0 0 8px;
}

.login-card p {
    margin-top: 0;
    color: #6b7280;
}

.login-card form {
    display: grid;
    gap: 10px;
}

.login-card button {
    margin-top: 8px;
}

.login-help {
    margin-top: 16px;
    color: #6b7280;
    font-size: 13px;
    background: #f9fafb;
    padding: 12px;
    border-radius: 10px;
}

@media (max-width: 900px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px;
        gap: 10px;
    }

    .topbar nav {
        flex-wrap: wrap;
    }

    .grid-2,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .search-form {
        display: grid;
    }
}
.login-body {
    min-height: 100vh;
    margin: 0;
    background: radial-gradient(circle at top, #1e40af 0%, #111827 55%, #020617 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: min(430px, 100%);
    background: #ffffff;
    border-radius: 18px;
    padding: 34px 30px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.login-logo {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    margin-bottom: 18px;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 31px;
    color: #020617;
}

.login-card p {
    margin: 0 0 22px;
    color: #64748b;
}

.login-card form {
    display: grid;
    gap: 11px;
}

.login-card label {
    color: #111827;
    font-weight: 700;
    font-size: 14px;
}

.login-card input {
    height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
}

.login-card input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.login-card button {
    margin-top: 8px;
    height: 46px;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    border: 0;
    font-weight: 800;
    cursor: pointer;
}

.login-card button:hover {
    background: #1d4ed8;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-weight: 700;
}

.alert.danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}