:root {
  --ink: #172126;
  --muted: #6f7d7d;
  --paper: #f1eee6;
  --panel: #f8f7f2;
  --line: #d6d9d1;
  --green: #436c5b;
  --green-dark: #214638;
  --mint: #b9e1b5;
  --orange: #d88459;
  --yellow: #f0d77b;
  --navy: #0c1517;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; min-width: 320px; font-family: "DM Sans", Arial, sans-serif; font-size: 15px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; position: relative; overflow: hidden; }
.grain { position: fixed; inset: 0; opacity: .045; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.24'/%3E%3C/svg%3E"); mix-blend-mode: multiply; z-index: 5; }
.eyebrow, .kicker, .date-label, .aside-footer, .live-pill, .logout-button, .record-count, .dashboard-footer, label, .input-action { font-family: "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow, .kicker { margin: 0; font-size: 11px; font-weight: 500; letter-spacing: .14em; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(185,225,181,.16); vertical-align: 1px; margin-right: 8px; }
.login-view { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(440px, 520px); min-height: 100vh; }
.login-aside { display: flex; flex-direction: column; justify-content: space-between; padding: 48px 7vw 38px; color: #e8eee8; background: var(--navy); position: relative; }
.login-aside::after { content: ""; position: absolute; right: 10%; top: 21%; width: 34vw; height: 34vw; max-width: 470px; max-height: 470px; border: 1px solid rgba(185,225,181,.17); border-radius: 50%; transform: rotate(-21deg); box-shadow: inset 0 0 0 26px rgba(185,225,181,.03), inset 0 0 0 27px rgba(185,225,181,.08); }
.login-aside::before { content: ""; position: absolute; width: 140px; height: 140px; right: 24%; top: 34%; border-radius: 50%; background: var(--green); opacity: .38; filter: blur(1px); }
.login-aside .eyebrow { color: var(--mint); position: relative; z-index: 1; }
.aside-copy { max-width: 540px; position: relative; z-index: 1; margin-top: -8vh; }
.aside-copy .kicker { color: #a9bab2; margin-bottom: 22px; }
.aside-copy h1 { margin: 0 0 24px; font-family: "Space Grotesk", sans-serif; font-size: clamp(50px, 6vw, 92px); line-height: .94; letter-spacing: -.07em; font-weight: 600; }
h1 em, h2 em { color: var(--green); font-family: var(--serif); font-weight: 400; letter-spacing: -.06em; }
.login-aside h1 em { color: var(--mint); }
.aside-intro { color: #afbdba; line-height: 1.65; font-size: 16px; max-width: 355px; }
.aside-footer { display: flex; justify-content: space-between; color: #758783; font-size: 10px; position: relative; z-index: 1; }
.login-panel { padding: 11vh 8vw 50px; background: var(--panel); display: flex; flex-direction: column; justify-content: center; }
.panel-mark { width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; position: relative; margin-bottom: 56px; }
.panel-mark-ring { position: absolute; inset: 8px; border: 1px solid var(--green); border-radius: 50%; }
.panel-mark-core { position: absolute; width: 9px; height: 9px; background: var(--orange); border-radius: 50%; top: 18px; left: 18px; }
.form-heading .kicker { color: var(--green); margin-bottom: 16px; }
.form-heading h2 { font-family: "Space Grotesk", sans-serif; font-size: clamp(32px, 4vw, 48px); line-height: 1; letter-spacing: -.06em; margin: 0 0 15px; }
.form-heading p:last-child { color: var(--muted); line-height: 1.55; margin: 0; max-width: 330px; }
.login-form { display: flex; flex-direction: column; gap: 11px; margin-top: 42px; max-width: 370px; }
label { color: var(--muted); font-size: 10px; font-weight: 500; margin-top: 9px; }
.select-wrap, .pin-wrap { position: relative; }
select, input { width: 100%; border: 1px solid var(--line); border-radius: 2px; color: var(--ink); background: #fff; min-height: 52px; padding: 0 16px; outline: none; transition: border .2s, box-shadow .2s; }
select { appearance: none; padding-right: 42px; }
select:focus, input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(67,108,91,.12); }
.select-chevron { position: absolute; right: 16px; top: 12px; font-size: 24px; line-height: 1; color: var(--green); pointer-events: none; }
.pin-wrap input { padding-right: 70px; }
.input-action { border: 0; background: none; color: var(--green); font-size: 10px; position: absolute; right: 12px; top: 19px; padding: 0; }
.primary-button { margin-top: 21px; min-height: 55px; border: 0; border-radius: 2px; background: var(--green-dark); color: white; display: flex; align-items: center; justify-content: space-between; padding: 0 17px 0 20px; font-weight: 600; transition: transform .2s, background .2s; }
.primary-button:hover { background: var(--green); transform: translateY(-2px); }
.button-arrow { font-size: 20px; font-weight: 400; }
.form-message { min-height: 18px; color: var(--orange); font-size: 12px; line-height: 1.4; margin: 3px 0 0; }
.privacy-note { margin: 66px 0 0; color: #9ba49f; font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: .04em; }
.lock-mark { color: var(--green); font-size: 16px; margin-right: 6px; }

.dashboard-view { min-height: 100vh; background: var(--paper); }
.topbar { height: 83px; padding: 0 clamp(25px, 5vw, 80px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(23,33,38,.12); }
.wordmark { color: var(--ink); text-decoration: none; font-family: "Space Grotesk", sans-serif; font-size: 17px; font-weight: 700; letter-spacing: -.05em; display: flex; gap: 10px; align-items: center; }
.wordmark-symbol { color: var(--green); font-size: 27px; line-height: 0; }
.topbar-meta { display: flex; gap: 27px; align-items: center; }
.live-pill { color: var(--green); font-size: 10px; }
.live-pill .status-dot { width: 5px; height: 5px; background: var(--green); box-shadow: none; }
.logout-button { color: var(--muted); background: none; border: 0; font-size: 10px; padding: 10px 0; }
.logout-button span { color: var(--green); font-size: 14px; margin-left: 4px; }
.dashboard-content { max-width: 1260px; padding: 50px clamp(25px, 5vw, 80px) 68px; margin: 0 auto; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 38px; }
.dashboard-heading .eyebrow { color: var(--green); margin-bottom: 16px; }
.dashboard-heading h1 { margin: 0; font-family: "Space Grotesk", sans-serif; font-size: clamp(38px, 4vw, 60px); line-height: .92; letter-spacing: -.08em; font-weight: 600; }
.dashboard-heading h1 em { font-size: 1.08em; }
.heading-date { border-left: 1px solid var(--line); padding-left: 22px; margin-bottom: 6px; min-width: 125px; }
.date-label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 9px; }
.heading-date strong { font-family: "Space Grotesk", sans-serif; font-size: 14px; letter-spacing: -.02em; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); margin-bottom: 58px; }
.stat-card { min-height: 144px; padding: 25px 20px 20px 0; border-right: 1px solid var(--line); position: relative; }
.stat-card + .stat-card { padding-left: 22px; }
.stat-card:last-child { border-right: 0; }
.stat-label { color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.stat-value { margin-top: 18px; display: block; font-family: "Space Grotesk", sans-serif; font-size: 47px; line-height: 1; letter-spacing: -.08em; }
.stat-note { color: var(--muted); font-size: 11px; position: absolute; right: 20px; bottom: 22px; }
.stat-card:nth-child(2) .stat-value { color: var(--orange); }
.stat-card:nth-child(3) .stat-value { color: var(--green); }
.stat-card:nth-child(4) .stat-value { color: var(--green-dark); }
.records-section { max-width: 1120px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 25px; }
.section-heading .kicker { color: var(--green); margin-bottom: 14px; }
.section-heading h2 { font-family: "Space Grotesk", sans-serif; font-size: 35px; letter-spacing: -.07em; margin: 0; }
.record-count { color: var(--muted); font-size: 10px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 14px; }
.tabs { display: flex; gap: 22px; }
.tab { border: 0; background: none; color: var(--muted); padding: 11px 0; font-size: 12px; position: relative; }
.tab.active { color: var(--ink); font-weight: 600; }
.tab.active::after { content: ""; height: 2px; background: var(--orange); position: absolute; bottom: 0; left: 0; right: 0; }
.search-box { border: 1px solid var(--line); background: rgba(255,255,255,.38); display: flex; align-items: center; gap: 7px; padding: 0 12px; margin: 0; min-width: 192px; }
.search-box span { font-size: 21px; color: var(--green); line-height: 1; transform: rotate(-20deg); }
.search-box input { min-height: 36px; border: 0; background: none; padding: 0; font-size: 12px; box-shadow: none; }
.records-list { border-top: 1px solid var(--line); }
.record-row { display: grid; grid-template-columns: 1.05fr .7fr .95fr 1.45fr 2.1fr; gap: 22px; align-items: center; padding: 21px 0; border-bottom: 1px solid var(--line); }
.record-date, .record-location, .record-duration { font-family: "Space Grotesk", sans-serif; font-weight: 600; letter-spacing: -.03em; }
.record-date span, .record-location span, .record-duration span, .record-reason-label { display: block; font-family: "DM Mono", monospace; color: var(--muted); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; font-weight: 400; margin-bottom: 7px; }
.record-date { font-size: 16px; }
.record-date small { font-size: 12px; color: var(--muted); font-family: "DM Mono", monospace; font-weight: 400; margin-left: 3px; }
.record-location { font-size: 15px; }
.record-duration { font-size: 15px; color: var(--ink); }
.record-reason-label { margin-bottom: 5px; }
.record-type { justify-self: start; font-family: "DM Mono", monospace; text-transform: uppercase; font-size: 9px; letter-spacing: .08em; padding: 8px 8px 7px; border: 1px solid; }
.record-type.no-show { color: var(--orange); border-color: rgba(216,132,89,.52); background: rgba(216,132,89,.06); }
.record-type.late { color: var(--green); border-color: rgba(67,108,91,.42); background: rgba(67,108,91,.06); }
.record-explanation { min-width: 0; align-self: stretch; border-left: 1px solid var(--line); padding-left: 22px; }
.explanation-input { display: block; min-height: 96px; resize: vertical; padding: 13px 15px; margin-top: 9px; line-height: 1.5; font-size: 13px; background: rgba(255,255,255,.62); }
.explanation-controls { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 10px; }
.save-message { color: var(--orange); font-size: 11px; min-height: 16px; }
.save-explanation { color: var(--green-dark); background: var(--mint); border: 0; padding: 11px 13px; font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: .07em; font-weight: 500; }
.save-explanation:hover { background: #a5d39f; }
.save-explanation:disabled { cursor: wait; opacity: .6; }
.save-explanation span { margin-left: 8px; font-size: 14px; }
.readonly-explanation { display: block; }
.readonly-explanation p { margin: 8px 0 0; color: var(--ink); font-size: 13px; line-height: 1.55; max-width: 740px; white-space: pre-wrap; }
.submitted-label { color: var(--green); font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: .07em; white-space: nowrap; }
.empty-state, .error-state { border: 1px dashed var(--line); padding: 55px 25px; text-align: center; color: var(--muted); }
.empty-state strong, .error-state strong { display: block; color: var(--ink); font-family: "Space Grotesk", sans-serif; font-size: 21px; margin-bottom: 8px; }
.dashboard-footer { max-width: 1260px; border-top: 1px solid var(--line); margin: 0 auto; padding: 18px clamp(25px, 5vw, 80px) 29px; color: #87928c; font-size: 9px; display: flex; justify-content: space-between; }

@media (max-width: 820px) {
  .login-view { grid-template-columns: 1fr; }
  .login-aside { min-height: 390px; padding: 30px 28px; }
  .login-aside::after { width: 280px; height: 280px; right: -35px; top: 95px; }
  .login-aside::before { right: 90px; top: 165px; }
  .aside-copy { margin-top: 38px; }
  .aside-copy h1 { font-size: 56px; }
  .login-panel { padding: 48px 28px 45px; }
  .panel-mark { margin-bottom: 40px; }
  .privacy-note { margin-top: 45px; }
  .dashboard-content { padding-top: 42px; }
  .dashboard-heading { align-items: start; gap: 30px; }
  .stats-grid { margin-bottom: 65px; }
  .record-row { grid-template-columns: 1fr 1fr; gap: 17px; }
  .record-duration { grid-column: 1 / -1; }
  .record-type { grid-row: 2; }
  .record-explanation { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 17px; margin-top: 2px; }
}
@media (max-width: 540px) {
  .topbar { height: 68px; padding: 0 20px; }
  .topbar-meta { gap: 11px; }
  .live-pill { display: none; }
  .dashboard-content { padding: 42px 20px 60px; }
  .dashboard-heading { display: block; margin-bottom: 42px; }
  .heading-date { border: 0; padding: 0; margin-top: 25px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); margin: 0 -20px 58px; padding: 0 20px; }
  .stat-card { min-height: 117px; padding-top: 18px; }
  .stat-card + .stat-card { padding-left: 12px; }
  .stat-value { font-size: 35px; margin-top: 12px; }
  .stat-note { display: none; }
  .section-heading h2 { font-size: 29px; }
  .toolbar { display: block; }
  .tabs { gap: 16px; overflow-x: auto; }
  .search-box { margin-top: 15px; }
  .record-row { grid-template-columns: 1fr auto; gap: 14px; padding: 20px 0; }
  .record-location { grid-column: 1 / -1; }
  .record-type { grid-row: 2; grid-column: 2; }
  .record-duration { grid-row: 3; }
  .record-explanation { grid-row: 4; }
  .submitted-label { display: block; margin-top: 13px; }
  .dashboard-footer { padding: 17px 20px 26px; }
  .dashboard-footer span:last-child { display: none; }
}

/* Bootstrap portal layout overrides */
html, body { background: #fff; }
.login-view { display: flex; align-items: flex-start; justify-content: center; min-height: 100vh; padding: 8vh 1rem; background: #fff; }
.login-panel { width: min(100%, 496px); padding: 0; background: #fff; border: 1px solid #dee2e6 !important; border-radius: .375rem; }
.portal-lockup { color: #49617b; }
.portal-name { color: #234b75; font-size: .92rem; font-weight: 600; letter-spacing: .01em; }
.portal-version { margin-top: .65rem; font-size: .86rem; }
.form-heading .kicker { margin-bottom: .75rem; color: #234b75; }
.form-heading h1 { margin: 0 0 .75rem; color: #172126; font-family: "DM Sans", Arial, sans-serif; font-size: 2rem; font-weight: 500; letter-spacing: -.04em; }
.form-heading p:last-child { max-width: none; }
.login-form { display: flex; max-width: none; margin-top: 2rem; gap: .45rem; }
.login-form .form-label { margin-top: .75rem; color: #172126; font-family: "DM Sans", Arial, sans-serif; font-size: 1rem; letter-spacing: 0; text-transform: none; }
.login-form .form-control { border-color: #ced4da; border-radius: .375rem; }
.login-form .form-control:focus { border-color: #86b7fe; box-shadow: 0 0 0 .25rem rgba(13,110,253,.25); }
.photographer-combobox { z-index: 10; }
.photographer-options { max-height: 240px; overflow-y: auto; }
.photographer-options.show { display: block; }
.photographer-option { white-space: normal; }
.pin-wrap input { padding-right: 4.5rem; }
.input-action { top: 50%; right: 1rem; transform: translateY(-50%); color: #234b75; font-family: "DM Mono", monospace; font-size: .7rem; letter-spacing: .04em; }
.login-form .btn-primary { margin-top: 1rem; }
.form-message { min-height: 1.25rem; margin: .25rem 0 0; }
.dashboard-view { background: #fff; }
.topbar { height: 64px; padding: 0 clamp(20px, 4vw, 60px); background: #fff; }
.wordmark { font-size: 14px; letter-spacing: -.02em; }
.wordmark-symbol { font-size: 22px; }
.portal-content { max-width: 1320px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 60px); }
.portal-tabs { margin-top: 1.25rem; }
.portal-tabs .nav-link { color: #49617b; }
.portal-tabs .nav-link.active { color: #234b75; font-weight: 600; }
.profile-pane { min-height: 420px; }
.dashboard-content { max-width: none; padding: 32px 0 58px; }
.dashboard-heading { margin-bottom: 26px; }
.dashboard-heading h1 { font-size: clamp(30px, 3.2vw, 46px); }
.dashboard-heading .eyebrow { margin-bottom: 10px; }
.stats-grid { margin-bottom: 42px; }
.stat-card { min-height: 118px; padding-top: 18px; }
.stat-value { font-size: 38px; margin-top: 13px; }
.records-section { max-width: none; }
.section-heading h2 { font-size: 30px; }
.dashboard-footer { max-width: 1320px; padding-left: clamp(20px, 4vw, 60px); padding-right: clamp(20px, 4vw, 60px); }

@media (max-width: 820px) {
  .login-view { display: flex; min-height: 100vh; padding-top: 4vh; }
  .login-panel { padding: 0; }
  .dashboard-content { padding-top: 28px; }
}

.app-loading { min-height: 100vh; background: #fff; }
.app-loading-state { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; gap: .6rem; color: #49617b; font-size: .9rem; background: #fff; }
.app-shell:not(.app-loading) .app-loading-state { display: none; }

/* Compact attendance records */
.record-row { align-items: start; gap: 16px; padding: 13px 0; }
.record-date, .record-location, .record-duration { font-size: 14px; }
.record-date span, .record-location span, .record-duration span, .record-reason-label { margin-bottom: 4px; }
.record-type { padding: 6px 7px 5px; }
.record-explanation { padding-left: 16px; }
.explanation-input { min-height: 70px; height: 70px; margin-top: 5px; padding: 8px 10px; line-height: 1.35; }
.explanation-controls { margin-top: 6px; gap: 10px; }
.save-explanation { padding: 8px 10px; }
.readonly-explanation p { margin-top: 4px; }

@media (max-width: 820px) {
  .record-explanation { padding-top: 12px; }
}
