@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --ink: #17302E;
    --deep: #123C3D;
    --teal: #2F6F6E;
    --teal-light: #E7F0EF;
    --amber: #D97A2E;
    --amber-dark: #B5621E;
    --bg: #F6F7F5;
    --panel: #FFFFFF;
    --line: #DDE4E2;
    --danger: #B3402C;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

h1, h2, h3 {
    font-family: 'Source Serif 4', Georgia, serif;
    color: var(--deep);
    margin: 0 0 .3em;
}

header.top {
    background: var(--deep);
    color: #fff;
    position: relative;
    padding: 1.1rem 3cm;
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
}

header.top .brand-logo {
    height: 54px;
    width: 54px;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    padding: 3px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

header.top .brand-logo-left { left: 3cm; }
header.top .brand-logo-right { right: 3cm; }

header.top .brand-center {
    text-align: center;
    max-width: 100%;
}

header.top h1 { color: #fff; font-size: 1.4rem; }
header.top .sub { color: #BFDAD8; font-size: .85rem; letter-spacing: .02em; }

@media (max-width: 700px) {
    header.top { padding: 1rem 4.2rem; }
    header.top .brand-logo-left { left: .6rem; }
    header.top .brand-logo-right { right: .6rem; }
    header.top .brand-logo { height: 40px; width: 40px; }
}

.back-link {
    display: inline-block;
    margin: 1.2rem 0 -.6rem;
    color: var(--teal);
    font-size: .88rem;
    text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

@media print {
    header.top .brand-logo { background: transparent; }
    .toolbar, .actions, form .btn, .back-link, .footer-note, .search-box { display: none !important; }
    body { background: #fff; }
    .panel { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
    a.link { display: none; }
}

.wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1.6rem 1.8rem;
    margin-bottom: 1.6rem;
}

.section-title {
    font-size: 1.05rem;
    border-bottom: 2px solid var(--teal-light);
    padding-bottom: .5rem;
    margin-bottom: 1.1rem;
    color: var(--teal);
}

.grid { display: grid; gap: .9rem 1.2rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

@media (max-width: 700px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

label {
    display: block;
    font-size: .82rem;
    font-weight: 500;
    color: #3D5452;
    margin-bottom: .3rem;
}

input[type=text], input[type=number], input[type=date], input[type=time],
input[type=tel], select, textarea {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-family: inherit;
    font-size: .92rem;
    background: #fff;
    color: var(--ink);
}

textarea { resize: vertical; min-height: 70px; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-light);
}

fieldset {
    border: 1px dashed var(--line);
    border-radius: 5px;
    padding: .8rem 1rem;
    margin: 0 0 1rem;
}

legend {
    font-weight: 600;
    font-size: .85rem;
    color: var(--deep);
    padding: 0 .4rem;
}

.check-row {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.4rem;
}

.check-item {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .88rem;
    font-weight: 400;
    color: var(--ink);
}

.check-item input { width: auto; }

.actions {
    display: flex;
    gap: .7rem;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: .65rem 1.3rem;
    border-radius: 4px;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary { background: var(--amber); color: #fff; }
.btn-primary:hover { background: var(--amber-dark); }
.btn-secondary { background: var(--teal-light); color: var(--deep); }
.btn-secondary:hover { background: #d7e6e4; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: #FBEAE6; }

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

th, td {
    text-align: left;
    padding: .7rem .8rem;
    border-bottom: 1px solid var(--line);
    font-size: .88rem;
}

th {
    background: var(--teal-light);
    color: var(--deep);
    font-weight: 600;
}

tr:hover td { background: #FAFBFA; }

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: .8rem;
}

.search-box input {
    min-width: 260px;
}

.badge {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-yes { background: #FDECD9; color: var(--amber-dark); }
.badge-no  { background: var(--teal-light); color: var(--teal); }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #789;
}

.flash {
    background: #E8F4E5;
    border: 1px solid #B9DDB0;
    color: #2E5A25;
    padding: .8rem 1.1rem;
    border-radius: 5px;
    margin-bottom: 1.2rem;
    font-size: .9rem;
}

.detail-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: .5rem 1rem;
    padding: .5rem 0;
    border-bottom: 1px solid #EEF1F0;
    font-size: .9rem;
}

.detail-row .k { color: #5A7270; font-weight: 500; }

a.link { color: var(--teal); }

.footer-note {
    text-align: center;
    color: #8A9B99;
    font-size: .78rem;
    margin-top: 2rem;
}
