:root {
    --bg: #f4f7fb;
    --dark: #0f172a;
    --muted: #64748b;
    --card: #ffffff;
    --primary: #0891b2;
    --primary-soft: #ecfeff;
    --danger: #dc2626;
    --success: #16a34a;
    --line: #e2e8f0;
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--dark);
}

a {
    color: inherit;
    text-decoration: none;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 20% 20%, rgba(8,145,178,.18), transparent 32%),
        linear-gradient(135deg, #e0f2fe, #f8fafc 45%, #fff7ed);
}

.login-card {
    width: min(100%, 460px);
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 30px;
    padding: 34px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.login-logo {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #22d3ee, #f97316);
    color: #082f49;
    font-weight: 900;
    margin: 16px 0 20px;
}

.back-public,
.muted,
small {
    color: var(--muted);
}

.login-card h1 {
    margin: 0 0 8px;
    letter-spacing: -0.04em;
    font-size: 2rem;
}

.login-card p {
    color: var(--muted);
    line-height: 1.55;
}

.form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 750;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 13px 14px;
    font: inherit;
    background: #fff;
    outline: none;
    transition: 0.18s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(8,145,178,.12);
}

textarea {
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    padding: 12px 17px;
    font-weight: 850;
    cursor: pointer;
    transition: .18s ease;
    white-space: nowrap;
}

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

.btn.primary {
    background: linear-gradient(135deg, #0891b2, #22d3ee);
    color: white;
    box-shadow: 0 14px 30px rgba(8,145,178,.22);
}

.btn.secondary {
    background: var(--primary-soft);
    color: #155e75;
}

.btn.ghost {
    background: #f8fafc;
    color: var(--muted);
}

.btn.danger {
    background: #fee2e2;
    color: var(--danger);
}

.btn.small {
    padding: 8px 12px;
    font-size: .86rem;
}

.alert {
    padding: 13px 15px;
    border-radius: 16px;
    margin: 14px 0;
    border: 1px solid transparent;
}

.alert.error {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca;
}

.alert.success {
    color: #166534;
    background: #dcfce7;
    border-color: #bbf7d0;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    padding: 24px;
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.admin-brand span {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    background: linear-gradient(135deg, #22d3ee, #f97316);
    color: #082f49;
    display: grid;
    place-items: center;
    font-weight: 900;
}

.sidebar nav {
    display: grid;
    gap: 8px;
}

.sidebar nav a,
.logout {
    padding: 12px 14px;
    border-radius: 14px;
    color: #cbd5e1;
    transition: .18s ease;
}

.sidebar nav a:hover,
.logout:hover {
    background: rgba(255,255,255,.08);
    color: white;
}

.logout {
    margin-top: auto;
    background: rgba(239,68,68,.10);
    color: #fecaca;
}

.admin-main {
    margin-left: 270px;
    padding: 28px;
}

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

.eyebrow {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .13em;
    font-size: .78rem;
    font-weight: 900;
}

.admin-top h1,
.panel-title h2 {
    margin: 5px 0 0;
    letter-spacing: -.04em;
}

.admin-user {
    text-align: right;
    background: white;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px 16px;
}

.admin-user span,
.admin-user small {
    display: block;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.metric-card,
.panel-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.metric-card {
    padding: 24px;
}

.metric-card span,
.metric-card small {
    color: var(--muted);
    display: block;
}

.metric-card strong {
    display: block;
    font-size: 2.2rem;
    margin-top: 8px;
    letter-spacing: -.04em;
}

.metric-card.wide strong {
    font-size: 1.35rem;
}

.panel-card {
    padding: 24px;
    margin-bottom: 18px;
}

.panel-card.narrow {
    max-width: 860px;
}

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

.panel-card p {
    color: var(--muted);
    line-height: 1.65;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

td small {
    display: block;
    margin-top: 5px;
}

.status {
    display: inline-flex;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .82rem;
    font-weight: 850;
}

.status.active {
    background: #dcfce7;
    color: var(--success);
}

.status.inactive {
    background: #f1f5f9;
    color: var(--muted);
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.actions form {
    margin: 0;
}

.admin-form small {
    color: var(--muted);
    font-weight: 500;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.check-row input {
    width: auto;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.empty-admin {
    text-align: center;
    padding: 34px;
    background: #f8fafc;
    border: 1px dashed var(--line);
    border-radius: 22px;
}

.small {
    font-size: .88rem;
}

@media (max-width: 940px) {
    .sidebar {
        position: static;
        width: auto;
        min-height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .sidebar nav {
        display: flex;
        flex-wrap: wrap;
    }

    .logout {
        margin-top: 0;
        margin-left: auto;
    }

    .admin-main {
        margin-left: 0;
    }

    .cards-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .admin-top,
    .panel-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-user {
        text-align: left;
    }
}

.status.source {
    background: #e0f2fe;
    color: #0369a1;
    margin-bottom: 6px;
}
