:root {
    --bg: #eef5fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --danger: #b91c1c;
    --success: #166534;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(circle at 5% 5%, #dff4ff 0, #eef5fb 35%, #f7fafc 100%);
    color: var(--text);
}

body.admin-dashboard {
    background:
        radial-gradient(circle at 12% 8%, rgba(26, 58, 102, 0.45) 0%, rgba(26, 58, 102, 0) 40%),
        radial-gradient(circle at 84% 14%, rgba(9, 85, 119, 0.35) 0%, rgba(9, 85, 119, 0) 42%),
        linear-gradient(180deg, #0b1320 0%, #101a2a 50%, #0c1524 100%);
    color: #e5e7eb;
    min-height: 100vh;
}

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-shell {
    background:
        radial-gradient(circle at 10% 20%, rgba(13, 148, 136, 0.10) 0, rgba(13, 148, 136, 0) 35%),
        radial-gradient(circle at 90% 0%, rgba(59, 130, 246, 0.10) 0, rgba(59, 130, 246, 0) 32%),
        linear-gradient(135deg, #e8f0f7 0%, #f4f8fb 40%, #eef4f9 100%);
}

.auth-card-single {
    width: min(520px, 100%);
    padding: 28px;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
}

.auth-brand {
    margin-bottom: 18px;
}

.auth-brand h1 {
    font-size: 34px;
    margin-top: 16px;
    margin-bottom: 8px;
}

.auth-brand p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.auth-frame {
    width: min(560px, 100%);
}

.auth-hero {
    display: none;
}

.auth-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.18);
    color: #a7f3d0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-hero h1 {
    margin-top: 18px;
    margin-bottom: 12px;
    font-size: 44px;
    line-height: 1.05;
    color: #f8fafc;
}

.auth-hero p {
    margin: 0 0 18px;
    max-width: 42ch;
    color: #cbd5e1;
    line-height: 1.65;
}

.auth-hero ul {
    margin: 0;
    padding-left: 18px;
    color: #e2e8f0;
    line-height: 1.8;
}

.auth-card {
    width: 100%;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
}

.auth-tabs {
    display: none;
}

.auth-tab {
    width: auto;
    margin-top: 0;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: #0f172a;
    padding: 10px 16px;
}

.auth-tab.active {
    background: #0f766e;
    color: #fff;
    border-color: #0f766e;
}

.auth-panels {
    display: block;
    min-height: auto;
}

.auth-panel {
    display: block;
}

.auth-panel.active {
    display: block;
}

.auth-panel h2 {
    font-size: 28px;
}

.auth-link-btn {
    width: auto;
    margin-top: 14px;
    padding: 0;
    background: transparent;
    color: #0f766e;
    border: none;
    font-weight: 700;
    text-decoration: underline;
}

.auth-link-btn:hover {
    background: transparent;
    color: #115e59;
}

.auth-form-title {
    font-size: 34px;
    margin-bottom: 8px;
}

.auth-switch-row {
    margin-top: 10px;
}

.auth-switch-link {
    font-size: 13px;
    color: #0f766e;
    text-decoration: underline;
    font-weight: 700;
}

.auth-switch-link:hover {
    color: #115e59;
}

.page-wrap {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px 24px;
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
    padding: 20px;
    margin-bottom: 16px;
}

h1, h2 {
    margin: 0 0 10px;
}

.sub {
    margin-top: 0;
    color: var(--muted);
}

label {
    display: block;
    font-weight: 600;
    margin: 12px 0 6px;
}

input, textarea, button {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-size: 14px;
}

textarea {
    resize: vertical;
}

button {
    margin-top: 14px;
    border: none;
    color: #fff;
    background: var(--primary);
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    background: var(--primary-dark);
}

.btn-light {
    width: auto;
    margin-top: 0;
    background: #334155;
}

.btn-danger-ghost {
    width: auto;
    margin-top: 0;
    background: #dc2626;
    border-radius: 10px;
    padding: 9px 14px;
}

.btn-danger-ghost:hover {
    background: #b91c1c;
}

.inline-form {
    display: inline;
}

.grid-form {
    max-width: 520px;
}

.auth-panel form {
    max-width: 100%;
}

.auth-panel input,
.auth-panel button {
    min-height: 46px;
}

.auth-panel button {
    margin-top: 16px;
}

.alert {
    border-radius: 8px;
    padding: 10px 12px;
    margin: 8px 0 16px;
    font-weight: 600;
}

.alert.error {
    background: #fee2e2;
    color: var(--danger);
}

.alert.success {
    background: #dcfce7;
    color: var(--success);
}

.alert.info {
    background: #e0f2fe;
    color: #0c4a6e;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    border-bottom: 1px solid var(--border);
    padding: 10px 8px;
    vertical-align: top;
}

.status-badge {
    display: inline-block;
    min-width: 74px;
    text-align: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #b91c1c;
}

.status-btn {
    width: auto;
    margin-top: 0;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
}

.status-btn.disable {
    background: #ef4444;
}

.status-btn.disable:hover {
    background: #dc2626;
}

.status-btn.enable {
    background: #2563eb;
}

.status-btn.enable:hover {
    background: #1d4ed8;
}

.status-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.row-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.delete-btn {
    width: auto;
    margin-top: 0;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    background: #7f1d1d;
    color: #fff;
}

.delete-btn:hover {
    background: #991b1b;
}

.delete-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.dashboard-dark {
    max-width: 1600px;
    position: relative;
    z-index: 0;
}

.dashboard-dark::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 12% 8%, rgba(26, 58, 102, 0.45) 0%, rgba(26, 58, 102, 0) 40%),
        radial-gradient(circle at 84% 14%, rgba(9, 85, 119, 0.35) 0%, rgba(9, 85, 119, 0) 42%),
        linear-gradient(180deg, #0b1320 0%, #101a2a 50%, #0c1524 100%);
}

body.admin-dashboard .dashboard-dark {
    padding-top: 8px;
    padding-bottom: 36px;
}

.dark-topbar {
    background: #111a2a;
    color: #e5e7eb;
    border: 1px solid #243347;
    border-radius: 12px;
    padding: 14px 18px;
}

.dark-topbar h1 {
    color: #f8fafc;
    margin: 0;
    font-size: 32px;
}

.topbar-actions-dark {
    color: #d1d5db;
    gap: 10px;
}

.dark-card {
    background: #161f30;
    color: #e5e7eb;
    border: 1px solid #27364d;
    box-shadow: none;
}

.dark-card h2,
.dark-card h3,
.dark-card th,
.dark-card td {
    color: #e5e7eb;
}

.dark-card input,
.dark-card select,
.dark-card textarea {
    background: #1d2a3f;
    border: 1px solid #2c3e59;
    color: #f8fafc;
}

.dark-card input::placeholder {
    color: #94a3b8;
}

.dark-table th,
.dark-table td {
    border-bottom: 1px solid #29364d;
}

.dark-alert {
    border: 1px solid transparent;
}

.role-pill {
    display: inline-block;
    border-radius: 999px;
    font-size: 12px;
    padding: 2px 10px;
    font-weight: 700;
    text-transform: capitalize;
}

.role-user {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

.role-admin {
    background: rgba(34, 197, 94, 0.16);
    color: #4ade80;
}

.add-title {
    margin-top: 16px;
    margin-bottom: 10px;
    font-size: 24px;
}

.add-user-inline {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1fr 1fr 0.8fr auto;
    gap: 10px;
    align-items: center;
}

.add-user-inline input,
.add-user-inline select,
.add-user-inline button {
    margin-top: 0;
    width: 100%;
}

.btn-add-user {
    background: #2563eb;
    min-width: 112px;
}

.btn-add-user:hover {
    background: #1d4ed8;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .2s;
    border-radius: 999px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: #0f766e;
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
}

.switch.disabled {
    opacity: 0.5;
    pointer-events: none;
}

@media (max-width: 760px) {
    .auth-card-single {
        padding: 22px;
    }

    .auth-frame {
        width: 100%;
    }

    .auth-hero {
        padding: 24px;
    }

    .auth-hero h1 {
        font-size: 34px;
    }

    .dark-topbar h1 {
        font-size: 25px;
    }

    .card {
        padding: 16px;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .add-user-inline {
        grid-template-columns: 1fr;
    }

    .auth-tabs {
        flex-direction: column;
    }
}
