:root {
    --bg-top: #eef4fb;
    --bg-bottom: #f8fafc;
    --panel: #ffffff;
    --panel-border: #d8e0eb;
    --brand: #1f4f8d;
    --brand-strong: #143964;
    --text: #1c2733;
    --text-muted: #5f6b79;
    --warning-bg: #fff6e8;
    --warning-border: #e7c58c;
    --warning-text: #7a4f10;
    --error-bg: #fdebec;
    --error-border: #d7898d;
    --error-text: #8a2028;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

a {
    color: var(--brand);
}

a:hover {
    color: var(--brand-strong);
}

.site-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.site-header {
    background: linear-gradient(120deg, #153b69, #2a629f);
    color: #ffffff;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.site-title {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.25;
}

.site-subtitle {
    margin: 0.25rem 0 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.92rem;
}

.content-wrap {
    width: min(1220px, calc(100% - 2rem));
    margin: 1rem auto;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    margin: 0 0 0.85rem;
}

.mode-switch {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.panel-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
}

.panel-success {
    background: #eaf7ed;
    border-color: #a8d5b1;
    color: #1b5e20;
}

.panel-error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-text);
}

.panel-heading {
    margin: 0 0 0.65rem;
    font-size: 1.02rem;
}

.stack > * + * {
    margin-top: 0.7rem;
}

.inline-links {
    margin: 0;
    color: var(--text-muted);
}

label {
    color: var(--text);
}

input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea {
    border: 1px solid #c5d0de;
    border-radius: 6px;
    padding: 0.42rem 0.5rem;
    font: inherit;
    color: var(--text);
    background: #fff;
}

button,
input[type="submit"] {
    border: 1px solid #204f8c;
    background: #2f67a9;
    color: #fff;
    padding: 0.45rem 0.8rem;
    border-radius: 7px;
    font: inherit;
    cursor: pointer;
}

button:hover,
input[type="submit"]:hover {
    background: #23568f;
}

button:disabled,
input[type="submit"]:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
}

th,
td {
    border: 1px solid var(--panel-border);
    text-align: left;
    vertical-align: top;
    padding: 0.45rem 0.5rem;
}

th {
    background: #edf3fa;
}

.client-banner {
    display: none;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    margin: 0 0 0.85rem;
}

.client-banner.is-visible {
    display: block;
}

.site-footer {
    margin-top: 1rem;
    border-top: 1px solid var(--panel-border);
    color: var(--text-muted);
    text-align: center;
    font-size: 0.85rem;
    padding: 0.9rem 1rem 1rem;
}

@media (max-width: 640px) {
    .content-wrap {
        width: calc(100% - 1rem);
    }

    .site-title {
        font-size: 1.1rem;
    }
}
