:root {
    --background: #f5f7f6;
    --surface: #fff;
    --text: #192b27;
    --muted: #64736e;
    --line: #e0e7e3;
    --accent: #16634f;
    --accent-hover: #104d3d;
    --accent-light: #e9f3ee;
    --danger: #a32d30;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    color: var(--text);
    background: var(--background);
    line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #65a997; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.7rem, 3vw, 2.15rem); line-height: 1.2; letter-spacing: -.04em; font-weight: 650; }
h2 { font-size: 1.12rem; line-height: 1.4; font-weight: 650; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 10; top: 10px; left: 10px; padding: 12px 18px; color: white; background: var(--accent); border-radius: 8px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1280px; padding: 20px 36px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 36px; min-height: 84px; }
.brand { text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: white; background: var(--accent); font-size: 22px; font-weight: 750; }
.brand-name { font-size: 17px; font-weight: 750; letter-spacing: -.035em; white-space: nowrap; }
.brand-name > span { color: var(--muted); font-weight: 450; }
.main-nav { display: flex; gap: 24px; align-self: stretch; align-items: center; }
.main-nav a { text-decoration: none; color: var(--muted); font-size: 14px; padding: 9px 0; white-space: nowrap; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--accent); }
.main-nav a[aria-current="page"] { font-weight: 650; box-shadow: 0 2px 0 var(--accent); }
.account-menu { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 13px; }
.account-menu form { margin: 0; }
.account-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.header-note { margin-left: auto; color: var(--muted); font-size: 13px; }
.page-container { width: 100%; max-width: 1152px; padding: 48px 36px 64px; margin: 0 auto; flex: 1; }
.page-heading { display: flex; gap: 24px; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.eyebrow { color: var(--accent); text-transform: uppercase; font-size: 11px; letter-spacing: .14em; font-weight: 700; margin-bottom: 11px; }
.page-description { color: var(--muted); margin-top: 12px; max-width: 600px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 3px 8px #1a3b2a03; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; font-weight: 600; line-height: 1.4; text-decoration: none; transition: background .15s ease, border-color .15s ease; }
.button-primary { background: var(--accent); color: white; }
.button-primary:hover { background: var(--accent-hover); }
.button-danger { background: var(--danger); color: white; }
.button-danger:hover { background: #812124; }
.button-secondary { background: white; border-color: #d3ddd7; color: var(--text); }
.button-secondary:hover { background: #f3f7f4; border-color: #aebeb5; }
.button-quiet { background: transparent; color: var(--muted); border-color: var(--line); }
.button-quiet:hover { background: var(--background); color: var(--text); }
.button-small { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.button-full { width: 100%; }
.subtle-link { font-size: 13px; font-weight: 550; text-decoration: none; }
.subtle-link:hover { text-decoration: underline; }
.messages { margin-bottom: 24px; }
.message { padding: 14px 18px; border: 1px solid #c6dfd2; border-radius: 9px; color: #205b43; background: #edf7f0; margin-bottom: 10px; }
.message-error { background: #fff2f2; color: var(--danger); border-color: #f2cccc; }
.site-footer { max-width: 1152px; width: 100%; padding: 0 36px 24px; margin: 0 auto; display: flex; justify-content: space-between; color: #7a8781; font-size: 12px; }
.login-container { max-width: 510px; padding-top: 64px; padding-bottom: 64px; display: flex; flex-direction: column; justify-content: center; }
.login-card { padding: 36px; }
.login-card h1 { font-size: 1.85rem; }
.login-card .page-description { font-size: 14px; margin-bottom: 28px; }
.stacked-form { display: flex; flex-direction: column; gap: 22px; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.field input, .field select, .search-field input, .filter-field select { display: block; width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid #cbd7cf; background: white; border-radius: 8px; color: var(--text); transition: border-color .15s ease; }
.field input:hover, .field select:hover, .search-field input:hover, .filter-field select:hover { border-color: #98b0a2; }
.field input:focus, .field select:focus, .search-field input:focus, .filter-field select:focus { border-color: var(--accent); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: #c84b4f; }
input::placeholder { color: #7d8983; opacity: 1; }
.field-help { margin-top: 8px; font-size: 13px; color: var(--muted); }
.field-errors, .form-errors { color: var(--danger); font-size: 13px; }
.field-errors { margin-top: 8px; }
.form-errors { background: #fff3f2; border: 1px solid #f0cfca; border-radius: 8px; padding: 12px 14px; }
.field-errors ul, .form-errors ul { list-style: none; padding: 0; margin: 0; }
.field-errors li + li, .form-errors li + li { margin-top: 5px; }
.login-help { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.workspace-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; }
.employee-summary { padding: 30px; }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-label { font-size: 15px; font-weight: 650; }
.section-marker { color: #91aaa0; font-size: 12px; }
.metric { font-size: 60px; letter-spacing: -.06em; font-weight: 650; line-height: 1.15; margin: 20px 0 6px; }
.card-description { color: var(--muted); font-size: 14px; }
.catalog-heading { margin: 28px 0 12px; font-size: 1.6rem; letter-spacing: -.03em; }
.card-actions { margin-top: 28px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.access-note { padding: 30px; background: #edf3ef; border-color: #dce6de; }
.access-note p { margin-top: 13px; color: #52695c; font-size: 14px; max-width: 410px; }
.note-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #c7d9cd; border-radius: 50%; color: var(--accent); margin-bottom: 21px; font-size: 16px; }
.list-card { overflow: hidden; }
.search-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.search-field { width: 360px; max-width: 100%; }
.search-field input { background: #f9fbf9; min-height: 44px; font-size: 14px; }
.filter-field { max-width: 100%; }
.filter-field select { min-height: 44px; font-size: 14px; }
.table-container { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.data-table thead { background: #fbfcfb; }
.data-table th, .data-table td { padding: 19px 24px; border-bottom: 1px solid var(--line); }
.data-table thead th { color: var(--muted); font-size: 12px; font-weight: 550; }
.data-table tbody tr:last-child th, .data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafcfb; }
.record-name { font-weight: 600; overflow-wrap: anywhere; }
.data-table .actions-cell { text-align: right; width: 1%; white-space: nowrap; }
.product-table { min-width: 540px; }
.edit-link { display: inline-block; padding: 7px 0 7px 8px; text-decoration: none; font-size: 13px; font-weight: 600; }
.edit-link:hover { text-decoration: underline; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.status > span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-active { color: #28684c; background: #edf6ef; }
.status-inactive { color: #697670; background: #f0f3f1; }
.empty-state { text-align: center; padding: 52px 24px 56px; }
.empty-state p { color: var(--muted); margin: 10px auto 24px; font-size: 14px; }
.empty-icon { width: 46px; height: 46px; margin: 0 auto 17px; display: grid; place-items: center; color: var(--accent); background: var(--accent-light); border-radius: 13px; font-size: 26px; font-weight: 300; }
.back-link { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--muted); font-size: 13px; margin-bottom: 25px; }
.back-link:hover { color: var(--accent); }
.employee-form-card, .record-form-card { max-width: 760px; padding: 30px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.field-wide { grid-column: 1 / -1; }
.form-note { color: var(--muted); background: #f6f9f6; border: 1px solid #e6ece7; border-radius: 8px; padding: 14px 16px; font-size: 13px; }
.form-actions { display: flex; gap: 12px; border-top: 1px solid var(--line); padding-top: 24px; }
.page-actions, .pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pagination { justify-content: center; margin-top: 24px; font-size: 14px; }
.shift-table { min-width: 620px; }
.report-section { padding: 28px; display: grid; gap: 24px; }
.report-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.report-section-heading .button { flex-shrink: 0; }
.report-rows { display: grid; gap: 18px; }
.report-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb; }
.report-row[hidden] { display: none; }
.report-row .remove-row { grid-column: 1 / -1; justify-self: start; }
.participant-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.participant-field legend { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.participant-choices > div { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.participant-choices label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; overflow-wrap: anywhere; }
.participant-choices input { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.earnings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
.earnings-card { padding: 24px; }
.earnings-card h2 { font-size: 14px; color: var(--muted); }
.earnings-value { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 650; margin-top: 12px; overflow-wrap: anywhere; }
.participant-list { margin: 0; padding-left: 20px; display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 14px; }
.report-detail-section { margin-top: 24px; }
.report-table { min-width: 620px; }
.table-heading { padding: 24px; border-bottom: 1px solid var(--line); }
.table-empty { padding: 24px; color: var(--muted); font-size: 14px; }
.payroll-filter { padding: 22px 24px; margin-bottom: 28px; }
.month-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.month-form .field { width: 220px; max-width: 100%; }
.payroll-month { margin-bottom: 20px; text-transform: capitalize; }
.payroll-note { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.payroll-table { min-width: 680px; }
.payroll-table td { vertical-align: top; }
.employee-id { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.payroll-breakdown summary { cursor: pointer; color: var(--accent); }
.payroll-breakdown ul { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.payroll-breakdown li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }

@media (max-width: 1100px) {
    .header-inner { padding: 18px 28px; gap: 28px; flex-wrap: wrap; }
    .account-menu { gap: 12px; }
    .account-name { display: none; }
}

@media (max-width: 760px) {
    .header-inner { padding: 16px 22px; gap: 17px 24px; }
    .brand-name { font-size: 16px; }
    .main-nav { order: 3; width: 100%; gap: 24px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 9px; }
    .account-menu { margin-left: auto; }
    .account-menu > .subtle-link { display: none; }
    .header-note { display: none; }
    .page-container { padding: 32px 22px 48px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 20px; }
    .page-heading > .button { width: 100%; }
    .workspace-grid { grid-template-columns: 1fr; gap: 18px; }
    .employee-summary, .access-note, .employee-form-card, .record-form-card { padding: 24px; }
    .site-footer { padding: 0 22px 20px; }
    .form-grid { grid-template-columns: 1fr; gap: 20px; }
    .report-section { padding: 22px; }
    .report-section-heading { flex-direction: column; }
    .report-row { grid-template-columns: 1fr; padding: 16px; }
    .earnings-grid { grid-template-columns: 1fr; gap: 14px; }
    .login-container { padding-top: 40px; }
    .login-card { padding: 28px; }
    .search-form { padding: 18px; flex-wrap: wrap; }
    .search-field { flex: 1; width: auto; min-width: 160px; }
    .data-table th, .data-table td { padding: 16px 14px; }
}

@media (max-width: 420px) {
    .page-container { padding-right: 16px; padding-left: 16px; }
    .header-inner { padding-right: 16px; padding-left: 16px; }
    .login-card { padding: 24px; }
    .data-table { font-size: 13px; }
    .data-table th, .data-table td { padding: 15px 9px; }
    .data-table thead th { font-size: 11px; }
    .status { padding: 4px 6px; font-size: 11px; gap: 5px; }
    .edit-link { font-size: 12px; }
    .form-actions { flex-direction: column; }
    .form-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
