:root {
  --ink: #10211f;
  --ink-2: #243b37;
  --muted: #6f7f7b;
  --line: #dfe7e4;
  --paper: #f3f6f4;
  --card: #ffffff;
  --green: #144c3f;
  --green-2: #1d6654;
  --mint: #daf3e9;
  --gold: #e6ad57;
  --red: #a93d3d;
  --shadow: 0 18px 55px rgba(28, 53, 47, 0.1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 8px; color: var(--green-2); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.muted { color: var(--muted); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px 20px; display: flex; flex-direction: column; color: #fff; background: linear-gradient(180deg, #0d3029, #102a25 70%, #0b211d); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 30px; color: #fff; text-decoration: none; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: #18362f; background: linear-gradient(145deg, #f2ca87, #dc9d45); font-family: Georgia, serif; font-size: 23px; font-weight: 800; box-shadow: inset 0 1px rgba(255,255,255,.45); }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 20px; letter-spacing: .02em; }
.brand small { margin-top: 1px; color: #a9c0ba; font-size: 10px; letter-spacing: .17em; text-transform: uppercase; }
nav { display: grid; gap: 5px; }
.nav-item { width: 100%; padding: 12px 13px; border: 0; border-radius: 10px; display: flex; align-items: center; gap: 12px; color: #b9cbc6; background: transparent; cursor: pointer; text-align: left; }
.nav-icon { width: 20px; flex: none; text-align: center; color: #d2e1dd; font-size: 18px; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { min-width: 24px; margin-left: auto; padding: 3px 7px; border-radius: 999px; color: #cfe0db; background: rgba(255,255,255,.1); font-size: 9px; font-weight: 900; text-align: center; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-item.active { box-shadow: inset 3px 0 var(--gold); }
.nav-item.active .nav-count { color: #18362f; background: var(--gold); }
.sidebar-card { margin-top: auto; padding: 16px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.06); }
.sidebar-card .eyebrow { color: #d9ad67; }
.sidebar-card strong, .sidebar-card small { display: block; }
.sidebar-card strong { font-size: 15px; }
.sidebar-card small { margin-top: 5px; color: #99aea8; }
.user-card { margin-top: 14px; padding: 14px 7px 0; border-top: 1px solid rgba(255,255,255,.09); display: grid; grid-template-columns: 36px 1fr 24px; align-items: center; gap: 9px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 50%; color: #fff; background: var(--green-2); font-size: 12px; font-weight: 800; }
.avatar.small { width: 38px; height: 38px; color: var(--green); background: #e5efeb; }
.user-card strong, .user-card small { display: block; }
.user-card strong { font-size: 12px; }
.user-card small { margin-top: 2px; color: #8fa59f; font-size: 10px; text-transform: capitalize; }
.user-card button { border: 0; color: #8fa59f; background: transparent; cursor: pointer; }

.workspace { min-width: 0; padding: 34px clamp(24px, 4vw, 58px) 60px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-family: Georgia, serif; font-size: clamp(30px, 4vw, 43px); line-height: 1.05; letter-spacing: -.03em; }
h2 { margin-bottom: 7px; font-family: Georgia, serif; font-size: 25px; letter-spacing: -.015em; }
h3 { margin-bottom: 7px; font-size: 15px; }
.topbar-actions, .queue-tools { display: flex; align-items: center; gap: 10px; }
.connection-pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; font-size: 12px; font-weight: 700; }
.connection-pill i, .match-badge i { width: 7px; height: 7px; border-radius: 50%; background: #b8c0be; }
.connection-pill.connected i { background: #31a376; box-shadow: 0 0 0 4px #dff3ea; }
.button { padding: 10px 15px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 800; cursor: pointer; text-decoration: none; text-align: center; transition: transform .12s, box-shadow .12s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; }
.button-primary { color: #fff; background: var(--green); box-shadow: 0 7px 18px rgba(20,76,63,.2); }
.button-secondary { border-color: var(--line); color: var(--ink); background: #fff; }
.button-wide { width: 100%; display: block; }

.metrics { margin: 30px 0 22px; display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; }
.metrics article { position: relative; overflow: hidden; padding: 20px 21px; border: 1px solid #e2e9e6; border-radius: 15px; background: rgba(255,255,255,.9); box-shadow: 0 10px 35px rgba(40,65,59,.045); }
.metrics article::after { content: ""; position: absolute; right: -18px; top: -23px; width: 76px; height: 76px; border-radius: 50%; background: #eff5f2; }
.metrics span, .metrics small, .metrics strong { display: block; position: relative; z-index: 1; }
.metrics span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.metrics strong { margin: 11px 0 2px; font-family: Georgia, serif; font-size: 31px; }
.metrics small { color: #889591; font-size: 11px; }

.queue-card { border: 1px solid #dfe7e4; border-radius: 18px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.queue-header { padding: 24px 25px 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.queue-header p { margin-bottom: 0; font-size: 12px; }
.queue-header .queue-description { max-width: 620px; margin: 2px 0 7px; line-height: 1.5; }
.search-box { width: min(310px, 33vw); padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; gap: 8px; color: #8b9995; background: #fafcfb; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
select, input, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--ink); background: #fff; }
select:focus, input:focus, textarea:focus { border-color: #73a696; box-shadow: 0 0 0 3px rgba(55,126,104,.1); }
.queue-tools select { width: 142px; font-size: 12px; }
.table-wrap { overflow-x: auto; border-top: 1px solid #e9eeec; }
table { width: 100%; border-collapse: collapse; min-width: 930px; }
th { padding: 12px 16px; color: #788783; background: #f7f9f8; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .08em; }
td { padding: 15px 16px; border-top: 1px solid #edf1ef; font-size: 12px; vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: #f8fbf9; }
td strong, td small { display: block; }
td small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.person-cell { display: flex; align-items: center; gap: 11px; }
.match-badge, .outcome { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.match-badge.matched { color: #176145; background: #e1f4ec; }
.match-badge.matched i { background: #27996d; }
.match-badge.review { color: #8a5a12; background: #fff1d8; }
.match-badge.review i { background: #d6952d; }
.match-badge.unmatched { color: #8b4b4b; background: #fae7e7; }
.match-badge.unmatched i { background: #c15d5d; }
.outcome { color: #52625e; background: #edf1ef; }
.outcome-appointment-set { color: #176145; background: #dff3ea; }
.outcome-follow-up, .outcome-callback { color: #80520f; background: #fff0d3; }
.outcome-do-not-call, .outcome-not-interested { color: #8a4141; background: #f8e3e3; }
.note-preview { max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feedback-preview { color: #8a5a12; }
.icon-button { border: 0; background: transparent; color: #7b8b87; cursor: pointer; }
.action-cell { width: 1%; white-space: nowrap; }
.row-note { padding: 8px 10px; white-space: nowrap; }
.empty-state { padding: 65px 20px; display: grid; place-items: center; gap: 7px; color: var(--muted); }
.empty-state .button { margin-top: 9px; }

.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 10; background: rgba(7,24,20,.44); backdrop-filter: blur(3px); }
.drawer { position: fixed; z-index: 11; top: 0; right: 0; width: min(470px, 95vw); height: 100vh; overflow-y: auto; padding: 27px; background: #f7faf8; box-shadow: -25px 0 70px rgba(10,31,26,.2); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.icon-button { width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 21px; }
.match-card, .drawer-section { margin-top: 18px; padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.match-card h3 { margin: 15px 0 3px; font-family: Georgia, serif; font-size: 21px; }
.match-card p { margin-bottom: 12px; color: var(--muted); }
.match-card dl { margin: 0 0 17px; }
.match-card dl div { padding: 8px 0; border-top: 1px solid #edf1ef; }
.match-card dt { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.match-card dd { margin: 3px 0 0; font-size: 12px; }
.match-finder { margin-top: 10px; }
.match-search-panel { margin-top: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.match-results { margin-top: 9px; display: grid; gap: 6px; }
.match-result { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; display: grid; gap: 3px; color: var(--ink); background: #fafcfb; text-align: left; cursor: pointer; }
.match-result:hover { border-color: #73a696; background: #f1f8f5; }
.match-result strong, .match-result span, .match-result small { display: block; }
.match-result span { color: var(--green-2); font-size: 11px; }
.match-result small, .match-searching { color: var(--muted); font-size: 10px; line-height: 1.4; }
.drawer-section h3 { margin-bottom: 14px; }
.note-instructions { margin: -5px 0 15px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.section-heading h3 { margin-bottom: 0; }
.feedback-detail { margin-bottom: 14px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.feedback-response { padding: 13px; border: 1px solid #dce8e3; border-radius: 10px; color: var(--ink); background: #f4faf7; }
.feedback-response-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.feedback-response-head strong { color: #d69b36; letter-spacing: .08em; }
.feedback-response p { margin: 9px 0; font-size: 12px; line-height: 1.5; }
.feedback-response small { margin-top: 7px; display: block; color: var(--muted); line-height: 1.45; }
.feedback-state { color: var(--green-2); font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.feedback-help { min-height: 16px; margin-top: 8px; display: block; color: var(--muted); font-size: 10px; line-height: 1.45; }
.feedback-composer { margin: 0 0 12px; padding: 13px; border: 1px solid #ead8ba; border-radius: 11px; background: #fffaf1; }
.feedback-composer textarea { margin-top: 2px; font-size: 11px; }
.feedback-actions { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.timeline { display: grid; gap: 4px; }
.timeline-item { padding: 9px 0; display: flex; align-items: center; gap: 11px; border-top: 1px solid #edf1ef; }
.timeline-item:first-child { border-top: 0; }
.direction { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: #176145; background: #e2f2eb; font-weight: 900; }
.direction-missed { color: #9b4848; background: #f7e3e3; }
.timeline-item strong, .timeline-item small { display: block; }
.timeline-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.note-form { display: grid; gap: 13px; }
.note-form h3 { margin-bottom: 0; }
label { display: grid; gap: 6px; color: var(--ink-2); font-size: 11px; font-weight: 800; }
textarea { resize: vertical; line-height: 1.45; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-success, .form-error { min-height: 17px; margin: 0; font-size: 11px; }
.form-success { color: var(--green-2); }
.form-error { color: var(--red); }

.modal { position: fixed; z-index: 11; left: 50%; top: 50%; width: min(920px, 94vw); max-height: 88vh; overflow-y: auto; transform: translate(-50%, -50%); padding: 28px; border-radius: 18px; background: #f7faf8; box-shadow: 0 28px 90px rgba(7,28,23,.3); }
.control-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.control-grid article { padding: 19px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.control-grid p { min-height: 65px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.control-grid small { min-height: 32px; margin-top: 10px; display: block; color: var(--green-2); line-height: 1.4; }
.step-number { color: var(--gold); font-family: Georgia, serif; font-size: 20px; }
.stacked-fields { display: grid; gap: 7px; }
.control-grid textarea, .control-grid input { margin-bottom: 8px; font-size: 11px; }

.feedback-page { min-height: 100vh; padding: 24px; color: var(--ink); background: radial-gradient(circle at 12% 2%, rgba(230,173,87,.2), transparent 24%), linear-gradient(150deg, #0c3028 0, #164c40 43%, #f1f5f3 43%); }
.feedback-shell { width: min(720px, 100%); margin: 0 auto; }
.feedback-brand { margin: 18px 0 22px; display: flex; align-items: center; gap: 12px; color: #fff; }
.feedback-brand strong, .feedback-brand small { display: block; }
.feedback-brand strong { font-family: Georgia, serif; font-size: 19px; }
.feedback-brand small { margin-top: 2px; color: #b9cec8; font-size: 9px; letter-spacing: .15em; text-transform: uppercase; }
.feedback-card { padding: clamp(26px, 6vw, 50px); border: 1px solid rgba(255,255,255,.6); border-radius: 22px; background: rgba(255,255,255,.97); box-shadow: 0 28px 90px rgba(6,32,25,.24); }
.feedback-card h1 { margin-bottom: 13px; font-size: clamp(32px, 7vw, 48px); }
.feedback-intro, .feedback-thanks > p { color: var(--muted); font-size: 14px; line-height: 1.65; }
#customer-feedback-form { margin-top: 28px; display: grid; gap: 20px; }
.rating-field { margin: 0; padding: 0; border: 0; }
.rating-field legend { margin-bottom: 9px; color: var(--ink-2); font-size: 11px; font-weight: 800; }
.rating-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.rating-options label { position: relative; display: grid; gap: 3px; text-align: center; cursor: pointer; }
.rating-options input { position: absolute; opacity: 0; pointer-events: none; }
.rating-options span { height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--green); background: #f8fbfa; font-family: Georgia, serif; font-size: 21px; }
.rating-options small { color: var(--muted); font-size: 8px; font-weight: 600; }
.rating-options input:checked + span { border-color: var(--gold); color: #66400d; background: #fff0d6; box-shadow: 0 0 0 3px rgba(230,173,87,.16); }
.feedback-submit { padding-block: 14px; font-size: 13px; }
.feedback-check { width: 48px; height: 48px; margin-bottom: 17px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green-2); font-size: 23px; font-weight: 900; }
.review-choice { margin-top: 25px; padding: 20px; display: grid; gap: 10px; border: 1px solid #dbe8e3; border-radius: 15px; background: #f4f9f7; }
.review-choice small { color: var(--muted); font-size: 10px; line-height: 1.5; text-align: center; }
.review-draft { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.review-disclosure, .review-unavailable { color: var(--muted); font-size: 10px; line-height: 1.5; }
.review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.feedback-error-card { text-align: center; }
.feedback-footer { padding: 20px; color: #627a73; font-size: 10px; text-align: center; }

.auth-page { display: grid; place-items: center; padding: 30px; background: #102e28; }
.auth-shell { width: min(1010px, 100%); min-height: 620px; display: grid; grid-template-columns: 1.15fr .85fr; overflow: hidden; border-radius: 24px; background: #fff; box-shadow: 0 35px 110px rgba(0,0,0,.3); }
.auth-brand { position: relative; overflow: hidden; padding: 65px; color: #fff; background: radial-gradient(circle at 75% 20%, rgba(230,173,87,.23), transparent 34%), linear-gradient(145deg, #123d33, #0a2721); }
.auth-brand::after { content: ""; position: absolute; right: -130px; bottom: -150px; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018); }
.auth-brand .eyebrow { margin-top: 90px; color: #e4b86f; }
.auth-brand h1 { max-width: 540px; font-size: clamp(38px, 5vw, 57px); }
.auth-copy { max-width: 500px; color: #b6c9c4; font-size: 15px; line-height: 1.7; }
.auth-proof { margin-top: 45px; display: flex; flex-wrap: wrap; gap: 9px; }
.auth-proof span { padding: 8px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: #c9d8d4; font-size: 10px; }
.auth-card { padding: 60px 48px; align-self: center; }
.auth-card h2 { font-size: 32px; }
.auth-card form { margin-top: 30px; display: grid; gap: 15px; }
.auth-security { margin-top: 24px; color: #87938f; font-size: 10px; line-height: 1.5; text-align: center; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 78px 1fr; }
  .sidebar { padding-inline: 11px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > span:last-child, .nav-label { display: none; }
  .nav-item { justify-content: center; }
  .nav-icon { font-size: 19px; }
  .nav-count { min-width: 18px; margin-left: 0; padding: 2px 5px; font-size: 8px; }
  .sidebar-card, .user-card > div:not(.avatar), .user-card button { display: none; }
  .user-card { display: flex; justify-content: center; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .queue-header { align-items: stretch; flex-direction: column; }
  .queue-tools, .search-box { width: 100%; }
  .control-grid { grid-template-columns: 1fr; }
  .control-grid p { min-height: 0; }
}

@media (max-width: 620px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 13px 18px; flex-direction: row; align-items: center; }
  .brand { padding: 0; }
  .sidebar { position: sticky; z-index: 8; top: 0; display: block; overflow-x: auto; }
  .brand, .sidebar-card, .user-card { display: none; }
  .sidebar nav { display: flex; width: max-content; min-width: 100%; gap: 6px; }
  .nav-item { width: auto; padding: 9px 10px; gap: 6px; }
  .nav-label { display: inline; font-size: 9px; }
  .nav-count { min-width: 18px; }
  .workspace { padding: 23px 14px 45px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .topbar-actions { flex-wrap: wrap; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metrics article { padding: 15px; }
  .queue-tools { flex-direction: column; }
  .queue-tools select { width: 100%; }
  .field-grid { grid-template-columns: 1fr; }
  .auth-page { padding: 0; }
  .auth-shell { min-height: 100vh; grid-template-columns: 1fr; border-radius: 0; }
  .auth-brand { padding: 32px; min-height: 300px; }
  .auth-brand .eyebrow { margin-top: 40px; }
  .auth-brand h1 { font-size: 38px; }
  .auth-copy, .auth-proof { display: none; }
  .auth-card { padding: 38px 28px; }
  .feedback-page { padding: 12px; background: linear-gradient(180deg, #103b31 0, #174c40 210px, #f1f5f3 210px); }
  .feedback-brand { margin: 10px 6px 17px; }
  .feedback-card { padding: 27px 19px; border-radius: 17px; }
  .rating-options { gap: 4px; }
  .rating-options span { height: 43px; }
  .rating-options small { font-size: 7px; }
  .review-actions, .feedback-actions { grid-template-columns: 1fr; }
  .table-wrap { overflow: visible; }
  table { min-width: 0; }
  thead { display: none; }
  tbody { display: grid; }
  tbody tr { padding: 15px; border-top: 1px solid #edf1ef; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  tbody td { padding: 0; border: 0; }
  tbody td:first-child, tbody td:last-child { grid-column: 1 / -1; }
  .action-cell { width: auto; }
  .row-note { width: 100%; }
}
