:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: #101812;
  color: #eef4ed;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at top, #1a2c20, #101812 56%);
}

a { color: #a4d982; text-decoration: none; }
a:hover { color: #c3f1a4; }

.portal-header,
.portal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px max(24px, calc((100% - 1120px) / 2));
  border-bottom: 1px solid #29382c;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #eef4ed;
}

.portal-brand span:last-child { display: grid; gap: 3px; }
.portal-brand small { color: #91a091; font-size: 10px; letter-spacing: .14em; }
.portal-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: #8bcf5a;
  color: #101812;
  font-weight: 800;
}

.portal-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 14px; }
.portal-header nav .portal-nav-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.portal-header nav .portal-nav-button:hover { color: #e6eee5; }
.portal-main { width: min(1120px, calc(100% - 32px)); margin: 42px auto 64px; }

.portal-panel {
  width: min(460px, 100%);
  margin: 8vh auto;
  padding: 30px;
  border: 1px solid #324336;
  border-radius: 18px;
  background: rgba(22, 34, 24, .96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.portal-eyebrow { margin: 0 0 8px; color: #a4d982; font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(24px, 4vw, 34px); line-height: 1.15; }
.portal-muted { color: #a9b5aa; line-height: 1.55; }

.portal-form { display: grid; gap: 16px; margin-top: 24px; }
.portal-form label { display: grid; gap: 7px; color: #dce5dc; font-size: 13px; }
.portal-form input,
.portal-job-card select,
.portal-job-card input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #425448;
  border-radius: 9px;
  background: #101812;
  color: #eef4ed;
  font: inherit;
}

.portal-form input:focus,
.portal-job-card select:focus,
.portal-job-card input:focus { outline: 2px solid #8bcf5a; outline-offset: 1px; }
#portalEmployeeCode,
#portalJobSearch,
#portalQuotePartSearch,
#portalQuoteDiagnosisNotes,
[name="diagnosis_notes"] { text-transform: uppercase; }

.portal-button {
  min-height: 42px;
  padding: 10px 16px;
  border: 0;
  border-radius: 9px;
  background: #8bcf5a;
  color: #101812;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.portal-button:hover { background: #a4df77; }
.portal-button:disabled { cursor: wait; opacity: .65; }
.portal-button-secondary { border: 1px solid #435346; background: transparent; color: #e6eee5; }
.portal-button-secondary:hover { background: #243328; }
.portal-passkey-login { width: 100%; margin-top: 16px; }
.portal-dashboard-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.portal-passkeys-panel { width: 100%; margin: 0 0 24px; padding: 22px; }
.portal-passkeys-panel[hidden] { display: none; }
.portal-passkeys-panel h2 { margin: 0; font-size: 21px; }
.portal-passkeys-list { display: grid; gap: 10px; margin-top: 18px; }
.portal-passkey-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid #344537; border-radius: 12px; background: #17231a; }
.portal-passkey-item .portal-muted { margin: 5px 0 0; font-size: 13px; }
.portal-passkeys-panel > .portal-muted { margin: 8px 0 0; }

.portal-notice {
  margin-bottom: 20px;
  padding: 12px 15px;
  border: 1px solid #425448;
  border-radius: 10px;
  background: #17241a;
}

.portal-notice[data-kind="error"] { border-color: #9e4e48; color: #ffd1cc; }
.portal-notice[data-kind="success"] { border-color: #54834a; color: #c8f2b1; }
.portal-dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.portal-dashboard-heading .portal-muted { margin-bottom: 0; }
.portal-attendance { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; padding: 18px; border: 1px solid #344537; border-radius: 14px; background: #17231a; }
.portal-attendance-summary { min-width: min(100%, 240px); }
.portal-attendance-summary .portal-eyebrow { margin-bottom: 5px; }
.portal-attendance-summary strong { display: block; font-size: 16px; }
.portal-attendance-summary .portal-muted { margin: 5px 0 0; font-size: 13px; }
.portal-attendance-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-attendance-actions .portal-button { min-height: 40px; }
.portal-attendance-actions .portal-button:disabled { cursor: not-allowed; }
.portal-modal-overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: center; padding: 20px; overflow-y: auto; background: rgba(2, 6, 23, .82); }
.portal-modal-panel { width: min(620px, 100%); margin: auto; padding: 22px; border: 1px solid #425448; border-radius: 16px; background: #17231a; box-shadow: 0 24px 70px rgba(0, 0, 0, .4); }
.portal-modal-panel h2 { margin: 0 0 8px; font-size: 21px; }
.portal-modal-panel > p { margin: 0 0 16px; color: #b8c5b9; line-height: 1.5; }
.portal-modal-panel label { display: grid; gap: 7px; color: #dce5dc; font-size: 13px; }
.portal-modal-panel .portal-cashier-zero-acknowledgement { grid-template-columns: auto 1fr; align-items: start; gap: 8px; margin-top: 12px; }
.portal-cashier-zero-acknowledgement input { align-self: start; margin-top: 3px; }
.portal-modal-panel .portal-cashier-reason { margin-top: 12px; }
.portal-modal-panel input:not([type="checkbox"]),
.portal-modal-panel textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #425448; border-radius: 9px; background: #101812; color: #eef4ed; font: inherit; }
.portal-modal-panel textarea { resize: vertical; }
.portal-modal-panel [hidden] { display: none; }
.portal-modal-total { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 14px; border: 1px solid #425448; border-radius: 9px; background: #101812; }
.portal-modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.portal-modal-variance { min-height: 22px; margin-top: 10px; font-weight: 700; }
.portal-modal-variance.is-match { color: #a4d982; }
.portal-modal-variance.has-variance { color: #f5c66b; }
.portal-job-tools { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.portal-job-tools label { display: grid; flex: 1 1 260px; gap: 7px; color: #dce5dc; font-size: 13px; }
.portal-job-tools input,
.portal-job-tools select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #425448; border-radius: 9px; background: #101812; color: #eef4ed; font: inherit; }
.portal-job-tools input:focus,
.portal-job-tools select:focus { outline: 2px solid #8bcf5a; outline-offset: 1px; }
.portal-job-count { margin: 0; color: #a9b5aa; font-size: 13px; }
.portal-job-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; }

.portal-job-card {
  display: grid;
  min-height: 230px;
  align-content: space-between;
  gap: 19px;
  padding: 21px;
  border: 1px solid #3e6544;
  border-radius: 17px;
  background: linear-gradient(145deg, #203b28, #17231a 70%);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .18);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.portal-job-card:hover { transform: translateY(-3px); border-color: #8bcf5a; box-shadow: 0 20px 42px rgba(0, 0, 0, .28); }
.portal-job-card:focus-visible { outline: 3px solid #a4d982; outline-offset: 3px; }
.portal-job-card.priority-urgent { border-color: #a8732c; background: linear-gradient(145deg, #493517, #241f18 75%); }
.portal-job-card.priority-critical { border-color: #a94b4b; background: linear-gradient(145deg, #4a2528, #271a1d 75%); }
.portal-job-card-top,
.portal-job-card-bottom,
.portal-detail-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-job-number { color: #efffe7; font-size: clamp(26px, 3vw, 36px); font-weight: 900; line-height: 1; letter-spacing: .015em; overflow-wrap: anywhere; }
.portal-priority-badge,
.portal-status-badge,
.portal-quote-badge { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border: 1px solid #506b52; border-radius: 999px; background: rgba(15, 26, 17, .7); color: #d7edce; font-size: 11px; font-weight: 750; text-transform: capitalize; }
.priority-urgent .portal-priority-badge { border-color: #a8732c; color: #ffd890; }
.priority-critical .portal-priority-badge { border-color: #a94b4b; color: #ffc2c2; }
.portal-job-card-main h2 { margin: 0; color: #eff4eb; font-size: 19px; }
.portal-job-card-main p { margin: 6px 0 0; color: #b7c8b8; font-size: 15px; }
.portal-status-badge { border-color: #435b48; color: #deebdc; }
.portal-quote-badge { border-color: #8b733a; color: #f3d996; }
.portal-quote-badge.is-quoted { border-color: #3f6955; color: #a5e0bb; }
.portal-card-prompt { display: flex; justify-content: space-between; margin: 0; color: #a4d982; font-size: 13px; font-weight: 700; }

.portal-job-detail { display: grid; gap: 20px; }
.portal-detail-header { display: grid; gap: 12px; padding: 25px; border: 1px solid #3e6544; border-radius: 18px; background: linear-gradient(130deg, #203b28, #17231a 75%); }
.portal-detail-header > button { justify-self: start; }
.portal-detail-title { justify-content: flex-start; flex-wrap: wrap; }
.portal-detail-header h2 { margin: 0; font-size: clamp(22px, 4vw, 32px); }
.portal-detail-header .portal-muted { margin: 0; }
.portal-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; }
.portal-detail-grid > dl,
.portal-detail-notes,
.portal-status-form,
.portal-quote-action { margin: 0; padding: 20px; border: 1px solid #344537; border-radius: 14px; background: #17231a; }
.portal-detail-grid > dl { display: grid; align-content: start; grid-template-columns: 1fr 1fr; gap: 17px; }
.portal-detail-field dt { color: #91a091; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.portal-detail-field dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.portal-detail-notes h3,
.portal-status-form h3,
.portal-quote-action h3,
.portal-add-line h3 { margin: 0 0 12px; font-size: 16px; }
.portal-detail-notes p { margin: 0 0 15px; color: #b8c5b9; line-height: 1.55; overflow-wrap: anywhere; }
.portal-detail-notes p:last-child { margin-bottom: 0; }
.portal-diagnosis-form { display: grid; gap: 10px; margin: 12px 0 18px; }
.portal-diagnosis-form textarea { resize: vertical; }
.portal-diagnosis-form button { justify-self: start; }
.portal-inspection-summary { border-color: #695b31; }
.portal-detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.portal-status-form { display: grid; align-content: start; gap: 12px; }
.portal-status-form label,
.portal-diagnosis-form label,
.portal-quote-action label,
.portal-add-line label,
.portal-quote-summary label,
.portal-quote-notes { display: grid; gap: 7px; color: #dce5dc; font-size: 13px; }
.portal-status-form [hidden] { display: none; }
.portal-status-form input,
.portal-status-form select,
.portal-diagnosis-form textarea,
.portal-add-line input,
.portal-add-line select,
.portal-quote-line input,
.portal-quote-summary input,
.portal-quote-notes textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #425448; border-radius: 9px; background: #101812; color: #eef4ed; font: inherit; }
.portal-status-form input:focus,
.portal-status-form select:focus,
.portal-diagnosis-form textarea:focus,
.portal-add-line input:focus,
.portal-add-line select:focus,
.portal-quote-line input:focus,
.portal-quote-summary input:focus,
.portal-quote-notes textarea:focus { outline: 2px solid #8bcf5a; outline-offset: 1px; }
.portal-quote-action { display: grid; align-content: start; gap: 8px; }
.portal-quote-action p { margin: 0 0 9px; color: #b8c5b9; line-height: 1.5; }
.portal-button-accent { background: #4a9fe8; color: #071727; }
.portal-button-accent:hover { background: #6bb5f6; }
.portal-quote-panel { width: min(920px, 100%); margin: 0 auto; }
.portal-quote-panel > .portal-eyebrow { margin-top: 22px; }
.portal-quote-panel h2 { margin: 0; }
.portal-add-line { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; gap: 12px; margin-top: 20px; padding: 17px; border: 1px solid #344537; border-radius: 13px; background: #17231a; }
.portal-add-line h3 { grid-column: 1 / -1; margin-bottom: 0; }
.portal-add-line button { align-self: end; }
.portal-quote-part-picker,
.portal-quote-part-suggestions { grid-column: 1 / -1; }
.portal-quote-part-suggestions { max-height: 220px; overflow-y: auto; border: 1px solid #425448; border-radius: 9px; background: #101812; }
.portal-quote-part-suggestions[hidden] { display: none; }
.portal-quote-part-suggestion { display: grid; width: 100%; grid-template-columns: minmax(90px, .7fr) minmax(0, 2fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-bottom: 1px solid #29382c; background: transparent; color: #eef4ed; cursor: pointer; font: inherit; text-align: left; }
.portal-quote-part-suggestion:last-of-type { border-bottom: 0; }
.portal-quote-part-suggestion:hover,
.portal-quote-part-suggestion:focus-visible { background: #243328; outline: none; }
.portal-quote-part-suggestion span { overflow-wrap: anywhere; color: #b8c5b9; }
.portal-quote-part-suggestion small { color: #a4d982; white-space: nowrap; }
.portal-quote-part-empty,
.portal-quote-part-more { margin: 0; padding: 10px 12px; color: #a9b5aa; font-size: 12px; }
.portal-quote-lines { display: grid; gap: 12px; margin-top: 18px; }
.portal-quote-line { display: grid; grid-template-columns: 1fr 150px; gap: 12px; padding: 15px; border: 1px solid #344537; border-radius: 12px; background: #17231a; }
.portal-quote-line-title { display: flex; grid-column: 1 / -1; justify-content: space-between; gap: 12px; align-items: center; overflow-wrap: anywhere; }
.portal-quote-line > label { display: grid; gap: 6px; color: #b8c5b9; font-size: 12px; }
.portal-remove-line { border: 0; background: transparent; color: #ffaaa3; cursor: pointer; font: inherit; font-size: 12px; }
.portal-quote-summary { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(250px, 1fr); gap: 20px; margin-top: 20px; padding: 20px; border: 1px solid #344537; border-radius: 13px; background: #17231a; }
.portal-quote-summary dl { display: grid; gap: 9px; margin: 0; }
.portal-quote-summary dl div { display: flex; justify-content: space-between; gap: 12px; }
.portal-quote-summary dt { color: #b8c5b9; }
.portal-quote-summary dd { margin: 0; font-weight: 700; }
.portal-quote-summary .portal-quote-grand-total { padding-top: 10px; border-top: 1px solid #435346; font-size: 18px; }
.portal-error-text { grid-column: 1 / -1; margin: 0; color: #ffaaa3; }
.portal-quote-notes { margin-top: 18px; }
.portal-quote-notes textarea { resize: vertical; }
.portal-quote-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.portal-empty { grid-column: 1 / -1; padding: 30px; border: 1px dashed #425448; border-radius: 14px; color: #adb9ae; text-align: center; }
.portal-footer { border-top: 1px solid #29382c; border-bottom: 0; color: #91a091; font-size: 13px; }

@media (max-width: 600px) {
  .portal-header { align-items: flex-start; flex-direction: column; padding: 16px; }
  .portal-header nav { gap: 14px; }
  .portal-main { margin-top: 24px; }
  .portal-panel { margin: 4vh auto; padding: 22px; }
  .portal-dashboard-heading { align-items: flex-start; flex-direction: column; }
  .portal-dashboard-actions { width: 100%; }
  .portal-dashboard-actions .portal-button { flex: 1; }
  .portal-passkey-item { align-items: flex-start; flex-direction: column; }
  .portal-detail-grid,
  .portal-detail-actions,
  .portal-detail-grid > dl,
  .portal-quote-summary { grid-template-columns: 1fr; }
  .portal-quote-part-suggestion { grid-template-columns: 1fr auto; }
  .portal-quote-part-suggestion span { grid-column: 1 / -1; grid-row: 2; }
  .portal-quote-line { grid-template-columns: 1fr; }
  .portal-quote-line-title { align-items: flex-start; }
  .portal-footer { align-items: flex-start; flex-direction: column; padding: 16px; }
}
