:root {
    --ink: #10151a;
    --ink-soft: #26313a;
    --red: #d91b21;
    --red-dark: #a90f14;
    --gold: #f7b026;
    --green: #00ad57;
    --paper: #fff8ef;
    --muted: #6b737c;
    --line: #eadfce;
    --white: #ffffff;
    --shadow: 0 24px 70px rgba(16, 21, 26, .22);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Montserrat, Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(247, 176, 38, .22), transparent 31rem),
        linear-gradient(135deg, var(--ink) 0%, #17212a 48%, #f4eee4 48.2%, #fffaf2 100%);
}

a {
    color: inherit;
}

button,
.secondary-button,
.admin-link {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    font-weight: 800;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

button {
    background: var(--red);
    color: var(--white);
    box-shadow: 0 12px 24px rgba(217, 27, 33, .24);
}

button:hover,
.secondary-button:hover,
.admin-link:hover {
    transform: translateY(-1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
    transform: none;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.hero {
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--white);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.brand img {
    width: 164px;
    height: auto;
    display: block;
    background: var(--white);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(360px, 520px);
    align-items: center;
    gap: 44px;
    flex: 1;
}

.hero-copy {
    color: var(--white);
}

.eyebrow {
    color: var(--gold);
    font-size: .82rem;
    font-weight: 900;
    letter-spacing: .16em;
    margin: 0 0 16px;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(2.35rem, 5.1vw, 4.9rem);
    line-height: 1;
    margin: 0;
    max-width: 840px;
    text-shadow: 0 3px 14px rgba(0, 0, 0, .35);
}

.intro {
    color: rgba(255, 255, 255, .82);
    font-size: 1.12rem;
    line-height: 1.7;
    max-width: 560px;
    margin: 24px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .34);
}

.admin-link {
    background: rgba(255, 255, 255, .12);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, .2);
    text-shadow: 0 2px 8px rgba(0, 0, 0, .32);
}

.message-card,
.admin-table-card {
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.message-card {
    padding: 28px;
}

label,
fieldset {
    display: block;
    margin: 0 0 18px;
}

label span,
legend {
    display: block;
    color: var(--ink-soft);
    font-size: .82rem;
    font-weight: 900;
    margin: 0 0 8px;
    text-transform: uppercase;
}

input[type="text"],
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    padding: 14px 15px;
    resize: vertical;
    outline: 0;
    background: #fffdf9;
}

input[type="text"]:focus,
textarea:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(217, 27, 33, .12);
}

.mode-choice {
    border: 0;
    padding: 0;
}

.mode-choice label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 10px 0 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf9;
}

.mode-choice label span {
    margin: 0;
    text-transform: none;
}

.sender-field {
    display: none;
}

.sender-field.is-visible {
    display: block;
}

.alert {
    border-radius: 8px;
    margin: 0 0 20px;
    padding: 14px 16px;
    font-weight: 800;
}

.alert.success {
    background: rgba(0, 173, 87, .12);
    color: #087140;
}

.alert.error {
    background: rgba(217, 27, 33, .12);
    color: var(--red-dark);
}

.admin-shell {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

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

.stats div {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 14px 32px rgba(16, 21, 26, .12);
}

.stats strong {
    display: block;
    font-size: 2rem;
}

.stats span {
    color: var(--muted);
    font-weight: 800;
}

.toolbar,
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.secondary-button {
    background: var(--ink);
    color: var(--white);
}

button.danger {
    background: var(--ink-soft);
    box-shadow: none;
}

.admin-table-card {
    padding: 16px;
    overflow: hidden;
}

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

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

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

th {
    color: var(--muted);
    font-size: .76rem;
    text-transform: uppercase;
}

.message-preview {
    max-width: 420px;
    white-space: normal;
}

.pill {
    border-radius: 999px;
    display: inline-block;
    font-size: .75rem;
    font-weight: 900;
    padding: 5px 9px;
}

.pill.pending {
    background: rgba(247, 176, 38, .2);
    color: #8b5a02;
}

.pill.printed {
    background: rgba(0, 173, 87, .14);
    color: #087140;
}

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

@media (max-width: 860px) {
    body {
        background: linear-gradient(180deg, var(--ink) 0 46%, #fffaf2 46%);
    }

    .hero-grid,
    .stats {
        grid-template-columns: 1fr;
    }

    .hero {
        gap: 28px;
    }

    .brand {
        align-items: flex-start;
        flex-direction: column;
    }

    .message-card {
        padding: 20px;
    }

    .admin-header {
        align-items: flex-start;
        flex-direction: column;
    }
}
