html,
body {
    margin: 0;
    min-height: 100%;
    background: #0b1220;
    color: #e5e7eb;
    font-family: "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

button,
input,
select {
    font: inherit;
}

.admin-shell {
    min-height: 100vh;
    background: #0b1220;
    color: #e5e7eb;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    background: #111827;
    border-bottom: 1px solid #26344c;
}

.admin-brand {
    font-size: 22px;
    font-weight: 700;
}

.admin-user {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 12px;
}

.admin-signout,
button {
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 8px 10px;
    background: #1e293b;
    color: #fff;
    cursor: pointer;
}

.admin-signout:hover,
button:hover:not(:disabled) {
    background: #334155;
}

button.primary {
    background: #2563eb;
    border-color: #2563eb;
}

button.primary:hover:not(:disabled) {
    background: #1d4ed8;
}

button.danger {
    background: #7f1d1d;
    border-color: #991b1b;
}

button.danger:hover:not(:disabled) {
    background: #991b1b;
}

button:disabled {
    cursor: default;
    opacity: 0.55;
}

.admin-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.admin-content > h1 {
    margin: 0 0 18px;
    font-size: 26px;
}

.login-wrap {
    min-height: calc(100vh - 90px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: min(430px, 100%);
    padding: 26px;
    border: 1px solid #26344c;
    border-radius: 16px;
    background: #111b2d;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

.login-card h1 {
    margin: 0 0 6px;
    font-size: 26px;
}

.login-card p {
    margin: 0 0 18px;
    color: #94a3b8;
    line-height: 1.45;
}

.login-card label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 600;
    font-size: 13px;
}

.login-card input {
    width: 100%;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 11px;
    background: #0b1220;
    color: #fff;
    outline: none;
}

.login-card input:focus {
    border-color: #60a5fa;
}

.login-card button {
    width: 100%;
    margin-top: 20px;
    padding: 11px;
    border: 0;
    background: #2563eb;
    font-weight: 700;
}

.login-error,
.message,
.error {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 8px;
}

.login-error,
.error {
    background: #3f1d23;
    color: #fecaca;
}

.message {
    background: #163026;
    color: #bbf7d0;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.toolbar input[type="search"] {
    min-width: 280px;
    flex: 0 1 420px;
}

input,
select {
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 9px 10px;
    background: #111827;
    color: #fff;
}

.toolbar-spacer {
    flex: 1 1 auto;
}

.page-size,
.column-options label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.page-size {
    color: #94a3b8;
    font-size: 13px;
}

.column-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin: -6px 0 18px;
    padding: 10px 12px;
    border: 1px solid #26344c;
    border-radius: 10px;
    background: #0f172a;
    color: #cbd5e1;
    font-size: 13px;
}

.column-options > span {
    color: #94a3b8;
    font-weight: 600;
}

.column-options input[type="checkbox"] {
    width: 15px;
    height: 15px;
    padding: 0;
}

.result-summary {
    margin: 0 0 10px;
    color: #94a3b8;
    font-size: 13px;
}

.loading,
.empty {
    padding: 22px;
    border: 1px solid #26344c;
    border-radius: 12px;
    background: #111827;
    color: #94a3b8;
}

.user-card {
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid #26344c;
    border-radius: 14px;
    background: #111827;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.user-head {
    display: grid;
    gap: 12px;
    align-items: center;
    padding: 16px;
    background: #111b2d;
}

.user-head.cols-2 {
    grid-template-columns: minmax(300px, 2fr) minmax(140px, 1fr);
}

.user-head.cols-3 {
    grid-template-columns: minmax(280px, 2fr) repeat(2, minmax(140px, 1fr));
}

.user-head.cols-4 {
    grid-template-columns: minmax(270px, 2fr) repeat(3, minmax(130px, 1fr));
}

.user-head.cols-5 {
    grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(120px, 1fr));
}

.user-head.cols-6 {
    grid-template-columns: minmax(250px, 2fr) repeat(5, minmax(115px, 1fr));
}

.email {
    font-weight: 700;
    word-break: break-word;
}

.muted {
    color: #94a3b8;
    font-size: 12px;
}

.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #233149;
    color: #dbeafe;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #26344c;
}

.section {
    padding: 14px 16px;
    border-top: 1px solid #26344c;
}

.section h2 {
    margin: 0 0 10px;
    font-size: 15px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th,
td {
    padding: 9px 8px;
    border-bottom: 1px solid #233149;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

th {
    color: #94a3b8;
    font-weight: 600;
}

td:first-child,
th:first-child {
    white-space: normal;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 22px 0 4px;
}

.pagination span {
    min-width: 120px;
    text-align: center;
    color: #cbd5e1;
    font-size: 13px;
}

@media (max-width: 900px) {
    .admin-topbar {
        padding: 14px 16px;
    }

    .admin-content {
        padding: 16px;
    }

    .toolbar {
        flex-wrap: wrap;
    }

    .toolbar input[type="search"] {
        width: 100%;
        min-width: 0;
        flex-basis: 100%;
    }

    .toolbar-spacer {
        display: none;
    }

    .page-size {
        width: 100%;
        justify-content: space-between;
    }

    .user-head.cols-2,
    .user-head.cols-3,
    .user-head.cols-4,
    .user-head.cols-5,
    .user-head.cols-6 {
        grid-template-columns: 1fr 1fr;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .user-head.cols-2,
    .user-head.cols-3,
    .user-head.cols-4,
    .user-head.cols-5,
    .user-head.cols-6 {
        grid-template-columns: 1fr;
    }

    .actions {
        align-items: stretch;
    }

    .actions select,
    .actions button {
        width: 100%;
    }

    .pagination span {
        order: -1;
        width: 100%;
    }
}
