:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --text: #1f2937;
    --muted: #64748b;
    --border: #e2e8f0;
    --header-bg: #1f2937;
    --header-text: #ffffff;
    --header-muted: #cbd5e1;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    line-height: 1.5;
}

.container {
    width: min(960px, calc(100% - 2rem));
    margin-inline: auto;
}

.site-header {
    background: var(--header-bg);
    color: var(--header-text);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.brand {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.stage {
    color: var(--header-muted);
    font-size: 0.85rem;
}

.page {
    flex: 1;
    padding: 3rem 0;
}

.hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
}

.hero h1 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.8rem;
}

.lead {
    margin-top: 0;
    font-size: 1.1rem;
}

.note {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

code {
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f1f5f9;
    font-size: 0.95em;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.brand {
    color: var(--header-text);
    text-decoration: none;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
}

.site-nav a {
    color: var(--header-text);
    text-decoration: none;
}

.site-nav a:hover,
.link-button:hover {
    text-decoration: underline;
}

.user-name {
    color: var(--header-muted);
}

.badge {
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--header-muted);
    border-radius: 999px;
    color: var(--header-text);
    font-size: 0.8rem;
}

.inline-form {
    margin: 0;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--header-text);
    font: inherit;
    cursor: pointer;
}

.auth-card {
    max-width: 460px;
    margin-inline: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
}

.auth-card h1 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 1.25rem;
}

.auth-form label {
    margin-top: 0.5rem;
    font-weight: 600;
}

.auth-form input,
.auth-form select {
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    color: var(--text);
    background: #ffffff;
}

.auth-form input:focus,
.auth-form select:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
    border-color: #60a5fa;
}

.button {
    margin-top: 1rem;
    padding: 0.6rem 1rem;
    border: 0;
    border-radius: 8px;
    background: var(--header-bg);
    color: var(--header-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.button:hover {
    background: #111827;
}

.field-error {
    margin: 0;
    color: #b91c1c;
    font-size: 0.9rem;
}

.alert {
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
}

.alert-info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

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

.error-list {
    margin: 0.75rem 0 0;
    padding-left: 1.25rem;
    color: #991b1b;
    font-size: 0.9rem;
}

.home-state {
    margin-top: 1rem;
}

a {
    color: #1d4ed8;
}

.alert a {
    color: inherit;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
}

.panel h1 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.6rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.page-header h1 {
    margin-bottom: 0.35rem;
}

.page-header .button {
    margin-top: 0;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.page-actions .button {
    margin-top: 0;
}

.page-header .note {
    margin-bottom: 0;
}

.button {
    display: inline-block;
    text-decoration: none;
}

.button-secondary {
    display: inline-block;
    padding: 0.6rem 0;
    color: var(--muted);
    text-decoration: none;
}

.button-secondary:hover {
    text-decoration: underline;
}

.contact-form-panel {
    max-width: 560px;
    margin-inline: auto;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.form-actions .button {
    margin-top: 0;
}

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

.contact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.contact-table th,
.contact-table td {
    padding: 0.7rem 0.6rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.contact-table th {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

.contact-table .actions {
    white-space: nowrap;
}

.contact-table .actions a {
    margin-right: 0.75rem;
}

.contact-table .actions form {
    display: inline;
}

.danger {
    color: #b91c1c;
}

.muted {
    color: var(--muted);
}

.empty-state {
    padding: 2rem 1rem;
    border: 1px dashed var(--border);
    border-radius: 10px;
    text-align: center;
    color: var(--muted);
}

.empty-state p {
    margin: 0.35rem 0;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.admin-nav a {
    font-weight: 600;
    text-decoration: none;
}

.admin-nav a:hover {
    text-decoration: underline;
}

.warning-note {
    margin-top: 1.25rem;
    color: #92400e;
}
