/* Dial (dial.wirral.ai): the shell's look. Components (cards, buttons, the dialler, training) come from
   /dashboard/dashboard.css; this file is the sign-in, the side menu, the phone tab bar and the Today page.
   Accessibility: visible focus rings, 44px tap targets, colour is never the only signal, reduced motion honoured. */
.dial {
  --dial-ink: #0d1230;
  --dial-ink-2: #1a2150;
  --dial-glow: #fe81d1;
  background: var(--bg);
}
.dial :focus-visible { outline: 3px solid var(--dial-glow); outline-offset: 2px; border-radius: 10px; }
.btn--lg { padding: 13px 22px; font-size: 16px; border-radius: 14px; }

/* brand */
.dial-brand { display: flex; align-items: baseline; gap: 8px; color: #fff; font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.dial-brand small { font-size: 12px; font-weight: 600; opacity: 0.6; letter-spacing: 0; }
.dial-mark { color: var(--dial-glow); font-size: 20px; transform: translateY(1px); }
.dial-brand--big { color: var(--ink); font-size: 30px; }

/* sign in */
.dial-gate { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.dial-gate-art { position: relative; overflow: hidden; display: grid; place-items: center; background: radial-gradient(90% 70% at 30% 20%, #3a2a6e, transparent), linear-gradient(160deg, var(--dial-ink), #241a4f); color: #fff; padding: 40px; }
.dial-orb { position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffd2ee, var(--dial-glow) 45%, transparent 70%); filter: blur(10px); opacity: 0.55; animation: dial-float 9s ease-in-out infinite; }
.dial-gate-quote { position: relative; font-size: clamp(24px, 3vw, 36px); font-weight: 800; line-height: 1.25; letter-spacing: -0.02em; text-align: center; }
@keyframes dial-float { 50% { transform: translate(30px, -24px) scale(1.06); } }
.dial-gate-card { display: grid; align-content: center; gap: 16px; padding: 48px clamp(20px, 6vw, 72px); background: var(--card); }
.dial-gate-card h1 { margin: 0; font-size: 24px; }
.dial-gate-form { display: grid; gap: 10px; max-width: 380px; }
.dial-gate-form label { font-weight: 700; font-size: 14px; }
.dial-gate-form input[type='email'], .dial-gate-form input[type='text'] { padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); font: inherit; font-size: 16px; }
.dial-gate-form #otpCode { letter-spacing: 6px; font-size: 22px; font-weight: 700; }
.dial-gate .gate-link { justify-self: start; min-height: 44px; }

/* app layout */
.dial-app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.dial-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 14px; background: linear-gradient(180deg, var(--dial-ink), var(--dial-ink-2)); color: #fff; }
.dial-nav { display: grid; gap: 4px; }
.dial-nav-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 12px; background: none; color: rgba(255, 255, 255, 0.78); font: inherit; font-size: 15px; text-align: left; cursor: pointer; transition: background 0.15s, color 0.15s; }
.dial-nav-item span { width: 24px; text-align: center; font-size: 18px; }
.dial-nav-item b { font-weight: 600; }
.dial-nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.dial-nav-item.is-on { background: rgba(254, 129, 209, 0.16); color: #fff; box-shadow: inset 3px 0 0 var(--dial-glow); }
.dial-me { margin-top: auto; display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); font-size: 13px; }
.dial-me b { display: block; font-size: 14px; }
.dial-me small { opacity: 0.65; }
.dial-me .gate-link, .dial-me-link { color: rgba(255, 255, 255, 0.85); justify-self: start; }
.dial-main { min-width: 0; padding: 22px clamp(14px, 3vw, 34px) 40px; }
.dial-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.dial-top h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.dial-tabbar { display: none; }
/* The dialler's own tabs live in Dial's menu instead. */
.dial .crm-tabs { display: none; }

/* Today */
.dial-hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 24px 26px; margin-bottom: 16px; border-radius: 24px; color: #fff; background: radial-gradient(110% 140% at 100% 0%, rgba(254, 129, 209, 0.5), transparent 55%), linear-gradient(135deg, var(--dial-ink), #2a2f6e); box-shadow: var(--shadow); }
.dial-hello h2 { margin: 2px 0 6px; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.02em; }
.dial-hello p { margin: 0; opacity: 0.9; max-width: 560px; }
.dial-date { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.7 !important; }
.dial-hello-cta { display: flex; flex-wrap: wrap; gap: 8px; }
.dial-hello .btn:not(.btn--primary) { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.dial-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-bottom: 14px; }
.dial-card { display: flex; flex-direction: column; }
.dial-card > .card-body { flex: 1; }
.dial-card--wide { grid-column: 1 / -1; }
.dial-card .card-body > p { margin: 8px 0 12px; }
.dial-rings { display: flex; justify-content: space-around; gap: 8px; padding: 14px; }
.dial-ring { position: relative; display: grid; justify-items: center; gap: 2px; width: 96px; }
.dial-ring svg { width: 88px; height: 88px; transform: rotate(-90deg); }
.dial-ring circle { fill: none; stroke-width: 8; }
.dial-ring-bg { stroke: var(--line); }
.dial-ring-fg { stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.dial-ring b { position: absolute; top: 28px; font-size: 22px; }
.dial-ring b small { font-size: 12px; color: var(--muted); }
.dial-ring span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.dial-warm { display: flex; gap: 10px; }
.dial-warm i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px dashed var(--line); font-style: normal; font-weight: 800; color: var(--muted); }
.dial-warm i.is-on { border: 0; background: #2bb673; color: #fff; }
.dial-big { margin: 4px 0 !important; font-size: 40px; font-weight: 800; letter-spacing: -0.03em; }
.dial-big small { font-size: 16px; color: var(--muted); }
.dial-bar { position: relative; height: 12px; border-radius: 8px; background: var(--line); }
.dial-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #8b93c9, var(--dial-glow)); }
.dial-bar em { position: absolute; top: -6px; transform: translateX(-50%); font-style: normal; font-size: 16px; }
.dial-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dial-board li { display: grid; grid-template-columns: 32px 1fr; gap: 0 8px; padding: 8px 10px; border-radius: 12px; }
.dial-board li.is-me { background: #fdf2fa; }
.dial-board span { grid-row: span 2; font-size: 20px; text-align: center; }
.dial-board small { color: var(--muted); }

/* phone */
@media (max-width: 860px) {
  .dial-gate { grid-template-columns: 1fr; }
  .dial-gate-art { min-height: 180px; padding: 24px; }
  .dial-orb { width: 260px; height: 260px; }
  .dial-app { grid-template-columns: minmax(0, 1fr); }
  .dial-side { position: static; height: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 16px; }
  .dial-side .dial-nav { display: none; }
  .dial-me { margin: 0; padding: 6px 10px; grid-auto-flow: column; align-items: center; }
  .dial-me > div, .dial-me-link { display: none; }
  .dial-main { padding: 16px 16px 96px; }
  .dial-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 2px; overflow-x: auto; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--dial-ink); scrollbar-width: none; }
  .dial-tabbar .dial-nav-item { flex: 1 0 74px; flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11.5px; text-align: center; }
  .dial-tabbar .dial-nav-item.is-on { box-shadow: inset 0 3px 0 var(--dial-glow); }
  .dial-hello { padding: 18px; }
  .dial-hello-cta { width: 100%; }
  .dial-hello-cta .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .dial-orb { animation: none; }
  .dial-ring-fg { transition: none; }
}

/* Flags */
.dial-seg { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.dial-seg button { min-height: 40px; padding: 6px 14px; border: 0; border-radius: 10px; background: none; font-weight: 600; color: var(--ink); }
.dial-seg button.is-on { background: var(--dial-ink); color: #fff; }
.dial-flag-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.dial-flag-chip { display: grid; gap: 2px; justify-items: start; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--ink); text-align: left; }
.dial-flag-chip b { font-size: 28px; line-height: 1; }
.dial-flag-chip--high b { color: #b42318; }
.dial-flag-chip--medium b { color: #b45309; }
.dial-flag-chip--low b { color: #8a6d00; }
.dial-flag-chip.is-on { border-color: var(--dial-ink); box-shadow: var(--shadow); }
.dial-flag-tools { flex-wrap: wrap; gap: 12px; justify-content: flex-start; }
.dial-flag-tools label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.dial-flag-tools select { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); font: inherit; }
.dial-check input { width: 18px; height: 18px; }
.dial-flags { list-style: none; margin: 0; padding: 0; }
.dial-flag { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-top: 1px solid var(--line); border-left: 4px solid transparent; }
.dial-flag--high { border-left-color: #d92d20; }
.dial-flag--medium { border-left-color: #f79009; }
.dial-flag--low { border-left-color: #fdb022; }
.dial-flag.is-checked { opacity: 0.65; }
.dial-flag-sev { font-size: 18px; line-height: 1.4; }
.dial-flag-main { flex: 1; min-width: 0; }
.dial-flag-main p { margin: 0 0 3px; }
.dial-flag-title { font-size: 15px; }
.dial-flag-why { font-size: 13.5px; }
.dial-flag-done { color: #12805a; font-weight: 600; font-size: 13px; }
.dial-flag-clear { margin: 0; font-weight: 700; color: #12805a; }
@media (max-width: 860px) {
  .dial-flag-sum { grid-template-columns: 1fr; }
  .dial-flag { flex-wrap: wrap; }
}

.dial-gdpr { display: grid; gap: 8px; max-width: 420px; margin: 12px 0; }
.dial-gdpr label { font-weight: 700; }
.dial-gdpr input { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); font: inherit; font-size: 16px; }
.dial-gdpr-help { margin-top: 10px; }
.dial-gdpr-help summary { cursor: pointer; font-weight: 600; min-height: 32px; }

/* Performance */
.dial-linkbtn { border: 0; background: none; padding: 6px 0; min-height: 36px; font: inherit; font-weight: 700; color: var(--accent); text-decoration: underline; cursor: pointer; }
.dial .kpis { margin-bottom: 14px; }
.dial-chart { display: block; width: 100%; height: auto; }
.dial-chart text { font-size: 9px; fill: var(--muted); }
.dial-chart .c1, .dial-legend .c1 { fill: #b8c2f2; color: #8b93c9; }
.dial-chart .c2, .dial-legend .c2 { fill: #fe81d1; color: #fe81d1; }
.dial-chart .c3, .dial-legend .c3 { fill: #2bb673; color: #2bb673; }
.dial-legend { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.dial-hours { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.dial-hours span { display: grid; gap: 2px; text-align: center; }
.dial-hours i { display: block; height: 36px; border-radius: 6px; background: rgba(254, 129, 209, calc(0.08 + var(--v) * 0.92)); border: 1px solid var(--line); }
.dial-hours small { font-size: 10.5px; color: var(--muted); }
.dial-notes { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dial-transcript { max-height: 320px; overflow-y: auto; padding: 8px 12px; background: var(--bg); border-radius: 12px; }
.dial-transcript p { margin: 4px 0; }
/* Tidy spacing: no orphan tile on its own row, no dead space at the bottom of cards */
.dial .kpis > .kpi:last-child:nth-child(odd) { grid-column: auto; }
.dial-card .card-body > :last-child { margin-bottom: 0; }
.dial-card .card-body > :first-child { margin-top: 0; }
@media (max-width: 860px) {
  .dial .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dial .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* Recent calls as stacked rows, not a sideways-scrolling table */
  .dial-calls thead { display: none; }
  .dial-calls, .dial-calls tbody, .dial-calls tr, .dial-calls td { display: block; width: 100%; }
  .dial-calls tr { padding: 10px 16px; border-top: 1px solid var(--line); }
  .dial-calls td { padding: 2px 0; border: 0; text-align: left !important; }
  .dial-calls td.dial-notes { white-space: normal; max-width: none; }
  .dial-calls td:empty { display: none; }
}
