/* Attendance portal (templates/attendance/take.html.twig). Everything is scoped under .at. */
.at {
    --at-navy: #18334d; --at-teal: #258178; --at-ink: #263748; --at-muted: #718092; --at-line: #e0e7ed;
    --at-green: #20856f; --at-amber: #b9781d; --at-violet: #8a7bc5; --at-softgreen: #e6f5ef; --at-softblue: #eaf2f7;
    color: var(--at-ink); font-size: 14px; line-height: 1.45;
}
.at a { text-decoration: none; }
.at-crumb { color: var(--at-muted); font-size: 12px; margin-bottom: 10px; }
.at-crumb strong { color: var(--at-ink); }

.at-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.at-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 1.7px; color: var(--at-teal); font-weight: 800; }
.at-heading h1 { margin: 5px 0; color: var(--at-navy); font-size: 29px; font-weight: 700; letter-spacing: -.8px; }
.at-heading p { margin: 0; color: var(--at-muted); }
.at-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.at-btn { border: 1px solid #d2dce4; background: #fff; color: var(--at-navy); padding: 10px 14px; border-radius: 9px; font-weight: 700; font-size: 13px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.at-btn:hover { background: #f5f8fa; color: var(--at-navy); }
.at-btn.primary { background: var(--at-navy); color: #fff; border-color: var(--at-navy); }
.at-btn.primary:hover { background: #10263b; }
.at-btn.teal { background: var(--at-teal); color: #fff; border-color: var(--at-teal); }
.at-btn.teal:hover { background: #1d6b63; }
.at-report-range { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin: -10px 0 16px; font-size: 12px; color: var(--at-muted); }
.at-report-range > span { font-weight: 700; color: var(--at-navy); }
.at-report-range label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.at-report-range input { border: 1px solid #d7e0e7; border-radius: 8px; padding: 6px 8px; font-size: 12px; color: var(--at-ink); }
.at-report-range .at-btn { padding: 7px 11px; font-size: 12px; }

.at-panel { background: #fff; border: 1px solid var(--at-line); border-radius: 14px; box-shadow: 0 3px 10px #17324d05; }
.at-event { padding: 20px 21px; margin-bottom: 17px; }
.at-panel-title { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 16px; }
.at-panel-title h2 { font-size: 15px; font-weight: 700; color: var(--at-navy); margin: 0; }
.at-panel-title span { font-size: 11px; color: var(--at-muted); }

.at-fields { display: grid; grid-template-columns: 1.45fr 1fr 1fr 1fr 1.1fr; gap: 13px; }
.at-field { min-width: 0; }
.at-field-wide { margin-top: 13px; }
.at-field label { display: block; font-size: 11px; color: #657588; font-weight: 750; margin: 0 0 6px; }
.at-field label.required::after { content: none; }
.at-field input, .at-field select, .at-field textarea { width: 100%; border: 1px solid #d7e0e7; border-radius: 8px; background: #fff; padding: 10px 11px;
    color: var(--at-ink); outline: none; min-width: 0; font-size: 14px; }
.at-field input:focus, .at-field select:focus, .at-field textarea:focus { border-color: var(--at-teal); box-shadow: 0 0 0 3px #25817817; }
.at-field textarea { resize: vertical; }
.at-field .invalid-feedback { display: block; font-size: 11px; }
.at-field .is-invalid { border-color: #b94b50; }

.at-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 18px; }
.at-metric { padding: 15px 17px; display: flex; align-items: center; gap: 12px; }
.at-metric-icon { width: 40px; height: 40px; flex: none; border-radius: 11px; background: var(--at-softblue); display: grid; place-items: center; font-size: 18px; }
.at-metric:nth-child(2) .at-metric-icon { background: var(--at-softgreen); }
.at-metric:nth-child(3) .at-metric-icon { background: #fff2dd; }
.at-metric:nth-child(4) .at-metric-icon { background: #f0eefb; }
.at-metric small { display: block; color: var(--at-muted); font-size: 11px; }
.at-metric strong { display: block; font-size: 23px; color: var(--at-navy); line-height: 1.3; font-variant-numeric: tabular-nums; }

.at-roster { overflow: hidden; }
.at-roster-head { padding: 19px 21px; border-bottom: 1px solid var(--at-line); display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.at-roster-head h2 { font-size: 16px; font-weight: 700; color: var(--at-navy); margin: 0 0 4px; }
.at-roster-head p { margin: 0; color: var(--at-muted); font-size: 12px; }
.at-roster-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.at-search { position: relative; }
.at-search input { width: 250px; padding: 10px 12px 10px 34px; border: 1px solid #d7e0e7; border-radius: 8px; font-size: 13px; }
.at-search::before { content: "⌕"; position: absolute; left: 12px; top: 7px; color: #81909e; font-size: 20px; line-height: 1; }
.at-roster-controls { padding: 13px 21px; background: #fbfcfd; border-bottom: 1px solid var(--at-line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.at-filters { display: flex; gap: 7px; flex-wrap: wrap; }
.at-chip { border: 1px solid #dbe3e9; background: #fff; border-radius: 30px; padding: 7px 12px; color: #647487; font-size: 11px; font-weight: 700; cursor: pointer; }
.at-chip span { opacity: .7; margin-left: 2px; }
.at-chip.active { background: #e8f3f2; border-color: #b7dcd7; color: #176d66; }
.at-tip { font-size: 11px; color: var(--at-muted); }
.at:not(.js) .at-filters, .at:not(.js) .at-roster-tools, .at:not(.js) .at-tip, .at:not(.js) .at-bottom-row .at-bottom-panel:first-child, .at:not(.js) .at-actions .primary { display: none; }

.at-members { padding: 18px 20px 22px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; }
.at-member { position: relative; border: 1px solid var(--at-line); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s; min-width: 0; }
.at-member[hidden] { display: none; }
.at-member:hover { border-color: #9ebfca; transform: translateY(-1px); box-shadow: 0 5px 14px #17324d0c; }
.at-member.present { border: 2px solid var(--at-green); background: #f3fbf7; margin: -1px; }
.at-member.late { border: 2px solid var(--at-amber); background: #fffaf1; margin: -1px; }
.at-member.excused { border: 2px solid var(--at-violet); background: #f8f6ff; margin: -1px; }
.at-card { all: unset; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; width: 100%; padding: 14px 10px 12px; text-align: center; cursor: pointer; border-radius: 12px; }
.at-card:focus-visible { box-shadow: 0 0 0 3px #25817855; }
.at-portrait { width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; overflow: hidden; border: 3px solid #fff; box-shadow: 0 0 0 1px #d9e2e8; }
.at-portrait > * { width: 100% !important; height: 100% !important; }
.at-member.present .at-portrait { box-shadow: 0 0 0 2px #78bba6; }
.at-name { display: block; max-width: 100%; font-size: 12px; font-weight: 800; color: var(--at-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-meta { display: block; max-width: 100%; min-height: 15px; font-size: 10px; color: var(--at-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-status { margin-top: 10px; border-radius: 30px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; padding: 5px 9px; background: #f0f3f5; color: #748394; min-width: 77px; }
.at-status.present { background: #d9f1e7; color: #176f58; }
.at-status.late { background: #fff0d3; color: #93600e; }
.at-status.excused { background: #e9e4fb; color: #6552a2; }
.at-check { position: absolute; top: 9px; right: 9px; width: 21px; height: 21px; border-radius: 50%; background: var(--at-green); color: #fff; font-size: 12px; display: none; place-items: center; }
.at-member.present .at-check { display: grid; }
.at-member.late .at-check { display: grid; background: var(--at-amber); }
.at-member.excused .at-check { display: grid; background: var(--at-violet); }
/* Without JS the status select is the control; with JS the card is. */
.at-select { display: block; width: calc(100% - 20px); margin: 0 10px 10px; font-size: 12px; padding: 4px 6px; border: 1px solid #d7e0e7; border-radius: 6px; }
.at.js .at-select { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.at-empty { grid-column: 1 / -1; text-align: center; padding: 35px; color: var(--at-muted); }

.at-bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; margin-top: 17px; }
.at-bottom-panel { padding: 18px 20px; }
.at-bottom-panel h2 { font-size: 14px; font-weight: 700; color: var(--at-navy); margin: 0 0 13px; }
.at-quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.at-quick-actions .at-btn { font-size: 12px; padding: 9px 11px; }
.at-notes { font-size: 11px; color: var(--at-muted); margin-top: 12px; }
.at-savebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 19px; padding: 15px 18px; background: #eaf1f5; border-radius: 12px; }
.at-savebar p { margin: 0; color: #506477; font-size: 12px; }
.at-savebar strong { color: var(--at-navy); }
.at-save-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 1150px) {
    .at-fields { grid-template-columns: repeat(3, 1fr); }
    .at-members { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
    .at-metrics { grid-template-columns: repeat(2, 1fr); }
    .at-members { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .at-bottom-row { grid-template-columns: 1fr; }
    .at-heading { flex-direction: column; }
}
@media (max-width: 540px) {
    .at-fields { grid-template-columns: 1fr 1fr; }
    .at-fields .at-field:first-child { grid-column: 1 / -1; }
    .at-members { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
    .at-roster-head { align-items: flex-start; flex-direction: column; }
    .at-search, .at-search input { width: 100%; }
    .at-roster-tools { width: 100%; flex-wrap: nowrap; }
    .at-metrics { gap: 8px; }
    .at-metric { padding: 12px 10px; gap: 8px; }
    .at-metric strong { font-size: 20px; }
    .at-metric-icon { width: 34px; height: 34px; }
    .at-savebar { align-items: flex-start; flex-direction: column; }
    .at-heading h1 { font-size: 25px; }
}
@media print {
    .at-actions, .at-report-range, .at-roster-tools, .at-roster-controls, .at-bottom-row, .at-savebar, .at-select { display: none !important; }
    .at-members { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 12px; }
    .at-member { break-inside: avoid; box-shadow: none !important; transform: none !important; }
    .at-member[hidden] { display: block; }
    .at-panel { box-shadow: none; }
    .at-event { padding: 12px; }
    .at-fields { grid-template-columns: repeat(5, 1fr); }
    .at-metrics { grid-template-columns: repeat(4, 1fr); }
}
