/* La Turista Filipina – Design System v0.1 (decisions 60, 61, 62).
   Navy #133348, amber #FAA21C, light mode only, 40 px controls,
   one amber main button per screen, badges always show a word. */

:root {
  --navy: #133348; --amber: #faa21c; --amberh: #e8920a;
  --bg: #f4f7f9; --sf: #fff; --tx: #17293a; --mu: #5a6b7a; --bd: #d9e2e8;
  --acb: #e3edf3; --rd: #a32020; --rdb: #fde6e6; --am: #7a4a00; --amb: #fff1d6;
  --gn: #14683f; --gnb: #dff3e8; --nb: #e8ecef;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--tx); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#root { height: 100%; }
h1 { font-size: 20px; margin: 0 0 2px; color: var(--navy); }
h3 { margin: 0 0 8px; font-size: 15px; color: var(--navy); }
a { color: var(--navy); }
.sub { color: var(--mu); margin: 0 0 14px; }
.hint { color: var(--mu); font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
/* Hidden labels stay inside the screen area, so they never make the whole page scroll. */
.list { position: relative; }

/* Buttons */
.btn { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid #c3cfd8; background: #fff; color: var(--navy);
  font: inherit; font-weight: 500; cursor: pointer; }
.btn:hover { background: #eef3f7; border-color: #9fb1c0; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.pri { background: var(--amber); border-color: var(--amber); color: var(--navy); font-weight: 600; }
.btn.pri:hover { background: var(--amberh); border-color: var(--amberh); }
.btn.dng { background: #b42318; border-color: #b42318; color: #fff; font-weight: 600; }
.btn.dng:hover { background: #912018; border-color: #912018; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.sel-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.big-btn { width: 100%; min-height: 46px; font-size: 15px; margin: 6px 0 10px; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
input:focus { outline: 2px solid var(--navy); outline-offset: 1px; box-shadow: 0 0 0 4px rgba(250,162,28,.4); }

/* Badges */
.chip { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.am { background: var(--amb); color: var(--am); } .gn { background: var(--gnb); color: var(--gn); }
.nb { background: var(--nb); color: var(--mu); } .rd { background: var(--rdb); color: var(--rd); }
.ro { background: var(--amb); color: var(--am); padding: 10px 12px; border-radius: 8px; margin: 10px 0; }

/* Logo */
.logo { position: relative; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--navy); flex: none; overflow: hidden; }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.logo .mono { color: var(--amber); font-weight: 700; font-size: 0.34em; letter-spacing: .5px; }
.gate .logo { font-size: 72px; }
.brand .logo { font-size: 36px; }
.brand .logo:not(:has(img)) { box-shadow: 0 0 0 2px var(--amber); }

/* Sign-in and blocked screens */
.gate { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(160deg, var(--navy) 0 38%, var(--bg) 38%); }
.gate-card { background: #fff; border-radius: 16px; padding: 28px 26px; width: 100%; max-width: 380px; text-align: center;
  box-shadow: 0 16px 40px rgba(19,51,72,.18); }
.gate-card h1 { margin-top: 12px; }
.demo-tag { margin-top: 10px; color: var(--am); }

/* App frame */
.app { display: grid; grid-template-columns: 228px minmax(0,1fr); height: 100%; }
.side { background: var(--navy); padding: 14px 10px; overflow: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; font-size: 15px; padding: 2px 6px 12px; }
.lab { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9fb3c4;
  margin: 10px 4px 0; padding: 12px 8px 6px; border-top: 1px solid rgba(255,255,255,.16); }
.brand + .lab { margin-top: 0; }
.lab.adm { color: var(--amber); }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  color: #c9d6e0; text-decoration: none; border-radius: 0 8px 8px 0; }
.nav:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav.on { background: rgba(250,162,28,.16); color: var(--amber); box-shadow: inset 3px 0 0 var(--amber); font-weight: 600; }
.nav .soon { font-size: 11px; color: #8fa4b5; font-weight: 400; white-space: nowrap; }
.me { margin: auto 0 0; padding: 12px 12px 10px; color: #fff; background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.14); border-radius: 10px; }
.side > .nav:last-of-type { margin-bottom: 16px; }
.me-n { font-weight: 600; overflow-wrap: anywhere; }
.me-e { font-size: 12px; color: #c9d6e0; margin-bottom: 6px; overflow-wrap: anywhere; }
.me .chip { margin-right: 6px; }
.btn.ghost-l { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; margin-top: 8px; }
.btn.ghost-l:hover { background: rgba(255,255,255,.1); }
.list { overflow: auto; padding: 22px; min-width: 0; }
.sec { background: var(--sf); border: 1px solid var(--bd); border-radius: 10px; padding: 14px 16px; margin: 14px 0; max-width: 720px; }
.sec ul { margin: 0 0 8px; padding-left: 20px; }

/* Tables */
.tbl { overflow-x: auto; border-radius: 10px; border: 1px solid var(--bd); background: #fff; max-width: 960px; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--navy); color: #fff; font-weight: 600; text-align: left; padding: 11px 12px; font-size: 13px; }
td { padding: 12px; border-bottom: 1px solid var(--bd); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: #fafcfd; }
td.acts { white-space: nowrap; text-align: right; }
td.acts .btn + .btn { margin-left: 6px; }
.acc-e { font-weight: 500; overflow-wrap: anywhere; }

/* Key-value lists and wide tables */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; }
.kv > span:nth-child(odd) { color: var(--mu); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.row-between h3 { margin: 0; }
.row-between > .btn { white-space: nowrap; flex: none; }
.tbl.wide { max-width: none; }

/* Queues and case panel */
.nav .cnt { font-size: 12px; color: #c9d6e0; }
.nav .cnt.warn { background: var(--amber); color: var(--navy); border-radius: 10px; padding: 0 7px; font-weight: 700; }
.split { display: flex; gap: 16px; align-items: flex-start; }
.pane { flex: 1; min-width: 0; }
.panel { width: 400px; flex: none; background: #fff; border: 1px solid var(--bd); border-radius: 12px; padding: 16px; position: sticky; top: 0;
  max-height: calc(100vh - 44px); overflow: auto; }
.ph { display: flex; justify-content: space-between; align-items: center; }
.ph b { font-size: 17px; color: var(--navy); }
.x { background: none; border: 0; font-size: 24px; line-height: 1; color: var(--mu); cursor: pointer; min-width: 40px; min-height: 40px; }
.pchips { margin: 4px 0 10px; }
.tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--bd); margin: 6px 0 12px; overflow-x: auto; }
.tab { padding: 8px 0; color: var(--mu); border: 0; border-bottom: 2px solid transparent; white-space: nowrap; background: none;
  font: inherit; cursor: pointer; min-height: 40px; }
.tab:hover { color: var(--navy); }
.tab.on { color: var(--navy); border-color: var(--amber); font-weight: 600; }
.tab.dis { opacity: .5; }
tr.row { cursor: pointer; }
tr.row:hover td { background: #eef3f7; }
tr.row.on td { background: var(--acb); }
td.nowrap { white-space: nowrap; }
/* One line per row (decision 78) */
.one { display: inline-block; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.more { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 20px; background: var(--acb); color: var(--navy);
  font-size: 12px; font-weight: 700; vertical-align: middle; cursor: pointer; }
.q td { white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--acb); color: var(--navy); border-radius: 16px; padding: 2px 10px; font-weight: 500; }
.svc-line { margin-bottom: 4px; }
.un-name { font-weight: 600; font-size: 15px; color: var(--navy); margin-bottom: 2px; }
.seg.wrap { flex-wrap: wrap; }
@media (max-width: 1100px) {
  .split { flex-direction: column; }
  .panel { width: 100%; position: static; max-height: none; }
}

/* Case panel, Stage 3b (prototype v19, decisions 62, 64) */
.pacts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 10px; }
td.tcell { cursor: pointer; }
td.tcell:hover .chip { outline: 2px solid #9fb1c0; }
.task { border-bottom: 1px solid var(--bd); transition: background .15s; }
.th { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 10px 2px; min-height: 44px;
  background: none; border: 0; font: inherit; color: var(--tx); text-align: left; cursor: pointer; }
.th small { display: block; color: var(--mu); font-size: 12px; font-weight: 400; }
.th:hover { background: #f6f9fb; }
.task.open { background: #fff7e8; box-shadow: inset 4px 0 0 var(--amber); border-bottom-color: #f3d9a8; }
.task.open .th { padding-left: 14px; font-weight: 600; color: var(--navy); }
.task.open .th:hover { background: transparent; }
.td { background: var(--bg); border-radius: 10px; padding: 12px; margin: 0 0 10px; display: grid; gap: 10px; }
.task.open .td { background: #fff; margin: 0 10px 12px 14px; border: 1px solid #f3d9a8; }
.td label, .td .flabel { display: block; font-size: 12px; color: var(--mu); margin-bottom: 3px; }
.td .fld { margin: 0; }
.who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.who-list { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.btn.ghost { border-color: transparent; color: var(--mu); }
.btn.ghost:hover { background: #eef3f7; color: var(--navy); }
.ticks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.tick { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; color: var(--tx); font-size: 14px; }
.tick input { width: 18px; height: 18px; accent-color: var(--navy); }
.hi { padding: 9px 0; border-bottom: 1px solid var(--bd); }
.hi small { color: var(--mu); display: block; font-size: 12px; margin-top: 2px; }
.hi.dim { opacity: .6; }
/* Calendar (Stage 4c, prototype) */
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.cal-nav b { min-width: 150px; text-align: center; color: var(--navy); }
.cg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; max-width: 960px; }
.cw { font-size: 12px; color: var(--mu); text-align: center; padding: 4px 0; }
.cd { min-height: 72px; background: #fff; border: 1px solid var(--bd); border-radius: 10px; padding: 4px 6px; cursor: pointer; font: inherit;
  font-size: 12px; color: var(--tx); text-align: left; overflow: hidden; display: flex; flex-direction: column; align-items: stretch; }
.cd:hover { background: #eef3f7; }
.cd.t { border-color: var(--amber); border-width: 2px; }
.cd.s { background: var(--acb); }
.cd b { font-size: 13px; }
.pill { display: block; margin-top: 3px; padding: 0 5px; border-radius: 4px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa { background: var(--gnb); color: var(--gn); } .pi { background: var(--acb); color: var(--navy); }
.chip.iv-chip { background: var(--acb); color: var(--navy); }
.cal-dh { margin: 16px 0 4px; font-size: 14px; }
.cal-note { margin-top: 12px; max-width: 960px; }
@media (max-width: 600px) { .cd { min-height: 54px; padding: 3px; } .pill { font-size: 10px; } }
.iv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; max-width: 520px; }
.ivf input[type=text], .ivf input[type=email], .ivf input[type=date], .ivf input[type=time], .ivf select.sel { max-width: 520px; }
input[type=time] { width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid #7a8e9f; border-radius: 10px; font: inherit; color: var(--tx); background: #fff; }
.note-x { white-space: pre-wrap; overflow-wrap: anywhere; }
.acts2 { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.sub-h { margin: 16px 0 8px; font-size: 14px; }
.lks { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.lk { display: inline-flex; align-items: center; gap: 4px; background: var(--acb); border-radius: 16px; padding: 3px 6px 3px 12px; font-size: 13px; }
.lk a { text-decoration: none; font-weight: 600; }
.lk small { color: var(--mu); font-weight: 400; }
.lk button { border: 0; background: none; color: var(--mu); cursor: pointer; padding: 2px 6px; font: inherit; line-height: 1; min-height: 28px; }
.lk button:hover { color: var(--tx); }
select.sel, textarea, input[type=date], input[type=url] { width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid #7a8e9f;
  border-radius: 10px; font: inherit; color: var(--tx); background: #fff; }
textarea { resize: vertical; }
select:disabled, input:disabled, textarea:disabled { background: #f1f4f6; color: var(--mu); }
select:focus, textarea:focus { outline: 2px solid var(--navy); outline-offset: 1px; box-shadow: 0 0 0 4px rgba(250,162,28,.4); }

/* Saved · Undo bar (decision 64): white, green mark, solid amber Undo */
.ub { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 16px); opacity: 0;
  pointer-events: none; display: flex; align-items: center; gap: 12px; background: #fff; color: var(--tx); border: 1px solid var(--bd);
  border-left: 6px solid var(--gn); border-radius: 12px; padding: 10px 10px 10px 14px; box-shadow: 0 10px 30px rgba(19,51,72,.25);
  z-index: 25; max-width: calc(100% - 32px); transition: opacity .15s, transform .15s; }
.ub.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.ub-i { width: 24px; height: 24px; border-radius: 50%; background: var(--gnb); color: var(--gn); display: flex; align-items: center;
  justify-content: center; font-weight: 700; flex: none; }
.ub-i.u { background: var(--amb); color: var(--am); }
.ub-m { font-size: 14px; font-weight: 500; }
.ub-b { background: var(--amber); color: var(--navy); border: 2px solid var(--amber); border-radius: 8px; min-height: 38px; padding: 0 18px;
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; flex: none; }
.ub-b:hover { background: var(--amberh); border-color: var(--amberh); }
.ub-b:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.ub-s { font-size: 12px; color: var(--mu); min-width: 22px; flex: none; }
.ub-x { background: none; border: 0; color: var(--mu); font-size: 20px; cursor: pointer; padding: 0 4px; flex: none; min-height: 32px; }
@media (max-width: 600px) { .ub { left: 12px; right: 12px; transform: translateY(16px); flex-wrap: wrap; } .ub.on { transform: none; } }

/* Forms */
.fld { margin-bottom: 12px; }
.fld label, .flabel { display: block; font-size: 12px; color: var(--mu); margin-bottom: 3px; }
input[type=email], input[type=text], input[type=number] { width: 100%; max-width: 420px; min-height: 40px; padding: 6px 10px; border: 1px solid #7a8e9f;
  border-radius: 10px; font: inherit; color: var(--tx); background: #fff; }
.seg { display: flex; gap: 8px; }

/* Confirmation window (decision 63) */
.cfm-ov { position: fixed; inset: 0; background: rgba(19,51,72,.45); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.cfm { background: #fff; border-radius: 12px; max-width: 400px; width: 100%; padding: 18px 20px; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.cfm-t { font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.cfm p { margin: 0 0 8px; overflow-wrap: anywhere; }
.cfm-a { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; max-width: 90%; z-index: 30; }

/* Phones and small tablets */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; align-items: center; gap: 4px; padding: 8px; }
  .brand > span:last-child, .nav .soon { display: none; }
  .lab { font-size: 0; padding: 0; margin: 0 4px; border: 0; align-self: stretch; min-width: 1px; background: rgba(255,255,255,.22); }
  .brand { padding: 0 6px 0 0; }
  .nav { white-space: nowrap; border-radius: 8px; }
  .nav.on { box-shadow: inset 0 -3px 0 var(--amber); }
  .me { margin: 0 0 0 auto; padding: 0 0 0 8px; border: 0; border-left: 1px solid rgba(255,255,255,.22); border-radius: 0; background: none; display: flex; align-items: center; gap: 6px; }
  .me-n, .me-e { display: none; }
  .me .btn { margin-top: 0; }
  .list { padding: 16px; }
  td.acts { white-space: normal; }
  td.acts .btn { margin: 3px 0 3px 6px; }
}

/* Phones: each account becomes a card instead of a cramped table row */
@media (max-width: 600px) {
  .tbl { border: 0; background: transparent; }
  .tbl table, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl tr { background: #fff; border: 1px solid var(--bd); border-radius: 10px; margin-bottom: 10px; padding: 4px 0; }
  .tbl tbody tr:nth-child(even) td { background: transparent; }
  .tbl td { border: 0; padding: 6px 14px; }
  .tbl td:nth-child(2), .tbl td:nth-child(3) { display: inline-block; width: auto; padding-right: 0; }
  td.acts { text-align: left; }
  td.acts .btn { margin: 4px 6px 4px 0; }
  td.acts .btn + .btn { margin-left: 0; }
}

/* Dashboard (Stage 5a, decisions 52, 62): number cards with a thin top line
   and a colored number for attention cards; the selected card gets a navy outline. */
.dg { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.dc { position: relative; display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: var(--sf);
  border: 1px solid var(--bd); border-radius: 10px; padding: 12px 14px 10px; cursor: pointer; color: var(--tx); font: inherit; overflow: hidden; }
.dc:hover { border-color: #9fb1c0; }
.dc .big { font-size: 26px; font-weight: 600; line-height: 1.2; color: var(--navy); }
.dc.t-rd { box-shadow: inset 0 3px 0 #c0392b; } .dc.t-rd .big { color: var(--rd); }
.dc.t-am { box-shadow: inset 0 3px 0 var(--amber); } .dc.t-am .big { color: var(--am); }
.dc.s { background: #eef3f7; border-color: var(--navy); outline: 1px solid var(--navy); }
.sec.wide { max-width: none; }
.dg2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 14px; align-items: start; }
.dg2 .sec { max-width: none; margin-top: 0; }
.qbar { display: block; text-decoration: none; color: var(--tx); padding: 4px 0; }
.qbar:hover b, .qbar:hover span span:first-child { color: var(--navy); text-decoration: underline; }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--navy); margin: 4px 0 4px; }

/* Audit log (Stage 5c) */
.au-f { max-width: 760px; }
table.au td:first-child { white-space: nowrap; }

/* Settings (Stage 5d) */
.set-list { max-height: 420px; overflow: auto; border-top: 1px solid var(--bd); }
.set-svc .row-between.wrap { flex-wrap: wrap; gap: 8px; }
.svc-tasks { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.btn.xs { min-height: 28px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.set-find { align-items: flex-end; gap: 12px; }
.set-find .fld { flex: 1; min-width: 220px; }
.set-svc .svc-n { min-width: 200px; flex: 1; }
.set-qf { margin-top: 10px; }
.set-cols-l { margin-top: 12px; }
input.num { width: 110px; }
#ag-new { max-width: 320px; }

/* My work on the Dashboard (decision 86) */
.my-work h3 .hint { font-weight: 400; margin-left: 6px; }
.my-work .sub-h { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mu); margin: 12px 0 2px; }
.my-work .sub-h:first-of-type { margin-top: 4px; }
/* Archive old cases (decision 94) */
.rv-old { margin: 8px 0; max-height: 360px; }
.rv-old-row { display: block; cursor: pointer; padding-left: 28px; position: relative; }
.rv-old-row input { position: absolute; left: 4px; top: 12px; width: 18px; height: 18px; margin: 0; }

/* Closed Cases and Credit: find by TID or name, Show older (decision 96) */
.qfind { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; max-width: 520px; }
.qfind input { flex: 1; min-width: 0; }
.more-row { margin-top: 12px; }
