:root {
    --bg: #f5f7f8;
    --surface: #ffffff;
    --text: #17212b;
    --muted: #627181;
    --line: #dbe2e8;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --danger-bg: #fff1f2;
    --danger-text: #be123c;
    --shadow: 0 12px 30px rgba(23, 33, 43, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Open Sans", Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    padding: 24px;
    place-items: center;
}

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

.login-panel {
    width: min(100%, 420px);
    padding: 32px;
}

.login-panel h1,
.page-title h1 {
    margin: 0 0 20px;
    font-family: Raleway, Arial, Helvetica, sans-serif;
    font-size: 30px;
    line-height: 1.15;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

label {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--muted);
    font-weight: 700;
}

input {
    min-height: 42px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    padding: 8px 10px;
}

.button {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    min-height: 40px;
    padding: 8px 14px;
}

.button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    width: 100%;
    justify-content: center;
}

.button:hover {
    text-decoration: none;
}

.alert {
    border-radius: 6px;
    margin: 0 0 18px;
    padding: 12px;
}

.alert.error {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.alert.success {
    background: #ecfdf5;
    color: #047857;
}

.mail-log {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin: -6px 0 18px;
}

.secondary-login-action {
    margin-top: 14px;
    text-align: center;
}

.link-button {
    background: transparent;
    border: 0;
    color: var(--accent-dark);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 0;
}

.admin-header {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 20px;
    grid-template-columns: auto 1fr auto;
    min-height: 72px;
    padding: 14px 28px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.brand {
    color: var(--text);
    font-family: Raleway, Arial, Helvetica, sans-serif;
    font-size: 18px;
    font-weight: 900;
}

.admin-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-header nav a {
    border-radius: 6px;
    color: var(--muted);
    padding: 8px 10px;
}

.admin-header nav a[aria-current="page"] {
    background: #e6f4f1;
    color: var(--accent-dark);
}

.admin-shell {
    margin: 0 auto;
    max-width: 1200px;
    padding: 32px 24px 56px;
}

.page-title {
    margin-bottom: 22px;
}

.page-title p {
    color: var(--muted);
    margin: 0;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

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

.filter-bar {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 14px 16px;
}

.filter-bar span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.year-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.year-tabs a {
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    min-width: 68px;
    padding: 7px 10px;
    text-align: center;
}

.year-tabs a[aria-current="page"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.metric {
    padding: 22px;
}

.metric span {
    display: block;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
}

.metric p {
    color: var(--muted);
    margin: 10px 0 0;
}

.split-grid,
.detail-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
}

.panel {
    padding: 22px;
}

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

.panel h2,
.message-card h2 {
    font-family: Raleway, Arial, Helvetica, sans-serif;
    font-size: 18px;
    line-height: 1.25;
    margin: 0;
}

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

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

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

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.empty {
    color: var(--muted);
    margin: 0;
}

.message-list {
    display: grid;
    gap: 12px;
}

.message-list article {
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 2px;
    padding-bottom: 12px;
}

.message-list article:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.message-list span,
.field-list span,
.message-card span {
    color: var(--muted);
    font-size: 13px;
}

.field-list {
    display: grid;
    gap: 14px;
    margin: 18px 0 0;
}

.field-list div {
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 3px;
    padding-bottom: 12px;
}

.field-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.field-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.field-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.message-stack {
    display: grid;
    gap: 16px;
}

.message-card {
    display: grid;
    gap: 16px;
}

.message-card p {
    margin: 0;
}

@media (max-width: 820px) {
    .admin-header {
        grid-template-columns: 1fr;
        position: static;
    }

    .metrics,
    .split-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }
}
