:root {
    --navy: #061f35;
    --navy-2: #062238;
    --blue: #0a2b45;
    --cyan: #28a8c7;
    --red: #b21722;
    --background: #e9eef2;
    --surface: #ffffff;
    --soft: #f4f7f9;
    --text: #354852;
    --muted: #5c6f75;
    --line: #dbe3e8;
    --shadow: 0 18px 45px rgba(6, 31, 53, .09);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

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

.hero {
    color: #fff;
    background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 64%, #0d425e 100%);
    border-bottom: 5px solid var(--cyan);
}

.hero__inner { min-height: 250px; display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 40px 0; }
.eyebrow { margin: 0 0 10px; color: var(--cyan); font-size: 12px; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase; }
.eyebrow--dark { color: #2a5d7c; }
.hero h1 { margin: 0; font-size: clamp(40px, 6vw, 70px); line-height: 1; letter-spacing: -2px; }
.hero h1 span { color: var(--cyan); }
.subtitle { margin: 16px 0 0; color: #d8e5eb; font-size: 20px; }
.event-chip { min-width: 260px; padding: 20px 22px; border: 1px solid #356379; background: rgba(10, 43, 69, .72); }
.event-chip strong, .event-chip span { display: block; }
.event-chip strong { font-size: 21px; }
.event-chip span { margin-top: 5px; color: #d8e5eb; font-size: 14px; }

.main { padding: 32px 0 56px; }
.notice { margin-bottom: 24px; padding: 18px 20px; border-left: 5px solid var(--cyan); background: #fff; box-shadow: var(--shadow); }
.notice strong { color: var(--navy); font-size: 18px; }
.notice p { margin: 4px 0 0; }
.notice ul { margin: 10px 0 0; padding-left: 20px; max-height: 210px; overflow: auto; }
.notice--success { border-color: #18865b; }
.notice--warning { border-color: #d6921e; }
.notice--error { border-color: var(--red); }
code { padding: 2px 5px; background: var(--soft); color: var(--navy); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 42px; }
.stats article { min-height: 142px; padding: 22px; background: #fff; border-top: 4px solid var(--cyan); box-shadow: var(--shadow); }
.stats span, .stats small { display: block; }
.stats span { color: #2a5d7c; font-size: 12px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; }
.stats strong { display: block; margin: 7px 0 2px; color: var(--navy); font-size: 38px; line-height: 1.1; }
.stats small { color: var(--muted); }

.section-heading { margin: 0 0 18px; }
.section-heading h2, .table-card h2 { margin: 0; color: var(--navy); font-size: 28px; line-height: 1.2; }
.operation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.operation-grid.is-disabled { opacity: .48; pointer-events: none; }
.panel { display: grid; grid-template-columns: 70px 1fr; min-height: 330px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel__number { padding-top: 25px; color: var(--cyan); background: var(--navy); font-size: 22px; font-weight: 800; text-align: center; }
.panel__body { display: flex; flex-direction: column; padding: 26px; }
.panel h3 { margin: 0; color: var(--navy); font-size: 23px; }
.panel p { margin: 8px 0 20px; }
.panel form { display: flex; flex: 1; flex-direction: column; justify-content: flex-end; gap: 14px; }
.panel--accent .panel__number { background: #0a526c; }
.panel--danger .panel__number { background: var(--red); color: #fff; }

label span { display: block; margin-bottom: 6px; color: #2a5d7c; font-size: 12px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
input[type="number"], input[type="file"], input[type="search"], input[type="text"], input[type="password"] { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #b8c8d0; border-radius: 2px; background: #fff; color: var(--navy); font: inherit; }
input:focus { outline: 3px solid rgba(40, 168, 199, .18); border-color: var(--cyan); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.file-field { padding: 13px; background: var(--soft); border: 1px dashed #9db2bd; }
.check { display: flex; align-items: flex-start; gap: 9px; padding: 12px; background: #fff5f5; border: 1px solid #e6b7ba; }
.check input { margin-top: 3px; }
.check span { margin: 0; color: #703038; letter-spacing: 0; text-transform: none; }
.button { min-height: 48px; padding: 12px 18px; border: 0; color: #fff; font-size: 15px; font-weight: 800; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button--primary { background: #2a5d7c; }
.button--secondary { background: #0a526c; }
.button--danger { background: var(--red); }
.button--compact { min-height: 44px; padding: 9px 22px; }

.table-card { margin-top: 38px; background: #fff; box-shadow: var(--shadow); }
.table-card__header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.legend { color: var(--muted); font-size: 13px; }
.legend i { display: inline-block; width: 9px; height: 9px; margin-right: 4px; background: #18865b; border-radius: 50%; }
.people-search { padding: 20px 26px; background: var(--soft); border-bottom: 1px solid var(--line); }
.people-search > label { display: block; margin-bottom: 7px; color: #2a5d7c; font-size: 12px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.people-search__row { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto; align-items: center; gap: 10px; }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 16px; color: #2a5d7c; border: 1px solid #9db2bd; background: #fff; font-size: 14px; font-weight: 800; text-decoration: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: #2a5d7c; background: var(--soft); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
td { font-size: 14px; }
td strong { color: var(--navy); }
.status { display: inline-block; padding: 4px 9px; border-radius: 20px; font-size: 12px; font-weight: 800; }
.status--sent { color: #116140; background: #dcf4e9; }
.status--pending { color: #76530e; background: #fff0c8; }
.row-actions { display: flex; align-items: center; gap: 7px; }
.row-actions form { margin: 0; }
.table-action { display: inline-flex; align-items: center; min-height: 34px; padding: 7px 10px; border: 0; border-radius: 2px; color: #fff; font-family: inherit; font-size: 12px; font-weight: 800; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; }
.table-action--send { background: #0a526c; }
.table-action--download { background: #2a5d7c; }
.table-action:hover { filter: brightness(1.1); }
.no-actions { color: var(--muted); font-size: 12px; }
.empty-table { padding: 30px; color: var(--muted); text-align: center; }

footer { padding: 24px 0; color: #d8e5eb; background: var(--navy); font-size: 13px; text-align: center; }

.logout-form { margin-top: 14px; }
.logout-form button { padding: 7px 10px; color: #fff; border: 1px solid #507084; background: transparent; font: inherit; font-size: 12px; cursor: pointer; }

.login-page { display: grid; min-height: 100vh; place-items: center; background: linear-gradient(130deg, var(--navy), #0d4d67); }
.login-shell { width: min(440px, calc(100% - 30px)); }
.login-card { padding: 36px 34px; background: #fff; border-top: 7px solid var(--cyan); box-shadow: 0 25px 75px rgba(0,0,0,.28); }
.login-card h1 { margin: 0; color: var(--navy); font-size: 38px; line-height: 1.05; }
.login-card h1 span { color: var(--cyan); }
.login-card > p:not(.eyebrow) { margin: 12px 0 22px; color: var(--muted); }
.login-card form { display: grid; gap: 15px; }
.login-error { margin-bottom: 17px; padding: 11px 13px; color: #821823; background: #fae1e3; border-left: 4px solid var(--red); }

.access-card { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 20px; margin: 0 0 42px; padding: 25px 27px; background: #fff; border-left: 6px solid var(--cyan); box-shadow: var(--shadow); }
.access-card--disabled { border-color: var(--red); }
.access-card h2 { margin: 0; color: var(--navy); font-size: 26px; }
.access-card p:not(.eyebrow) { margin: 7px 0 15px; color: var(--muted); }
.access-card input { font-family: monospace; font-size: 13px; }
.access-card__buttons { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.access-card__management { display: flex; align-items: flex-end; flex-direction: column; justify-content: center; gap: 12px; padding-left: 18px; border-left: 1px solid var(--line); }
.access-card__management form { margin: 0; }
.management-link { padding: 4px 0; color: #2a5d7c; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 800; text-decoration: underline; cursor: pointer; }
.management-link--danger { color: var(--red); }

@media (max-width: 850px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .operation-grid { grid-template-columns: 1fr; }
    .hero__inner { align-items: flex-start; flex-direction: column; }
    .event-chip { width: 100%; }
    .people-search__row { grid-template-columns: 1fr auto; }
    .people-search__row .button-link { grid-column: 1 / -1; }
    .access-card { grid-template-columns: 1fr; }
    .access-card__management { align-items: flex-start; padding: 16px 0 0; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 520px) {
    .shell { width: min(100% - 20px, 1160px); }
    .stats { grid-template-columns: 1fr 1fr; }
    .stats article { min-height: 125px; padding: 17px; }
    .stats strong { font-size: 30px; }
    .panel { grid-template-columns: 48px 1fr; }
    .panel__body { padding: 20px 17px; }
    .field-row { grid-template-columns: 1fr; }
}
