:root {
  --bg: #f5f6f7;
  --ink: #151515;
  --muted: #687078;
  --line: #d9dee3;
  --panel: #ffffff;
  --gold: #ffb612;
  --gold-dark: #8a5d00;
  --charcoal: #171717;
  --success: #2e7453;
  --warning: #9a6a00;
  --danger: #a33a33;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 182, 18, 0.07), transparent 290px),
    var(--bg);
}

a,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
}

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

label {
  display: grid;
  gap: 6px;
  color: #39414a;
  font-size: 0.84rem;
  font-weight: 800;
}

.checkbox-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  color: #39414a;
}

.checkbox-row input {
  width: auto;
  min-height: auto;
}

.login-strip,
.form-grid,
.toolbar {
  display: grid;
  gap: 10px;
}

.login-strip {
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) auto auto;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.upload-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.status-note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f8fa;
  line-height: 1.5;
}

.status-note.success {
  border-color: rgba(46, 116, 83, 0.35);
  background: #eef8f1;
  color: var(--success);
}

.status-note.error {
  border-color: rgba(163, 58, 51, 0.35);
  background: #fff1f0;
  color: var(--danger);
}

.status-note.pending {
  border-color: rgba(154, 106, 0, 0.35);
  background: #fff8e8;
  color: var(--warning);
}

.email-signature-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf0;
}

.email-signature-box strong,
.email-signature-box small {
  display: block;
}

.email-signature-box small {
  color: var(--muted);
  font-weight: 700;
}

.email-signature-preview {
  min-height: 42px;
  display: grid;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
}

.email-signature-preview img {
  display: block;
  max-width: 220px;
  max-height: 90px;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
}

.template-preview-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.template-preview-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.template-preview-surfaces {
  display: grid;
  gap: 12px;
}

.template-preview-surface {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.template-preview-email {
  padding: 18px;
  line-height: 1.65;
}

.template-preview-email h3 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.template-preview-email p,
.template-preview-email ul {
  margin: 0 0 12px;
}

.template-preview-mobile {
  width: min(360px, 100%);
  padding: 16px 14px;
  box-shadow: 0 8px 24px rgba(23, 23, 23, 0.08);
}

.template-preview-code {
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  background: #0f1720;
  color: #eff5fb;
  font-size: 0.82rem;
  line-height: 1.55;
}

.toolbar {
  grid-template-columns: minmax(200px, 1fr) 180px 180px auto;
  align-items: end;
}

.staff-toolbar {
  grid-template-columns: minmax(220px, 1fr) 220px;
}

.muted {
  color: var(--muted);
}

.queue-grid {
  display: grid;
  gap: 10px;
}

.data-row {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(260px, 360px);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.data-row strong {
  display: block;
  margin-bottom: 4px;
}

.processing-case-row {
  cursor: pointer;
}

.processing-case-row:hover,
.processing-case-row:focus-visible,
.processing-case-row.selected {
  border-color: #1f8a70;
  box-shadow: 0 0 0 3px rgba(31, 138, 112, 0.14);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.handover-summary {
  min-width: 0;
}

.handover-summary p {
  margin: 5px 0;
  line-height: 1.45;
}

.handover-notes {
  margin-top: 8px;
}

.itemized-handover {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.itemized-payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.itemized-payment-field {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
  padding: 9px;
}

.itemized-payment-field span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.itemized-payment-field strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.itemized-upload-list,
.itemized-note {
  margin-top: 10px;
}

.itemized-upload-list ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.itemized-note p {
  margin: 5px 0 0;
  white-space: pre-wrap;
}

.handover-notes summary,
.more-actions summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 800;
}

.verify-payment-panel {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 182, 18, 0.48);
  border-radius: 10px;
  background: #fffaf0;
}

.verify-payment-panel label {
  display: grid;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 800;
}

.verify-payment-panel input {
  width: 100%;
}

.verify-payment-panel small {
  color: var(--muted);
  font-weight: 700;
}

.more-actions {
  display: grid;
  gap: 8px;
}

.more-actions[open] {
  padding-top: 4px;
}

.compact-upload {
  display: grid;
  gap: 6px;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff9e8;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.compact-upload input {
  width: 100%;
  font-size: 0.78rem;
}

.wide-card {
  grid-column: span 2;
}

.mini-ranking {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.mini-ranking p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  font-size: 0.88rem;
}

.access-actions {
  min-width: 250px;
}

.staff-access-row {
  align-items: center;
}

.ghost {
  background: #fff;
  border-color: var(--line);
}

.danger-button {
  background: #ffe9e7;
  color: var(--danger);
  border-color: #ffc8c2;
}

.hidden {
  display: none !important;
}

.portal-tab-hidden {
  display: none !important;
}

.portal-load-banner {
  margin: 14px 18px 0;
  padding: 11px 13px;
  border: 1px solid rgba(255, 182, 18, 0.42);
  border-radius: var(--radius);
  background: #fff7df;
  color: #4d3500;
  font-weight: 800;
}

button {
  min-height: 38px;
  border: 1px solid rgba(255, 182, 18, 0.58);
  border-radius: var(--radius);
  background: var(--gold);
  color: #151515;
  padding: 8px 13px;
  font-weight: 850;
  cursor: pointer;
}

.portal-shell {
  min-height: 100vh;
  padding-left: 286px;
}

.side-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 286px;
  min-height: auto;
  overflow-y: auto;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  align-content: start;
  gap: 14px;
  padding: 20px;
  color: #fff;
  background:
    linear-gradient(rgba(16, 16, 16, 0.92), rgba(16, 16, 16, 0.98)),
    url("../employee-portal/assets/reside-global-sidebar-bg.jpg") center/cover;
  border-right: 1px solid rgba(255, 182, 18, 0.25);
}

.brand-block {
  display: grid;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-block img {
  width: min(210px, 100%);
  height: auto;
}

.brand-block span,
.eyebrow,
.stat span,
.task-card span,
.table-card span,
.owner-card span {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

nav {
  display: grid;
  gap: 8px;
  align-content: start;
  grid-auto-rows: minmax(42px, auto);
}

nav a {
  display: flex;
  align-items: center;
  color: #f6f6f6;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  min-height: 42px;
  padding: 9px 12px;
  font-weight: 800;
  line-height: 1.2;
}

nav a.active,
nav a:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #151515;
}

.owner-card {
  margin-top: 10px;
  border: 1px solid rgba(255, 182, 18, 0.28);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.owner-card strong {
  display: block;
  margin: 7px 0 4px;
}

.owner-card p {
  color: #d9d9d9;
}

.sidebar-logout-row {
  display: grid;
  margin-top: 0;
}

.side-logout {
  width: 100%;
  color: #151515;
  border-color: rgba(255, 182, 18, 0.68);
  background: var(--gold);
}

.workspace {
  min-width: 0;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.memo-ack-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.84)),
    url("../employee-portal/assets/reside-global-sidebar-bg.jpg") center/cover;
}

.memo-ack-dialog {
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(255, 182, 18, 0.58);
  border-radius: var(--radius);
  background: #141820;
  color: #fff;
  padding: clamp(22px, 4vw, 34px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.memo-ack-dialog h2 {
  margin: 6px 0 8px;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.03;
}

.memo-issued {
  margin: 0 0 18px;
  color: #d8dbe1;
}

.memo-ack-body {
  max-height: 270px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  padding: 16px;
  line-height: 1.65;
}

.memo-ack-check {
  display: flex;
  grid-template-columns: none;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0 10px;
  border: 1px solid rgba(46, 116, 83, 0.7);
  border-radius: var(--radius);
  background: rgba(46, 116, 83, 0.16);
  padding: 14px;
  color: #fff;
}

.memo-ack-check input {
  width: auto;
  min-height: auto;
  margin-top: 4px;
}

.memo-ack-dialog button {
  width: 100%;
  margin-top: 14px;
}

.branch-checkbox-panel {
  display: grid;
  gap: 8px;
}

.branch-checkbox-panel > span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.branch-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.branch-check-row,
.employee-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.branch-check-row {
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 182, 18, 0.4);
  border-radius: 8px;
  background: #fff8e6;
  color: #201a10;
  font-weight: 800;
}

.branch-check-row input,
.employee-check-row input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.recipient-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.employee-checkbox-list {
  max-height: 280px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.employee-check-row {
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}

.employee-check-row:hover {
  border-color: rgba(255, 182, 18, 0.85);
  background: #fff9eb;
}

.employee-check-row strong,
.employee-check-row small {
  display: block;
}

.employee-check-row small {
  margin-top: 3px;
  color: #5f6673;
  line-height: 1.35;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: end;
  min-height: 250px;
  padding: 24px;
  border: 1px solid rgba(255, 182, 18, 0.28);
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(16, 16, 16, 0.91), rgba(16, 16, 16, 0.56)),
    url("../employee-portal/assets/reside-global-banner.png") center/cover;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.13);
}

.hero h1 {
  margin: 6px 0 8px;
  font-size: clamp(2rem, 5vw, 3.55rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero p,
.owner-card p,
.stat p,
.task-card p,
.table-card p,
.activity p {
  margin: 0;
}

.hero p {
  max-width: 680px;
  color: #ededed;
}

.action-panel,
.stat,
.panel,
.task-card,
.table-card,
.activity {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.action-panel {
  padding: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.93);
}

.action-panel strong {
  display: block;
  margin: 7px 0 12px;
  font-size: 1.35rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  padding: 16px;
  border-left: 4px solid var(--gold);
}

.stat strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 1.7rem;
}

.executive-stat {
  min-height: 116px;
}

.executive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.executive-card,
.kpi-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfc;
  padding: 12px;
}

.executive-card span {
  display: block;
  color: var(--gold-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.executive-card strong {
  display: block;
  margin: 6px 0 3px;
  font-size: 1.28rem;
}

.compact-row {
  padding: 10px;
}

.layout-two,
.layout-three {
  display: grid;
  gap: 12px;
}

.layout-two {
  grid-template-columns: 1.1fr 0.9fr;
}

.layout-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel h2 {
  margin: 0;
  font-size: 1.12rem;
}

.task-list,
.activity-list {
  display: grid;
  gap: 10px;
}

.task-card,
.activity {
  padding: 12px;
  background: #fafbfc;
}

.activity-button {
  width: 100%;
  appearance: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.activity-button:hover,
.activity-button:focus {
  border-color: rgba(245, 181, 35, 0.72);
  box-shadow: 0 0 0 3px rgba(245, 181, 35, 0.14);
  outline: none;
}

.client-profile-card {
  border-color: rgba(245, 181, 35, 0.45);
  background: rgba(255, 249, 231, 0.88);
}

.import-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.import-progress::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  display: block;
  height: 0.75rem;
  border-radius: 999px;
  background: rgba(13, 29, 52, 0.12);
}

.import-progress span {
  grid-column: 1;
  grid-row: 1;
  display: block;
  width: 0%;
  height: 0.75rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--success));
  transition: width 160ms ease;
  z-index: 1;
}

.import-progress strong {
  font-size: 0.78rem;
  color: var(--ink);
}

.audience-preview {
  border: 1px solid rgba(20, 20, 20, 0.12);
  border-radius: 8px;
  background: #fffaf0;
  padding: 12px 14px;
}

.audience-preview strong {
  display: block;
  color: #111;
}

.audience-preview p {
  margin: 4px 0 0;
  color: var(--muted);
}

.task-card strong,
.activity strong {
  display: block;
  margin: 4px 0;
}

.pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  background: #fff3cf;
  color: var(--gold-dark);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.pill.success {
  background: #e8f6ef;
  color: var(--success);
}

.pill.warning {
  background: #fff3cf;
  color: var(--warning);
}

.pill.danger {
  background: #ffe9e7;
  color: var(--danger);
}

.table-card {
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #434a51;
  background: #f7f8f9;
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  background: #fff;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.filter-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-row select,
.filter-row input {
  min-width: 0;
  color: var(--ink);
  font-size: 0.92rem;
  text-transform: none;
}

@media (max-width: 980px) {
  .hero,
  .stat-grid,
  .layout-two,
  .layout-three,
  .login-strip,
  .toolbar,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .portal-shell {
    padding-left: 0;
  }

  .side-panel {
    min-height: auto;
    position: static;
    width: auto;
  }

  nav {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .workspace,
  .side-panel,
  .hero,
  .panel {
    padding: 14px;
  }

  nav {
    grid-template-columns: 1fr;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid,
  .data-row,
  .itemized-payment-grid {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-content: stretch;
  }

  .row-actions button {
    width: 100%;
  }
}
