/* =====================================================
   DATASTIC ADMIN
   Uses the main site's palette and fonts.
   ===================================================== */

/* 01 — TOKENS */
:root {
    --brand-red: #f32f36;
    --action-red: #cf2029;
    --action-red-hover: #b71922;
    --peach: #ffd2a3;
    --ivory: #fffaf5;
    --white: #ffffff;
    --ink: #202329;
    --muted: #626975;
    --line: #e8e2dc;

    --heading-font: "Manrope", sans-serif;
    --body-font: "DM Sans", sans-serif;
}

/* 02 — BASE */
body {
    background: var(--ivory);
    color: var(--ink);
    font-family: var(--body-font);
}

a {
    color: var(--action-red);
}

a:hover {
    color: var(--action-red-hover);
}

code {
    color: var(--ink);
    background: var(--ivory);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1px 6px;
    font-size: 0.8125rem;
}

.admin-main {
    padding: 32px 0 64px;
}

/* 03 — HEADER */
.admin-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.admin-brand img {
    width: auto;
    height: 34px;
}

.admin-brand span {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    border-left: 1px solid var(--line);
    padding-left: 10px;
}

.admin-nav-link {
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
}

.admin-badge {
    background: var(--brand-red);
    font-size: 0.7rem;
    vertical-align: 2px;
}

.admin-user {
    color: var(--muted);
    font-size: 0.875rem;
}

/* 04 — TYPOGRAPHY */
.admin-title {
    font-family: var(--heading-font);
    font-weight: 800;
    font-size: 1.75rem;
    margin: 0;
}

.admin-subtitle,
.admin-count {
    color: var(--muted);
    font-size: 0.9375rem;
}

/* 05 — BUTTONS */
.btn-admin {
    background: var(--action-red);
    border-color: var(--action-red);
    color: var(--white);
    font-weight: 600;
}

.btn-admin:hover,
.btn-admin:focus-visible {
    background: var(--action-red-hover);
    border-color: var(--action-red-hover);
    color: var(--white);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--peach);
    box-shadow: 0 0 0 0.2rem rgba(243, 47, 54, 0.15);
}

/* 06 — STATS */
.stat-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 20px;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--muted);
}

.stat-value {
    font-family: var(--heading-font);
    font-weight: 800;
    font-size: 1.75rem;
    line-height: 1.1;
}

.stat-value-accent {
    color: var(--action-red);
}

/* 07 — TABLE */
.table-card,
.detail-card,
.empty-state {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.table-card {
    overflow: hidden;
}

.admin-table {
    font-size: 0.9375rem;
}

.admin-table th {
    background: var(--ivory);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom-color: var(--line);
    padding: 12px 16px;
}

.admin-table td {
    border-bottom-color: var(--line);
    padding: 14px 16px;
}

.admin-table tbody tr {
    position: relative;
}

.admin-table tbody tr:hover td {
    background: #fff6ee;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.row-link {
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
}

.is-unread td {
    font-weight: 600;
}

.is-unread .row-link {
    font-weight: 700;
}

.unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--brand-red);
    vertical-align: 1px;
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--muted);
}

.pagination .page-link {
    color: var(--ink);
}

.pagination .active .page-link {
    background: var(--action-red);
    border-color: var(--action-red);
    color: var(--white);
}

/* 08 — DETAIL */
.back-link {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 0.9375rem;
    text-decoration: none;
}

.detail-card {
    padding: 24px;
}

.detail-heading {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
}

.detail-message {
    font-size: 1rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.detail-list {
    margin: 0;
}

.detail-list dt {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
}

.detail-list dd {
    margin-bottom: 14px;
}

.detail-list dd:last-child {
    margin-bottom: 0;
}

/* 09 — AUTH */
.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 96px);
    padding: 0 16px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 32px;
}

.auth-logo {
    display: block;
    width: auto;
    height: 44px;
    margin: 0 auto 20px;
}

.auth-title {
    font-family: var(--heading-font);
    font-weight: 800;
    font-size: 1.375rem;
    text-align: center;
    margin-bottom: 24px;
}

/* 10 — SMALL SCREENS */
@media (max-width: 575.98px) {
    .admin-main {
        padding-top: 24px;
    }

    .admin-title {
        font-size: 1.5rem;
    }

    .stat-card {
        padding: 12px 14px;
    }

    .stat-value {
        font-size: 1.375rem;
    }
}
