/* Toyota Cyprus demo dashboard. Tokens from design-studio
   projects/2026-10-toyota-dashboard/design-handoff/tokens.css */
@import url("fonts/fonts.css");

:root {
  --red: #d40605;
  --ground: #f5f5f5;
  --card: #ffffff;
  --line: #e4e4e4;
  --text: #282830;
  --text-2: #585858;
  --ok: #127c1d;
  --hover: #fafafa;
  --scale: 1;
}
:root.tv { --scale: 1.1; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: calc(16px * var(--scale)); }
body { font-family: "Commissioner", system-ui, sans-serif; font-size: 1rem; line-height: 1.45;
  font-variant-numeric: tabular-nums; color: var(--text); background: var(--ground); }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.muted { color: var(--text-2); }

/* Sign in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin form { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.signin h1 { font-size: 1.625rem; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .875rem; font-weight: 500; color: var(--text-2); }
.field input { font: inherit; font-size: 1rem; font-weight: 400; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; min-height: 44px; padding: 10px 12px; background: var(--card); }
.field input:focus-visible { outline: none; border-color: var(--text-2); }
.error { color: var(--red); font-size: .875rem; }

/* Shell */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.brand { padding: 0 8px 28px; }
.menu-btn { display: none; }
.nav a { display: block; position: relative; padding: 9px 12px; border-radius: 8px; color: var(--text);
  text-decoration: none; border: 1px solid transparent; }
.nav a[aria-current="page"], .nav a:focus-visible { background: var(--card); border-color: var(--line); outline: none; }
.nav a[aria-current="page"] { font-weight: 600; }
.nav a[aria-current="page"]::before, .nav a:focus-visible::before { content: ""; position: absolute; left: -1px;
  top: 9px; bottom: 9px; width: 3px; background: var(--red); }
.nav a.off { color: var(--text-2); pointer-events: none; }
.nav .h { font-size: .875rem; color: var(--text-2); padding: 20px 12px 6px; }
.side .foot { margin-top: auto; font-size: .875rem; color: var(--text-2); padding: 0 12px; display: flex; flex-direction: column; gap: 8px; }
.side .foot button { text-align: left; text-decoration: underline; min-height: 44px; }
/* Language switch: two quiet text buttons, the chosen one in text colour */
.langs { display: flex; gap: 4px; }
.side .foot .langs button, .langs button { text-decoration: none; min-height: 44px; padding: 0 8px; border-radius: 8px;
  font-size: .875rem; color: var(--text-2); border: 1px solid transparent; }
.side .foot .langs { margin-left: -8px; }
.langs button[aria-pressed="true"] { color: var(--text); font-weight: 600; background: var(--card); border-color: var(--line); }
.signin-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.main { padding: 36px 48px; display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.main.with-panel { padding-right: 448px; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
h1 { font-size: 1.625rem; font-weight: 600; line-height: 1.2; }
.live { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--text-2); margin-top: 4px; }
.live button { text-decoration: underline; color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.off { background: var(--text-2); }
.btn { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px;
  font-weight: 600; min-height: 44px; white-space: nowrap; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }

/* Tabs */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 10px 0 12px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; min-height: 44px; }
.tab[aria-selected="true"], .tab:focus-visible { color: var(--text); border-bottom-color: var(--red); outline: none; }
.tab i { font-style: normal; color: var(--text-2); margin-left: 6px; font-weight: 400; }

/* Filters */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.menu-wrap { position: relative; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; border: 1px solid var(--line);
  background: var(--card); border-radius: 8px; padding: 0 14px; font-size: .875rem; font-weight: 500; color: var(--text-2); }
.chip.set { color: var(--text); }
.clear { font-size: .875rem; color: var(--text-2); min-height: 44px; padding: 0 4px; }
.pop { position: absolute; top: 52px; left: 0; z-index: 20; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px; min-width: 200px; display: flex; flex-direction: column; }
.pop button { text-align: left; padding: 10px 12px; border-radius: 8px; min-height: 44px; }
.pop button:hover, .pop button[aria-checked="true"] { background: var(--ground); }
.pop button[aria-checked="true"] { font-weight: 600; }
.datepop { flex-direction: row; gap: 16px; padding: 16px; width: max-content; }
.datepop .q { display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); padding-right: 12px; min-width: 150px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 8px; }
.cal-head button { min-width: 44px; min-height: 44px; color: var(--text-2); }
.cal { display: grid; grid-template-columns: repeat(7, 40px); gap: 2px; font-size: .875rem; text-align: center; }
.cal b { font-weight: 500; color: var(--text-2); height: 28px; }
.cal button { height: 40px; padding: 0; text-align: center; border-radius: 8px; }
.cal button.sel { background: var(--text); color: #fff; font-weight: 600; }
.cal button.today { box-shadow: inset 0 -2px var(--red); }

/* Table */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.tbl { border-color: transparent; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .875rem; font-weight: 400; color: var(--text-2); padding: 12px 20px; border-bottom: 1px solid var(--line); }
td { padding: 0 20px; height: 58px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td, tbody tr.sel td { background: var(--hover); }
tbody tr.new td:first-child { box-shadow: inset 3px 0 var(--red); }
tbody tr.fade td:first-child { box-shadow: inset 3px 0 transparent; transition: box-shadow 1s ease; }
tbody tr.enter { animation: slide .25s ease-out; }
@keyframes slide { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.ph-branch { display: none; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; background: var(--ground); border: 1px solid var(--line); font-size: .875rem; }
.ok { color: var(--ok); font-weight: 500; }
.ans { color: var(--text-2); }
.empty { padding: 64px 24px; text-align: center; }
.empty h2 { font-size: 1.25rem; font-weight: 600; }
.skel { display: inline-block; height: 12px; border-radius: 6px; background: var(--line); }

/* Detail panel */
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; background: var(--card); border-left: 1px solid var(--line);
  padding: 24px; overflow: auto; display: flex; flex-direction: column; gap: 20px; z-index: 10; animation: panel .2s ease-out; }
@keyframes panel { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ph h2 { font-size: 1.25rem; font-weight: 600; }
.close { border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; font-size: .875rem; color: var(--text-2); min-height: 44px; }
.back { display: none; }
.facts { color: var(--text-2); margin-top: 2px; }
.sec h3 { font-size: .875rem; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.tl { list-style: none; display: flex; flex-direction: column; gap: 10px; border-left: 1px solid var(--line); margin-left: 3px; padding-left: 16px; }
.tl li { position: relative; display: flex; justify-content: space-between; gap: 12px; }
.tl li::before { content: ""; position: absolute; left: -20px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); }
.tl li span { color: var(--text-2); }
dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; }
dt { color: var(--text-2); }
.quote { color: var(--text-2); }
.toggle { display: flex; justify-content: space-between; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; min-height: 44px; }
.transcript { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-top: 8px; }
audio { width: 100%; }
.note { background: var(--ground); border-radius: 8px; padding: 14px 16px; }
.note b { display: block; font-size: .875rem; font-weight: 500; color: var(--text-2); margin-bottom: 4px; }
.path { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; font-size: .875rem; }
.path span { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; }
.path i { font-style: normal; color: var(--text-2); }

/* Overview */
.bars { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bl { padding: 20px 24px; }
.bl h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 14px; }
.bar { display: grid; grid-template-columns: 210px 1fr 40px; gap: 12px; align-items: center; height: 36px; }
.bar > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .t { height: 10px; border-radius: 6px; background: var(--line); position: relative; overflow: hidden; }
.bar .t u { position: absolute; inset: 0 auto 0 0; background: var(--text-2); border-radius: 6px; }
.bar.top .t u { background: var(--text); }
.bar b { font-weight: 600; text-align: right; }

/* Tablet */
@media (max-width: 1279px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; overflow-x: auto; }
  .brand { padding: 0 12px 0 0; }
  .nav { display: flex; gap: 4px; }
  .nav .h, .nav a.off, .side .foot span { display: none; }
  .side .foot { margin: 0 0 0 auto; flex-direction: row; }
  .main { padding: 24px; }
  .main.with-panel { padding-right: 24px; }
  .panel { width: 50%; }
  .bars { grid-template-columns: 1fr; }
}

/* Phone */
@media (max-width: 767px) {
  .main { padding: 16px; gap: 16px; }
  .side { flex-wrap: wrap; justify-content: space-between; padding: 8px 16px; }
  .brand { padding: 0; }
  .menu-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; }
  .side .nav, .side .foot { display: none; }
  .side.open .nav { display: flex; flex-direction: column; width: 100%; padding: 8px 0 4px; gap: 2px; }
  .side.open .nav a { padding: 12px; }
  .side.open .foot { display: flex; width: 100%; margin: 0; padding: 4px 0 8px; border-top: 1px solid var(--line); }
  .side.open .foot button { padding: 0 12px; text-decoration: none; color: var(--text); font-size: 1rem; }
  .side.open .foot .langs { margin-left: 0; }
  .side.open .foot .langs button { font-size: .875rem; color: var(--text-2); }
  .side.open .foot .langs button[aria-pressed="true"] { color: var(--text); }
  .top .btn.primary { padding: 8px 12px; font-size: .875rem; }
  .ph-branch { display: inline; }
  table, thead { display: block; }
  thead { display: none; }
  tbody { display: flex; flex-direction: column; }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 12px 16px; border-bottom: 1px solid var(--line); gap: 0 12px; }
  td.c-caller, td.c-reason { overflow: hidden; text-overflow: ellipsis; }
  tbody tr td { height: auto; padding: 0; border: 0; }
  tbody tr.new { box-shadow: inset 3px 0 var(--red); }
  tbody tr.new td:first-child { box-shadow: none; }
  td.c-time { grid-column: 2; grid-row: 1; text-align: right; font-size: .875rem; }
  td.c-caller { grid-column: 1; grid-row: 1; font-weight: 500; }
  td.c-reason { grid-column: 1; grid-row: 2; font-size: .875rem; color: var(--text-2); }
  td.c-reason .tag { background: none; border: 0; padding: 0; }
  td.c-branch, td.c-lang { display: none; }
  td.c-status { grid-column: 2; grid-row: 2; text-align: right; font-size: .875rem; }
  .panel { inset: 0; width: 100%; border: 0; }
  .close { display: none; }
  .back { display: flex; align-items: center; gap: 4px; min-height: 44px; min-width: 44px; font-size: 1rem; font-weight: 500; color: var(--text); margin-left: -6px; }
  .bar { grid-template-columns: 110px 1fr 32px; }
  .datepop { flex-direction: column; }
  .datepop .q { border-right: 0; padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  tbody tr.enter, .panel { animation: none; }
  tbody tr.fade td:first-child { transition: none; }
}
