/* =============================================================================
   ACRES app — Sunshine Boys look, app edition
   James's rule (2026-11-16): yellow is an ACCENT only (buttons, highlights,
   active states), never the page background. Ground = light blue-gray / white,
   text = black, secondary = light blue. Type = Poppins (legible); Art Deco comes
   from the stepped rules, double lines and the sunburst mark, not the font.
   Contrast: never yellow text on white. Yellow is a fill with black text on it.
   ============================================================================= */
@font-face { font-family: "Poppins"; src: url("../assets/fonts/Poppins-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../assets/fonts/Poppins-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../assets/fonts/Poppins-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../assets/fonts/Poppins-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --sun: #f8dc08;          /* accent only */
  --sun-soft: #fdf3a6;     /* highlight wash for active rows */
  --ink: #0a0a0a;
  --text: #1d2a32;
  --muted: #55646d;
  --blue: #13648f;         /* Hollywood Blue: links, icons */
  --sky: #a7daf4;          /* light blue secondary */
  --sky-wash: #e8f4fb;
  --ground: #f3f6f8;       /* page background: light blue-gray */
  --surface: #ffffff;
  --line: #d7e0e6;
  --danger: #9b1c1c;
  --danger-bg: #fdecec;
  --ok: #14532d;
  --ok-bg: #e8f5ee;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(7,33,48,.06), 0 4px 14px rgba(7,33,48,.06);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--ground); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); font-weight: 500; }
a:hover { color: var(--ink); background: var(--sun-soft); }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0; }
h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: .01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Demo banner (always on top in demo mode) ---- */
.demo-banner { background: var(--ink); color: #fff; text-align: center; font-size: .82rem; padding: 6px 12px; letter-spacing: .04em; }
.demo-banner strong { background: var(--sun); color: var(--ink); padding: 1px 8px; border-radius: 2px; margin-right: 6px; letter-spacing: .12em; }
.demo-banner select { width: auto; display: inline-block; font: inherit; font-size: .8rem; margin-left: 8px; border-radius: 3px; border: 1px solid #555; padding: 1px 4px; }

/* ---- Header: white, black rule + thin yellow deco line ---- */
.app-header { background: var(--surface); border-bottom: 3px solid var(--ink); box-shadow: 0 3px 0 var(--sun); position: sticky; top: 0; z-index: 20; }
.app-header .bar { display: flex; align-items: center; gap: 14px; max-width: 1280px; margin: 0 auto; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { background: none; color: var(--ink); }
.brand img { width: 34px; height: 34px; }
.brand .word { font-weight: 700; letter-spacing: .28em; font-size: 1.05rem; }
.brand .sub { font-weight: 500; font-size: .68rem; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; display: block; margin-top: -2px; }
.bar .spacer { flex: 1; }
.who { font-size: .82rem; color: var(--muted); text-align: right; line-height: 1.25; }
.who b { color: var(--ink); font-weight: 600; }
.role-pill { display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; border: 1.5px solid var(--ink); padding: 0 7px; border-radius: 2px; margin-left: 4px; }
select.company { width: auto; max-width: 300px; font: inherit; font-size: .85rem; font-weight: 600; padding: 6px 28px 6px 10px; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--surface); }

/* ---- Buttons ---- */
.btn { white-space: nowrap; font: inherit; font-size: .88rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius); padding: 8px 14px; border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--sky-wash); color: var(--ink); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .row:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.btn.primary { background: var(--sun); border-color: var(--ink); }      /* yellow = accent */
.btn.primary:hover { background: #ffe94d; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--blue); padding: 6px 8px; }
.btn.ghost:hover { background: var(--sky-wash); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.small { font-size: .78rem; padding: 4px 9px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- Deco rule: double line with a centered diamond ---- */
.deco-rule { position: relative; height: 7px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); margin: 14px 0; }
.deco-rule::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; background: var(--sun); border: 1px solid var(--ink); transform: translate(-50%,-50%) rotate(45deg); }

/* ---- Login ---- */
.login-wrap { min-height: calc(100vh - 40px); display: grid; place-items: center; padding: 32px 16px; background:
  radial-gradient(circle at 50% -20%, var(--sky-wash) 0, transparent 55%), var(--ground); }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: 6px 6px 0 var(--sky); padding: 30px 28px 24px; position: relative; }
.login-card::before, .login-card::after { content: ""; position: absolute; width: 18px; height: 18px; border: 3px solid var(--sun); }
.login-card::before { top: -9px; left: -9px; border-right: 0; border-bottom: 0; }
.login-card::after { bottom: -9px; right: -9px; border-left: 0; border-top: 0; }
.login-card .logo { display: block; width: 100%; max-width: 300px; margin: 0 auto 6px; }
.login-card h1 { text-align: center; font-size: 1.05rem; letter-spacing: .3em; margin-top: 10px; }
.login-card p.lead { text-align: center; color: var(--muted); margin: 4px 0 0; font-size: .9rem; }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.field .hint { font-size: .78rem; color: var(--muted); }
input[type=text], input[type=email], input[type=search], input[type=tel], select, textarea {
  font: inherit; font-size: 1rem; width: 100%; padding: 10px 12px; border: 1.5px solid #9fb0bb; border-radius: var(--radius); background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--sky); }
textarea { min-height: 84px; resize: vertical; }
.msg { border-radius: var(--radius); padding: 10px 12px; font-size: .88rem; margin: 10px 0; border: 1px solid; }
.msg.ok { background: var(--ok-bg); color: var(--ok); border-color: #a7d7b9; }
.msg.err { background: var(--danger-bg); color: var(--danger); border-color: #f0b4b4; }
.msg.info { background: var(--sky-wash); color: var(--text); border-color: var(--sky); }
.login-foot { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 14px; }
.full { width: 100%; justify-content: center; padding: 12px; font-size: .95rem; }

/* ---- Contacts layout ---- */
.layout { max-width: 1280px; margin: 0 auto; padding: 18px 20px 40px; display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.list-panel { position: sticky; top: 84px; max-height: calc(100vh - 104px); display: flex; flex-direction: column; }
.search { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.search .row-tools { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.search input[type=search] { padding-left: 38px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%230a0a0a' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; }
.count { font-size: .78rem; color: var(--muted); margin-right: auto; }
.chip-filter { font: inherit; font-size: .75rem; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 2px 10px; cursor: pointer; }
.chip-filter[aria-pressed=true] { background: var(--sun); border-color: var(--ink); font-weight: 600; }
.results { overflow-y: auto; flex: 1; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; border-left: 4px solid transparent; }
.row:hover { background: var(--sky-wash); }
.row.active { background: var(--sun-soft); border-left-color: var(--ink); }
.row .name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .code { font-size: .75rem; font-weight: 600; letter-spacing: .06em; color: var(--blue); }
.row .meta { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row mark { background: var(--sun); color: var(--ink); padding: 0 1px; }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: .9rem; }

/* ---- Contact card ---- */
.card { padding: 0; overflow: hidden; }
.card-head { padding: 18px 22px 14px; border-bottom: 1.5px solid var(--ink); background: linear-gradient(180deg, var(--sky-wash), #fff); position: relative; }
.card-head::after { content: ""; position: absolute; left: 22px; bottom: -1.5px; width: 64px; height: 4px; background: var(--sun); }
.card-head .top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.code-badge { font-weight: 700; font-size: .82rem; letter-spacing: .1em; background: var(--ink); color: #fff; padding: 3px 9px; border-radius: 2px; }
.card-head h1 { margin-top: 8px; }
.card-head .legal { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag { font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 2px; border: 1px solid var(--line); background: #fff; }
.tag.type { border-color: var(--blue); color: var(--blue); }
.tag.status-Active { background: var(--ok-bg); border-color: #a7d7b9; color: var(--ok); }
.tag.status-Inactive { background: #eef1f3; color: var(--muted); }
.tag.status-On.Hold, .tag.status-OnHold { background: #fff6d6; border-color: #e3c75a; color: #6b5300; }
.tag.rel { background: var(--sky-wash); border-color: var(--sky); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.card-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.section { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.section:nth-child(odd) { border-right: 1px solid var(--line); }
.section.wide { grid-column: 1 / -1; border-right: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.group-label { font-size: .72rem; font-weight: 600; color: var(--blue); letter-spacing: .1em; text-transform: uppercase; margin: 10px 0 4px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-top: 1px dashed var(--line); align-items: center; }
.item:first-of-type { border-top: 0; }
.item .main { font-weight: 500; color: var(--ink); word-break: break-word; }
.item .main a { color: var(--ink); text-decoration: none; }
.item .main a:hover { text-decoration: underline; }
.item .sub { font-size: .78rem; color: var(--muted); grid-column: 1 / 2; }
.item .controls { display: flex; gap: 6px; align-items: center; grid-row: 1 / span 2; grid-column: 2; }
.primary-dot { display: inline-block; font-size: .65rem; font-weight: 700; letter-spacing: .08em; background: var(--sun); color: var(--ink); padding: 0 5px; border-radius: 2px; margin-left: 6px; vertical-align: 2px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--muted); cursor: pointer; user-select: none; }
.toggle input { appearance: none; width: 34px; height: 20px; border-radius: 99px; background: #c9d4db; position: relative; cursor: pointer; transition: background .15s; margin: 0; border: 1px solid #9fb0bb; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.toggle input:checked { background: var(--sun); border-color: var(--ink); }
.toggle input:checked::after { left: 16px; background: var(--ink); }
.toggle input:disabled { cursor: not-allowed; opacity: .6; }
.note { padding: 10px 12px; border-left: 3px solid var(--sky); background: #fafcfd; margin-bottom: 8px; border-radius: 0 var(--radius) var(--radius) 0; }
.note .when { font-size: .74rem; color: var(--muted); margin-bottom: 2px; }
.note .body { white-space: pre-wrap; }
.muted { color: var(--muted); font-size: .85rem; }
.welcome { padding: 48px 28px; text-align: center; }
.welcome img { width: 72px; opacity: .9; }
.welcome p { color: var(--muted); max-width: 420px; margin: 8px auto 0; }
.back { display: none; }

/* ---- Dialog ---- */
dialog { border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 24px)); box-shadow: 8px 8px 0 var(--sky); }
dialog::backdrop { background: rgba(7,33,48,.45); }
dialog form { padding: 20px 22px 18px; }
dialog h2 { margin-bottom: 4px; }
dialog .deco-rule { margin: 10px 0 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.check { display: flex; gap: 8px; align-items: center; font-size: .88rem; margin: 4px 0 10px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius); font-size: .88rem; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 50; border-left: 5px solid var(--sun); max-width: calc(100vw - 32px); }
.toast.err { border-left-color: #f87171; }

/* ---- Mobile ---- */
@media (max-width: 820px) {
  select.company { max-width: 130px; font-size: .78rem; padding: 5px 22px 5px 8px; }
  .who br { display: none; }
  .who { flex-shrink: 0; }
  .demo-banner { font-size: .74rem; padding: 5px 8px; }
  .app-header .bar { padding: 8px 12px; gap: 10px; }
  .brand .word { font-size: .95rem; letter-spacing: .2em; }
  .brand .sub, .who .email { display: none; }
  .layout { grid-template-columns: 1fr; padding: 10px 10px 30px; gap: 10px; }
  .list-panel { position: static; max-height: none; }
  .results { overflow: visible; }
  body.show-card .list-panel { display: none; }
  body:not(.show-card) .card-panel { display: none; }
  .back { display: inline-flex; margin-bottom: 8px; }
  .card-body { grid-template-columns: 1fr; }
  .section, .section:nth-child(odd) { border-right: 0; padding: 14px 16px; }
  .card-head { padding: 16px 16px 12px; }
  .grid2 { grid-template-columns: 1fr; }
  input[type=search] { font-size: 16px; }   /* stops iOS zoom */
}
