:root {
    --ink: #183238;
    --muted: #687b80;
    --deep: #123f46;
    --teal: #167a73;
    --teal-dark: #0e625d;
    --mint: #e6f1ed;
    --paper: #ffffff;
    --background: #f3f6f4;
    --line: #dce5e1;
    --error: #a13f37;
    --error-bg: #fff0ed;
    --shadow: 0 18px 50px rgba(22, 55, 56, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background:
        radial-gradient(circle at 8% 5%, rgba(50, 145, 128, .10), transparent 27rem),
        var(--background);
}
button, input, select { font: inherit; }
a { color: inherit; }
.site-header {
    width: min(1180px, calc(100% - 40px));
    min-height: 96px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; }
.brand-logo { width: 67px; flex: 0 0 auto; }
.brand-logo img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; line-height: 1.25; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.header-link, .text-link { color: var(--teal-dark); font-size: 14px; font-weight: 650; text-decoration: none; }
.header-link:hover, .text-link:hover { text-decoration: underline; }
.public-main {
    width: min(1100px, calc(100% - 40px));
    margin: 36px auto 70px;
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 64px;
    align-items: start;
}
.intro { padding-top: 44px; }
.eyebrow {
    margin-bottom: 12px;
    color: var(--teal);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 20px; color: var(--deep); font-size: clamp(34px, 4vw, 52px); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin-bottom: 3px; color: var(--deep); font-size: 24px; letter-spacing: -.02em; }
.intro > p { max-width: 430px; color: var(--muted); font-size: 18px; }
.address-card {
    margin-top: 34px;
    padding: 20px 22px;
    border-left: 3px solid var(--teal);
    border-radius: 0 14px 14px 0;
    background: rgba(255, 255, 255, .65);
}
.address-card span, .address-card strong { display: block; }
.address-card strong { margin: 3px 0; font-size: 18px; }
.address-card span:last-child { color: var(--muted); font-size: 14px; }
.address-label { color: var(--teal); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.form-card, .success-card, .login-card, .admin-panel {
    border: 1px solid rgba(214, 226, 220, .8);
    border-radius: 22px;
    background: var(--paper);
    box-shadow: var(--shadow);
}
.form-card { padding: 32px; }
.form-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 26px; font-size: 19px; font-weight: 750; }
.required-note { color: var(--muted); font-size: 12px; font-weight: 450; }
.field { display: block; margin-bottom: 20px; }
.field > span { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 650; }
.field b { color: var(--teal); }
.field small, .remember-field small, .export-block small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }
input[type="text"], input[type="password"], input[type="date"], select {
    width: 100%;
    height: 49px;
    padding: 0 14px;
    border: 1px solid #cfdcd7;
    border-radius: 10px;
    outline: none;
    color: var(--ink);
    background: #fbfdfc;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus {
    border-color: var(--teal);
    background: white;
    box-shadow: 0 0 0 3px rgba(22, 122, 115, .12);
}
select { appearance: auto; }
input::placeholder { color: #99aaa9; }
[hidden] { display: none !important; }
.deadline-note { margin: 2px 0 20px; padding: 13px 15px; border-radius: 10px; color: #3e6665; background: var(--mint); font-size: 13px; }
.remember-field { display: flex; align-items: flex-start; gap: 11px; margin: 18px 0 24px; cursor: pointer; }
.remember-field input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--teal); flex: 0 0 auto; }
.remember-field strong { display: block; font-size: 14px; }
.primary-button, .secondary-button {
    min-height: 46px;
    padding: 11px 19px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    text-align: center;
    transition: background .15s, transform .15s;
}
.primary-button { width: 100%; color: white; background: var(--teal); }
.primary-button:hover { background: var(--teal-dark); transform: translateY(-1px); }
.secondary-button { color: var(--deep); border-color: #cad8d3; background: white; }
.secondary-button:hover { background: var(--mint); }
.button-link { display: inline-block; text-decoration: none; }
.button-link:hover { text-decoration: none; }
.centered-main { width: min(520px, calc(100% - 40px)); margin: 70px auto 80px; }
.success-card, .login-card { padding: 40px; text-align: center; }
.success-card h1, .login-card h1 { font-size: 34px; }
.success-card p, .login-card p { color: var(--muted); }
.success-card .primary-button { margin-top: 15px; }
.success-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 25px; border-radius: 50%; color: white; background: var(--teal); font-size: 31px; }
.login-card { text-align: left; }
.login-card .text-link { display: block; margin-top: 22px; text-align: center; }
.code-input { font-size: 25px; letter-spacing: .35em; text-align: center; }
.alert { margin-bottom: 20px; padding: 13px 15px; border-radius: 10px; font-size: 14px; }
.alert-error { color: var(--error); border: 1px solid #f0d2ca; background: var(--error-bg); }
.muted { color: var(--muted); }
.site-footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 25px 0 35px; color: var(--muted); font-size: 12px; text-align: center; }

.admin-main { width: min(1380px, calc(100% - 40px)); margin: 25px auto 65px; }
.admin-topline { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 28px; }
.admin-topline h1 { margin: 0; font-size: 38px; }
.admin-panel { padding: 25px; }
.filter-panel { margin-bottom: 20px; box-shadow: none; }
.date-filter { display: flex; align-items: flex-end; gap: 12px; }
.date-filter .field { width: 240px; margin: 0; }
.date-filter .text-link { margin: 0 0 14px 4px; }
.date-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.date-chip { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fafcfb; font-size: 13px; text-decoration: none; }
.date-chip span { margin-left: 5px; opacity: .75; }
.date-chip.active { color: white; border-color: var(--deep); background: var(--deep); }
.list-panel { box-shadow: none; }
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
.list-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.export-block { width: min(360px, 100%); text-align: right; }
.export-block small { margin-right: 5px; }
.export-button { width: auto; }
.disabled { cursor: default; opacity: .45; }
.disabled:hover { transform: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
.visits-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.visits-table th { padding: 13px 15px; color: var(--muted); background: #f4f8f6; font-size: 11px; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.visits-table td { padding: 15px; border-top: 1px solid var(--line); vertical-align: top; }
.visits-table tbody tr:hover { background: #fbfdfc; }
.visit-date { white-space: nowrap; color: var(--teal-dark); font-weight: 750; }
.created-at { color: var(--muted); font-size: 12px; white-space: nowrap; }
.empty-state { padding: 45px 20px; border: 1px dashed #cad9d3; border-radius: 13px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--deep); }
.empty-state p { margin: 6px 0 0; }

@media (max-width: 900px) {
    .public-main { grid-template-columns: 1fr; gap: 28px; margin-top: 15px; }
    .intro { padding-top: 10px; }
    .intro > p { max-width: none; }
    .address-card { display: none; }
    .list-heading { align-items: flex-start; flex-direction: column; }
    .export-block { width: 100%; text-align: left; }
    .export-button { width: 100%; }
}

@media (max-width: 620px) {
    .site-header { width: min(100% - 28px, 1180px); min-height: 80px; gap: 12px; }
    .brand { gap: 9px; }
    .brand strong { font-size: 12px; }
    .brand small { font-size: 10px; }
    .brand-logo { width: 53px; }
    .header-link { font-size: 12px; }
    .public-main, .admin-main, .centered-main { width: calc(100% - 28px); }
    .public-main { margin-bottom: 35px; }
    h1 { font-size: 36px; }
    .intro > p { font-size: 16px; }
    .form-card, .success-card, .login-card, .admin-panel { padding: 22px 18px; border-radius: 17px; }
    .form-heading { font-size: 17px; }
    .required-note { display: none; }
    .admin-topline h1 { font-size: 31px; }
    .admin-topline { align-items: flex-end; }
    .date-filter { align-items: stretch; flex-wrap: wrap; }
    .date-filter .field { width: 100%; }
    .date-filter .text-link { margin: 12px; }
    .visits-table, .visits-table tbody, .visits-table tr, .visits-table td { display: block; width: 100%; }
    .visits-table thead { display: none; }
    .visits-table tr { padding: 13px 15px; border-top: 1px solid var(--line); }
    .visits-table td { display: grid; grid-template-columns: 115px 1fr; gap: 12px; padding: 5px 0; border: 0; }
    .visits-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; text-transform: uppercase; }
    .created-at { white-space: normal; }
    .site-footer { padding-bottom: 20px; }
}
