/* Portal de suporte INFOi9: "Órbita"
   Layout: barra azul-noite com o logótipo negativo e um traço em gradiente; o painel abre com a bolsa de horas
   num bloco escuro com a órbita do logótipo. Tipos: Exo 2 itálico (títulos e números), Saira (texto). */
@font-face { font-family: "Exo 2"; font-style: italic; font-weight: 600 800; font-display: swap;
  src: url("../fonts/exo2-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Exo 2"; font-style: italic; font-weight: 600 800; font-display: swap;
  src: url("../fonts/exo2-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Saira"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/saira-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Saira"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/saira-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

.hd-app {
  /* marca (do logótipo) */
  --blue-1: #0a8cff;          /* azul claro do gradiente */
  --blue-2: #0047d6;          /* azul profundo do gradiente */
  --grad: linear-gradient(115deg, var(--blue-1), var(--blue-2));
  --navy: #0b1526;            /* azul-noite das letras INFO */
  --navy-2: #13223a;
  --silver: #a7b1bd;          /* prata da órbita */
  /* interface */
  --brand: #0a6cf0;
  --brand-strong: #0047d6;
  --brand-soft: #e6f0ff;
  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-2: #eaeff5;
  --line: #d8e0ea;
  --fg: #0f1b2d;
  --muted: #5a6b80;
  --ok: #138a5e;  --ok-soft: #e0f4ea;
  --warn: #a96300; --warn-soft: #fcefd9;
  --bad: #cc2f3b; --bad-soft: #fde6e8;
  --info: #0a6cf0; --info-soft: #e6f0ff;
  --idle: #66717f; --idle-soft: #eceff3;
  --cell-empty: #dbe3ee;
  --shadow: 0 1px 2px rgba(11, 21, 38, .06), 0 8px 24px rgba(11, 21, 38, .07);
  --font-display: "Exo 2", "Saira", "Segoe UI", system-ui, sans-serif;
  --font-body: "Saira", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Saira", ui-monospace, Menlo, monospace;
  --radius: 12px;
  --slant: -12deg;
}
@media (prefers-color-scheme: dark) {
  .hd-app {
    --brand: #3b9bff; --brand-strong: #6cb4ff; --brand-soft: #0f2a4d;
    --bg: #070e1a; --surface: #0f1b2d; --surface-2: #16253b; --line: #213350;
    --fg: #e7eef8; --muted: #93a4ba;
    --ok: #3fcf95; --ok-soft: #0f3326; --warn: #f0ad4e; --warn-soft: #3a2a10;
    --bad: #ff6b74; --bad-soft: #3f1519; --info: #6cb4ff; --info-soft: #0f2a4d;
    --idle: #9aa7b6; --idle-soft: #1c2a3f; --cell-empty: #1f3150;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
.hd-app[data-bs-theme="dark"] .hd-app {
  --brand: #3b9bff; --brand-strong: #6cb4ff; --brand-soft: #0f2a4d;
  --bg: #070e1a; --surface: #0f1b2d; --surface-2: #16253b; --line: #213350;
  --fg: #e7eef8; --muted: #93a4ba;
  --ok: #3fcf95; --ok-soft: #0f3326; --warn: #f0ad4e; --warn-soft: #3a2a10;
  --bad: #ff6b74; --bad-soft: #3f1519; --info: #6cb4ff; --info-soft: #0f2a4d;
  --idle: #9aa7b6; --idle-soft: #1c2a3f; --cell-empty: #1f3150;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  color-scheme: dark;
}

.hd-app, .hd-app * { box-sizing: border-box; }
.hd-app, .hd-app { min-height: 100%; }
.hd-app {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
.hd-app h1, .hd-app h2, .hd-app h3 { font-family: var(--font-display); font-style: italic; line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -.005em; }
.hd-app h1 { font-size: 1.85rem; font-weight: 800; }
.hd-app h2 { font-size: 1.15rem; font-weight: 700; }
.hd-app h3 { font-size: 1rem; font-weight: 700; }
.hd-app p { margin: 0; }
.hd-app a { color: var(--brand); }
.hd-app button, .hd-app input, .hd-app select, .hd-app textarea { font: inherit; color: inherit; }
.hd-app :focus-visible { outline: 2px solid var(--blue-1); outline-offset: 2px; }
.hd-app .mono, .hd-app .ref { font-variant-numeric: tabular-nums; }
.hd-app .ref { font-size: .78rem; color: var(--muted); letter-spacing: .08em; font-weight: 600; text-transform: uppercase; }
.hd-app .muted { color: var(--muted); }
.hd-app .num { font-variant-numeric: tabular-nums; }
.hd-app .wrap { max-width: 1200px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- barra superior ---------- */
.hd-app .topbar {
  background: var(--navy); color: #fff; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  box-shadow: inset 0 -3px 0 transparent;
}
.hd-app .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--silver) 0%, var(--blue-1) 35%, var(--blue-2) 100%); }
.hd-app .topbar .wrap { display: flex; align-items: center; gap: 28px; min-height: 70px; flex-wrap: wrap; padding-block: 10px 13px; }
.hd-app .hd-logo { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.hd-app .logo-img { display: block; height: 40px; width: auto; max-width: none; }
.hd-app .wordmark { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 1.5rem; letter-spacing: .01em; color: inherit; }
.hd-app .wordmark b { color: var(--blue-1); font-weight: 800; }
.hd-app .logo-sub { font-family: var(--font-display); font-style: italic; font-size: .72rem; line-height: 1.25; text-transform: uppercase; letter-spacing: .14em; color: var(--silver); font-weight: 700; max-width: 9em; border-left: 1px solid rgba(255,255,255,.2); padding-left: 12px; }
.hd-app .topbar .logo-sub { display: none; }
.hd-app .hd-nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.hd-app .hd-nav a { position: relative; isolation: isolate; color: #c6d2e2; text-decoration: none; padding: 8px 14px; font-weight: 600; font-size: .92rem; letter-spacing: .01em; }
.hd-app .hd-nav a::before { content: ""; position: absolute; inset: 2px 0; z-index: -1; border-radius: 5px; transform: skewX(var(--slant)); background: transparent; transition: background .15s; }
.hd-app .hd-nav a:hover { color: #fff; }
.hd-app .hd-nav a:hover::before { background: rgba(255,255,255,.08); }
.hd-app .hd-nav a[aria-current="page"] { color: #fff; }
.hd-app .hd-nav a[aria-current="page"]::before { background: var(--grad); box-shadow: 0 4px 14px rgba(10, 140, 255, .35); }
.hd-app .who { display: flex; align-items: center; gap: 12px; font-size: .85rem; color: var(--silver); line-height: 1.3; }
.hd-app .who strong { color: #fff; display: block; font-weight: 600; }
.hd-app .who .hd-btn { border-color: rgba(255,255,255,.22); color: #fff; background: transparent; }
.hd-app .who .hd-btn:hover { border-color: var(--blue-1); }
/* Computador: o menu do cliente tem 6 entradas e deve caber numa linha ao lado do nome. */
@media (min-width: 861px) {
  .hd-app .topbar .wrap { gap: 18px; }
  .hd-app .hd-nav a { padding: 8px 10px; }
  .hd-app .who > span { max-width: 210px; }
  .hd-app .who strong, .hd-app .who .who-co { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* Portáteis pequenos e tablets: o menu passa para uma linha própria, que desliza se for preciso. */
@media (max-width: 1180px) {
  .hd-app .who { margin-left: auto; }
  .hd-app .hd-nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -6px; padding: 0 6px 2px; scrollbar-width: none; }
  .hd-app .hd-nav a { white-space: nowrap; }
}
@media (max-width: 860px) {
  .hd-app .topbar .wrap { gap: 8px 16px; min-height: 60px; }
  .hd-app .logo-img { height: 32px; }
  .hd-app .who { margin-left: auto; }
  .hd-app .who > span { display: none; }
  .hd-app .hd-nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -6px; padding: 0 6px 2px; scrollbar-width: none; }
  .hd-app .hd-nav a { white-space: nowrap; }
}
.hd-app .demo-banner { background: var(--warn-soft); color: var(--warn); font-size: .82rem; font-weight: 600; }
.hd-app .demo-banner .wrap { padding-block: 6px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.hd-app .demo-banner button { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font-weight: 600; padding: 0; }

.hd-app main { padding-block: 32px 72px; }
.hd-app .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.hd-app .page-head p { color: var(--muted); margin-top: 6px; }
.hd-app .eyebrow { font-family: var(--font-display); font-style: italic; font-size: .75rem; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; color: var(--brand); margin-bottom: 6px; }

/* ---------- botões e formulários ---------- */
.hd-app .hd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; color: var(--fg); white-space: nowrap;
  transition: border-color .15s, box-shadow .15s, filter .15s;
}
.hd-app .hd-btn:hover { border-color: var(--brand); }
.hd-app .hd-btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(0, 71, 214, .25); }
.hd-app .hd-btn.primary:hover { filter: brightness(1.08); box-shadow: 0 6px 18px rgba(0, 71, 214, .35); }
.hd-app .hd-btn.sm { padding: 5px 12px; font-size: .84rem; }
.hd-app .hd-btn.danger { color: var(--bad); }
.hd-app .hd-btn:disabled { opacity: .6; cursor: progress; }
.hd-app .hd-btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.hd-app .form { display: grid; gap: 16px; }
.hd-app .form .hd-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.hd-app .field { display: grid; gap: 6px; min-width: 0; }
.hd-app .field label, .hd-app .label { font-size: .78rem; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.hd-app .field .hint { font-size: .82rem; color: var(--muted); }
.hd-app input[type=text], .hd-app input[type=email], .hd-app input[type=password], .hd-app input[type=date], .hd-app input[type=datetime-local], .hd-app input[type=number], .hd-app input[type=search], .hd-app select, .hd-app textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.hd-app textarea { min-height: 120px; resize: vertical; }
.hd-app input:focus, .hd-app select:focus, .hd-app textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.hd-app .check { display: flex; gap: 8px; align-items: center; font-size: .92rem; }
.hd-app .ok-msg { background: var(--ok-soft); color: var(--ok); padding: 10px 12px; border-radius: 8px; font-size: .9rem; font-weight: 600; }
.hd-app .error-msg { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: 8px; font-size: .9rem; font-weight: 600; }

.hd-app .segmented { display: inline-grid; grid-auto-flow: column; background: var(--surface-2); border-radius: 10px; padding: 4px; gap: 4px; }
.hd-app .segmented a { text-decoration: none; }
.hd-app .segmented button, .hd-app .segmented a { border: 0; background: transparent; padding: 8px 16px; border-radius: 7px; font-weight: 600; cursor: pointer; color: var(--muted); }
.hd-app .segmented button[aria-pressed="true"], .hd-app .segmented a[aria-pressed="true"] { background: var(--grad); color: #fff; box-shadow: 0 3px 10px rgba(0, 71, 214, .25); }

/* ---------- superfícies ---------- */
.hd-app .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.hd-app .panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.hd-app .panel-head a { font-size: .86rem; font-weight: 600; text-decoration: none; }
.hd-app .grid { display: grid; gap: 20px; }
.hd-app .grid.two { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 900px) { .hd-app .grid.two { grid-template-columns: 1fr; } }

/* Bloco escuro com a órbita do logótipo: a bolsa de horas no painel. */
.hd-app .panel.hero {
  --surface: var(--navy); --fg: #eef3fa; --muted: #9fb0c6; --line: rgba(255,255,255,.12); --cell-empty: rgba(255,255,255,.12);
  --brand: #3b9bff; --brand-strong: #6cb4ff;
  position: relative; overflow: hidden; isolation: isolate; color: var(--fg); border: 0; padding: 28px;
  background: radial-gradient(120% 140% at 100% 0%, #16305a 0%, var(--navy) 55%);
}
.hd-app .panel.hero::before {
  content: ""; position: absolute; z-index: -1; right: -120px; top: -150px; width: 520px; height: 520px;
  background: url("../images/orbit.webp") center / contain no-repeat; opacity: .16; transform: rotate(-8deg);
}
.hd-app .panel.hero h2, .hd-app .panel.hero h3 { color: #fff; }

/* ---------- bolsa de horas ---------- */
.hd-app .hours { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 24px 48px; align-items: start; }
.hd-app .hours > * { min-width: 0; }
@media (max-width: 900px) { .hd-app .hours { grid-template-columns: minmax(0, 1fr); } }
.hd-app .hours-figures { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 16px; }
.hd-app .hd-figure .label { display: block; font-size: .72rem; letter-spacing: .14em; }
.hd-app .hd-figure .value { font-family: var(--font-display); font-style: italic; font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.05; }
.hd-app .hd-figure.remaining .value { background: linear-gradient(115deg, #5cb6ff, var(--blue-1) 45%, #3f7bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hd-app .hd-figure.low .value { background: none; color: var(--warn); }
.hd-app .hd-figure.over .value { background: none; color: var(--bad); }
.hd-app .cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(16px, 1fr)); gap: 5px; margin-top: 20px; max-width: 640px; padding-left: 4px; }
.hd-app .cell { height: 18px; border-radius: 3px; background: var(--cell-empty); transform: skewX(var(--slant)); }
.hd-app .cell.used { background: var(--grad); }
.hd-app .cell.over { background: var(--bad); }
.hd-app .legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-top: 12px; }
.hd-app .legend i { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; transform: skewX(var(--slant)); }
.hd-app .bar { height: 10px; border-radius: 5px; background: var(--cell-empty); overflow: hidden; margin-top: 18px; }
.hd-app .bar > span { display: block; height: 100%; background: var(--grad); border-radius: 5px; }
.hd-app .contract-meta { font-size: .86rem; color: var(--muted); }
.hd-app .hd-alert { padding: 10px 14px; border-radius: 8px; font-size: .9rem; font-weight: 600; margin-top: 16px; }
.hd-app .hd-alert.warn { background: var(--warn-soft); color: var(--warn); }
.hd-app .hd-alert.bad { background: var(--bad-soft); color: var(--bad); }
.hd-app .panel.hero .hd-alert.warn { background: rgba(240, 173, 78, .15); color: #ffc46b; }
.hd-app .panel.hero .hd-alert.bad { background: rgba(255, 107, 116, .15); color: #ff9aa1; }

.hd-app .chart-box { width: 100%; min-height: 170px; }
.hd-app .chart { display: block; max-width: 100%; }
.hd-app .chart text { fill: var(--muted); font: 13px var(--font-body); }
.hd-app .chart .val { fill: var(--fg); font-weight: 700; }
.hd-app .chart .grid-line { stroke: var(--line); stroke-width: 1; }
.hd-app .chart .b { fill: url(#hd-bar-grad); }
.hd-app .chart .b.cur { fill: url(#hd-bar-grad); filter: drop-shadow(0 0 6px rgba(10, 140, 255, .55)); }
.hd-app .chart .stop-1 { stop-color: var(--blue-1); }
.hd-app .chart .stop-2 { stop-color: var(--blue-2); }

/* ---------- KPIs ---------- */
.hd-app .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .hd-app .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hd-app .kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: inherit; display: grid; gap: 2px; transition: border-color .15s, box-shadow .15s; }
.hd-app a.kpi:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.hd-app .kpi .value { font-family: var(--font-display); font-style: italic; font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hd-app .kpi .label { font-size: .84rem; }

/* ---------- listas de pedidos ---------- */
.hd-app .filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.hd-app .filters input[type=search] { max-width: 280px; }
.hd-app .filters select { width: auto; }
.hd-app .tickets { display: grid; gap: 0; container-type: inline-size; }
.hd-app .trow {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) 136px 84px; gap: 14px; align-items: center;
  padding: 14px 6px; border-top: 1px solid var(--line); text-decoration: none; color: inherit;
}
.hd-app .trow:first-child { border-top: 0; }
.hd-app .trow:hover .t-title { color: var(--brand); }
.hd-app .t-title { font-weight: 600; overflow-wrap: anywhere; }
.hd-app .t-sub { font-size: .84rem; color: var(--muted); }
.hd-app .t-when { font-size: .84rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .hd-app .trow { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .hd-app .trow .ref { grid-column: 1; }
  .hd-app .trow .t-main { grid-column: 1 / -1; grid-row: 2; }
  .hd-app .trow .t-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .hd-app .trow .t-when { display: none; }
}
.hd-app .empty { padding: 28px 8px; text-align: center; color: var(--muted); }

.hd-app .pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.hd-app .pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hd-app .pill.aberto { background: var(--info-soft); color: var(--info); }
.hd-app .pill.em_curso { background: var(--brand-soft); color: var(--brand-strong); }
.hd-app .pill.aguarda_cliente { background: var(--warn-soft); color: var(--warn); }
.hd-app .pill.agendado { background: var(--info-soft); color: var(--info); }
.hd-app .pill.resolvido { background: var(--ok-soft); color: var(--ok); }
.hd-app .pill.fechado { background: var(--idle-soft); color: var(--idle); }
.hd-app .kind { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); }
.hd-app .prio-urgente, .hd-app .prio-alta { color: var(--bad); font-weight: 700; }

/* ---------- detalhe ---------- */
.hd-app .detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .hd-app .detail { grid-template-columns: 1fr; } }
.hd-app .facts { display: grid; gap: 12px; margin: 0; }
.hd-app .facts div { display: grid; gap: 2px; }
.hd-app .facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.hd-app .facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.hd-app .description { white-space: pre-wrap; overflow-wrap: anywhere; }
.hd-app .thread { display: grid; gap: 14px; margin-top: 8px; }
.hd-app .msg { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); }
.hd-app .msg.staff { background: var(--brand-soft); border-color: transparent; }
.hd-app .msg.internal { background: var(--warn-soft); border: 1px dashed var(--warn); }
.hd-app .msg header { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; color: var(--muted); margin-bottom: 4px; flex-wrap: wrap; }
.hd-app .msg header strong { color: var(--fg); }
.hd-app .msg p { white-space: pre-wrap; overflow-wrap: anywhere; }

.hd-app .table-wrap { overflow-x: auto; }
.hd-app table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.hd-app th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.hd-app td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.hd-app td.h { text-align: right; font-family: var(--font-display); font-style: italic; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hd-app th.h { text-align: right; }
.hd-app tfoot td { font-weight: 700; border-bottom: 0; }
.hd-app .tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 4px; background: var(--surface-2); color: var(--muted); margin-left: 6px; }

/* ---------- login ---------- */
.hd-app .login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.hd-app .login-side {
  background: radial-gradient(110% 90% at 85% 100%, #17346a 0%, var(--navy) 60%); color: #c9d5e5;
  padding: 48px max(48px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  position: relative; overflow: hidden; isolation: isolate;
}
.hd-app .login-side::after {
  content: ""; position: absolute; z-index: -1; right: -18%; bottom: -22%; width: 78%; aspect-ratio: 1;
  background: url("../images/orbit.webp") center / contain no-repeat; opacity: .28; transform: rotate(-10deg);
}
.hd-app .login-side .logo-img { height: 72px; }
.hd-app .login-side h1 { color: #fff; font-size: 2.7rem; max-width: 15ch; margin-top: 14px; line-height: 1.08; }
.hd-app .login-side h1 em { font-style: italic; background: linear-gradient(115deg, #5cb6ff, var(--blue-1) 50%, #3f7bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hd-app .login-side .tagline { font-family: var(--font-display); font-style: italic; color: var(--silver); text-transform: uppercase; letter-spacing: .2em; font-size: .8rem; font-weight: 700; }
.hd-app .login-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; max-width: 42ch; }
.hd-app .login-side li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.hd-app .login-side li span:first-child { font-family: var(--font-display); font-style: italic; font-weight: 800; color: var(--blue-1); font-size: 1rem; }
.hd-app .login-main { display: grid; place-items: center; padding: 40px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
.hd-app .login-card { width: 100%; max-width: 390px; display: grid; gap: 24px; }
.hd-app .login-card h2 { font-size: 1.7rem; font-weight: 800; }
.hd-app .login-card .mobile-logo { display: none; }
@media (max-width: 860px) { .hd-app .login { grid-template-columns: 1fr; } .hd-app .login-side { display: none; } }
/* Telemóvel: o logótipo negativo numa faixa azul-escura, grande e legível com o tema claro ou escuro do telefone. */
@media (max-width: 860px) {
  .hd-app .login-card .mobile-logo {
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
    padding: 22px 22px 18px; border-radius: var(--radius); color: #fff;
    background: radial-gradient(120% 140% at 100% 0%, rgba(10, 140, 255, .28), transparent 60%), var(--navy);
    border: 1px solid rgba(255,255,255,.08); border-bottom: 3px solid var(--blue-1);
    box-shadow: var(--shadow);
  }
  .hd-app .login-card .mobile-logo .logo-img { height: auto; width: min(100%, 290px); }
  .hd-app .login-card .mobile-logo .logo-sub { border-left: 0; padding-left: 0; max-width: none; color: var(--silver); font-size: .78rem; }
}
.hd-app .demo-accounts { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 8px; }
.hd-app .demo-accounts button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 12px; cursor: pointer; display: grid; }
.hd-app .demo-accounts button:hover { border-color: var(--brand); }
.hd-app .demo-accounts small { color: var(--muted); font-size: .8rem; }

/* ---------- avisos ---------- */
.hd-app .hd-toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 20;
  box-shadow: 0 10px 30px rgba(11, 21, 38, .35), inset 0 -3px 0 var(--blue-1); max-width: calc(100% - 32px);
}
.hd-app .hd-loading { padding: 40px 0; color: var(--muted); }
.hd-app .company-card { display: grid; gap: 10px; }
.hd-app .company-card .bar { margin-top: 4px; }
.hd-app .list-plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.hd-app .visit { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.hd-app .visit .day { background: var(--grad); color: #fff; border-radius: 10px; text-align: center; padding: 6px 0; font-family: var(--font-display); font-style: italic; line-height: 1.1; }
.hd-app .visit .day b { display: block; font-size: 1.4rem; font-weight: 800; }
.hd-app .visit .day small { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.hd-app details.panel summary { cursor: pointer; font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 1.05rem; }
.hd-app details.panel[open] summary { margin-bottom: 16px; }
@media (prefers-reduced-motion: no-preference) {
  .hd-app .cell.used { transition: background .3s; }
}

/* ---------- Conta: verificação em dois passos ---------- */
.hd-app .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hd-app .account-grid { align-items: start; }
.hd-app .code-input { font-family: var(--font-display); font-size: 1.4rem !important; letter-spacing: .3em; font-weight: 700; max-width: 260px; }
.hd-app .steps { margin: 12px 0 16px; padding-left: 20px; display: grid; gap: 12px; }
.hd-app .steps li::marker { font-family: var(--font-display); font-weight: 800; color: var(--brand); }
.hd-app .qr { width: 184px; max-width: 100%; margin: 10px 0 8px; padding: 8px; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.hd-app .qr svg { display: block; width: 100%; height: auto; }
.hd-app .secret span { white-space: nowrap; }
.hd-app .secret { color: var(--fg); font-weight: 600; }
.hd-app .backup-codes { list-style: none; padding: 0; margin: 14px 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.hd-app .backup-codes li { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; text-align: center; font-weight: 700; letter-spacing: .06em; }

/* ---------- Clientes: dados e utilizadores ---------- */
.hd-app .edit-company { margin-top: 12px; }
.hd-app .users-list { margin-top: 8px; display: grid; gap: 0; }
.hd-app .user-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.hd-app .user-row:first-child { border-top: 0; }
.hd-app .user-id { display: grid; gap: 2px; min-width: 0; }
.hd-app .user-id .mono { font-size: .82rem; overflow-wrap: anywhere; }
.hd-app .user-id .pill { justify-self: start; }
.hd-app .user-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hd-app .user-actions select { width: auto; padding: 6px 10px; }

/* ---------- Relatórios ---------- */
.hd-app .report-filters { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: end; }
.hd-app .period-nav { display: flex; align-items: center; gap: 10px; }
.hd-app .period-nav strong { font-family: var(--font-display); font-style: italic; font-size: 1.05rem; min-width: 0; text-align: center; }
.hd-app .report-dates { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.hd-app .report-dates .field { min-width: 150px; }
.hd-app .report-company { min-width: 240px; flex: 1 1 240px; max-width: 420px; }
.hd-app .report-kpis { margin-top: 20px; }
.hd-app .rtable td .t-sub { font-size: .8rem; }
.hd-app .rtable .ref { white-space: nowrap; }
@media (max-width: 640px) {
  .hd-app .report-filters { display: grid; }
  .hd-app .period-nav { justify-content: space-between; }
  .hd-app .report-company { max-width: none; }
  .hd-app .rtable thead { display: none; }
  .hd-app .rtable, .hd-app .rtable tbody, .hd-app .rtable tr, .hd-app .rtable td { display: block; }
  .hd-app .rtable tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .hd-app .rtable td { padding: 2px 0; border: 0; text-align: left !important; overflow-wrap: anywhere; }
  .hd-app .rtable td::before { content: attr(data-label); display: inline-block; min-width: 92px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
  .hd-app .user-actions { width: 100%; }
}

/* ---------- Telemóveis e tablets ---------- */
/* Registos de horas: em ecrãs estreitos cada linha passa a cartão, sem deslizar na horizontal. */
@media (max-width: 640px) {
  .hd-app .table-wrap:has(> table.entries) { overflow: visible; }
  .hd-app table.entries thead { display: none; }
  .hd-app table.entries, .hd-app table.entries tbody, .hd-app table.entries tfoot { display: block; }
  .hd-app table.entries tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .hd-app table.entries td { padding: 0; border: 0; min-width: 0; }
  .hd-app table.entries .c-date { grid-column: 1; grid-row: 1; font-weight: 700; }
  .hd-app table.entries td.h { grid-column: 2; grid-row: 1; text-align: right; }
  .hd-app table.entries .c-desc { grid-column: 1 / -1; overflow-wrap: anywhere; }
  .hd-app table.entries .c-ref, .hd-app table.entries .c-tech { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); }
  .hd-app table.entries .c-tech::before { content: "Técnico: "; }
  .hd-app table.entries .c-act { grid-column: 1 / -1; margin-top: 4px; }
  .hd-app table.entries tfoot tr { border-bottom: 0; }
}
/* Ecrãs táteis: letra de 16px nos campos (o Safari do iPhone não faz zoom ao tocar) e alvos de toque maiores. */
@media (pointer: coarse) {
  .hd-app input[type=text], .hd-app input[type=email], .hd-app input[type=password], .hd-app input[type=date], .hd-app input[type=datetime-local], .hd-app input[type=number], .hd-app input[type=search], .hd-app select, .hd-app textarea { font-size: 16px; }
  .hd-app .hd-btn.sm { min-height: 40px; padding-left: 14px; padding-right: 14px; }
  .hd-app .panel a:not(.hd-btn):not(.trow):not(.kpi):not(.visit), .hd-app .login-card a:not(.hd-btn), .hd-app .eyebrow a, .hd-app .hd-alert a { padding-top: 10px; padding-bottom: 10px; }
}
.hd-app { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.hd-app a, .hd-app button, .hd-app summary { -webkit-tap-highlight-color: rgba(10, 140, 255, .15); }

/* Listas de pedidos em colunas estreitas (por exemplo, metade do painel): mesma disposição do telemóvel. */
@container (max-width: 600px) {
  .hd-app .trow { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .hd-app .trow .ref { grid-column: 1; }
  .hd-app .trow .t-main { grid-column: 1 / -1; grid-row: 2; }
  .hd-app .trow .t-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .hd-app .trow .t-when { display: none; }
}

/* ---------- 1.4.0: administração ---------- */
.hd-app .pill.bad { background: var(--bad-soft); color: var(--bad); }
.hd-app .who .icon-btn { display: inline-grid; place-items: center; padding: 6px 8px; }
.hd-app .who .icon-btn[aria-current="page"] { background: var(--grad); border-color: transparent; }
.hd-app .attention { background: var(--warn-soft); color: var(--fg); border-left: 3px solid var(--warn); border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; font-size: .9rem; }
.hd-app .attention strong { color: var(--warn); }
.hd-app .attention ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.hd-app .attention-list li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.hd-app .attention-list li:last-child { border-bottom: 0; }

.hd-app .user-filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.hd-app .user-filters .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.hd-app .user-filters .segmented button { white-space: nowrap; }
.hd-app .user-filters .count { font-size: .78rem; opacity: .75; margin-left: 2px; }
.hd-app .user-filters .search { flex: 1 1 240px; max-width: 360px; }

.hd-app .ucards { list-style: none; margin: 0; padding: 0; }
.hd-app .ucard { border-top: 1px solid var(--line); padding: 14px 0; }
.hd-app .ucard:first-child { border-top: 0; }
.hd-app .ucard.off .ucard-id strong { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.hd-app .ucard-main { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, .9fr) auto; gap: 8px 18px; align-items: start; }
.hd-app .ucard-id { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; min-width: 0; }
.hd-app .ucard-id .mono { flex-basis: 100%; font-size: .85rem; overflow-wrap: anywhere; }
.hd-app .ucard-profile, .hd-app .ucard-last { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.hd-app .ucard-profile .label, .hd-app .ucard-last .label { font-size: .68rem; }
.hd-app .ucard-profile select { width: auto; padding: 6px 10px; }
.hd-app .ucard-sub { font-size: .82rem; color: var(--muted); }
.hd-app a.ucard-sub { color: var(--brand); text-decoration: none; overflow-wrap: anywhere; }
.hd-app .ucard-act { display: flex; gap: 8px; align-items: start; justify-content: flex-end; flex-wrap: wrap; }
.hd-app .ucard-act [aria-expanded="true"] { background: var(--surface-2); }
.hd-app .ucard-panel { grid-column: 1 / -1; background: var(--surface-2); border-radius: 10px; padding: 16px; display: grid; gap: 14px; margin-top: 4px; text-align: left; }
.hd-app .ucard-panel .form { max-width: 460px; gap: 10px; }
@media (max-width: 860px) {
  .hd-app .ucard-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hd-app .ucard-id { grid-column: 1 / -1; }
  .hd-app .ucard-act { grid-column: 1 / -1; justify-content: flex-start; }
}

.hd-app .tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.hd-app .tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; font-size: .95rem; }
.hd-app .tabs button:hover { color: var(--fg); }
.hd-app .tabs button[aria-current="page"] { color: var(--brand); border-bottom-color: var(--blue-1); }
.hd-app .settings-form { gap: 0; }
.hd-app .settings-form .panel { display: grid; gap: 12px; }
.hd-app .settings-form .panel h2 { font-size: 1.15rem; }
.hd-app .settings-form .panel h3 { font-size: .95rem; font-style: normal; font-family: var(--font-body); font-weight: 700; color: var(--muted); }
.hd-app .settings-form > .error-msg { margin-top: 14px; }
.hd-app .sticky-save { position: sticky; bottom: 0; padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--bg) 70%, transparent); margin-top: 6px; z-index: 2; }
.hd-app .check.toggle { align-items: flex-start; gap: 12px; padding: 6px 0; }
.hd-app .check.toggle input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--blue-1); }
.hd-app .check.toggle span { display: grid; gap: 2px; }
.hd-app .check.toggle .muted { font-size: .84rem; }
.hd-app .check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.hd-app .with-suffix { display: flex; align-items: center; gap: 10px; }
.hd-app .with-suffix input { max-width: 120px; }
.hd-app .with-suffix .muted { font-size: .9rem; }
.hd-app .radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.hd-app .radio-card { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 14px; cursor: pointer; }
.hd-app .radio-card input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--blue-1); }
.hd-app .radio-card span { display: grid; gap: 4px; }
.hd-app .radio-card .muted { font-size: .85rem; }
.hd-app .radio-card:has(input:checked) { border-color: var(--blue-1); box-shadow: 0 0 0 3px var(--brand-soft); }
.hd-app .inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.hd-app .inline-form .field { flex: 1 1 240px; max-width: 360px; }
.hd-app .inline-form .error-msg { flex-basis: 100%; }
.hd-app table.audit td { font-size: .88rem; vertical-align: top; }
.hd-app table.audit tr.warn-row td:nth-child(3) { color: var(--bad); font-weight: 600; }
/* O atributo hidden ganha sempre, mesmo em elementos com display próprio. */
.hd-app [hidden] { display: none !important; }

/* ---------- 1.5.0: lista e ficha de clientes ---------- */
.hd-app .crumb { margin: 0 0 6px; font-size: .9rem; }
.hd-app .crumb a { color: var(--muted); text-decoration: none; font-weight: 600; }
.hd-app .crumb a:hover { color: var(--brand); }
.hd-app .tabs .count { font-size: .75rem; background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.hd-app .clist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.hd-app .crow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) 84px 84px 20px; gap: 18px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.hd-app .crow:hover, .hd-app .crow:focus-visible { border-color: var(--brand); box-shadow: var(--shadow); }
.hd-app .crow-id { display: grid; gap: 2px; min-width: 0; }
.hd-app .crow-id strong { font-family: var(--font-display); font-size: 1.05rem; }
.hd-app .crow-id .muted { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-app .crow-contract { display: grid; gap: 4px; min-width: 0; }
.hd-app .crow-contract .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-app .crow-end { font-size: .82rem; }
.hd-app .crow-stat { display: grid; text-align: center; line-height: 1.15; }
.hd-app .crow-stat b { font-family: var(--font-display); font-size: 1.35rem; }
.hd-app .crow-stat .muted { font-size: .75rem; }
.hd-app .crow-go { font-size: 1.6rem; color: var(--muted); line-height: 1; }
.hd-app .mini-meter { display: block; height: 6px; border-radius: 99px; background: var(--cell-empty); overflow: hidden; }
.hd-app .mini-meter span { display: block; height: 100%; background: var(--grad); border-radius: inherit; }
.hd-app .mini-meter.low span { background: var(--warn); }
.hd-app .mini-meter.over span { background: var(--bad); }
.hd-app .mini-figs { font-size: .88rem; }
.hd-app .mini-figs strong.low { color: var(--warn); }
.hd-app .mini-figs strong.over { color: var(--bad); }
.hd-app .contracts { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 14px; }
.hd-app .contract.current { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand), var(--shadow); }
.hd-app .contract-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.hd-app .contract-head h2 { font-size: 1.15rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hd-app .contract-head p { font-size: .88rem; margin-top: 2px; }
.hd-app .contract-figs { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 16px; margin-top: 14px; align-items: end; }
.hd-app .contract-figs > div { display: grid; gap: 4px; }
.hd-app .contract-figs b { font-family: var(--font-display); font-size: 1.5rem; }
.hd-app .contract-edit { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.hd-app .note-line { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: var(--info-soft); font-size: .92rem; }
.hd-app .note-line.warn { background: var(--warn-soft); }
@media (max-width: 860px) {
  .hd-app .crow { grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px 14px; }
  .hd-app .crow-id { grid-column: 1 / -1; }
  .hd-app .crow-contract { grid-column: 1 / -1; }
  .hd-app .crow-go { display: none; }
  .hd-app .crow-stat { text-align: left; grid-auto-flow: column; justify-content: start; gap: 5px; align-items: baseline; }
  .hd-app .crow-stat b { font-size: 1.05rem; }
  .hd-app .contract-figs { grid-template-columns: 1fr 1fr; }
  .hd-app .contract-figs > div:last-child { grid-column: 1 / -1; }
}

/* ---------- 1.6.0: serviços e licenças ---------- */
.hd-app .svc-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.hd-app .svc { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; background: var(--surface); }
.hd-app .svc.off { opacity: .7; }
.hd-app .svc-main { display: grid; grid-template-columns: minmax(0, 2fr) 90px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.hd-app .svc-id { display: grid; gap: 1px; min-width: 0; }
.hd-app .svc-id strong { font-size: 1.02rem; overflow-wrap: anywhere; }
.hd-app .svc-id .muted { font-size: .85rem; }
.hd-app .svc-cat { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--brand); }
.hd-app .svc-qty { display: grid; text-align: center; line-height: 1.15; }
.hd-app .svc-qty b { font-family: var(--font-display); font-size: 1.35rem; }
.hd-app .svc-qty .muted { font-size: .75rem; }
.hd-app .svc-date { display: grid; gap: 1px; }
.hd-app .svc-date .muted { font-size: .8rem; }
.hd-app .svc-state { display: grid; gap: 4px; justify-items: start; font-size: .85rem; }
.hd-app .svc-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.hd-app .svc-extra { margin: 8px 0 0; font-size: .82rem; overflow-wrap: anywhere; }
.hd-app .svc-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.hd-app .svc-form .spacer { flex: 1; }
.hd-app .svc-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hd-app .svc-filters select { width: auto; }
.hd-app .svc-summary { margin: 12px 0 4px; font-size: .9rem; }
.hd-app .bad-text { color: var(--bad); }
.hd-app .attention.renewals { margin-top: 12px; }
@media (max-width: 860px) {
  .hd-app .svc-main { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; }
  .hd-app .svc-id { grid-column: 1 / -1; }
  .hd-app .svc-qty { text-align: left; grid-auto-flow: column; justify-content: start; gap: 5px; align-items: baseline; }
  .hd-app .svc-state { grid-auto-flow: column; justify-content: start; align-items: center; gap: 8px; }
  .hd-app .svc-act { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- 1.7.0: pedidos por telefone ---------- */
.hd-app .call-grid { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; }
.hd-app .call-time { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 4px; margin: 0; }
.hd-app .call-time legend { padding: 0 6px; font-weight: 700; font-size: .9rem; }
.hd-app .quick-times { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.hd-app .tag.phone { background: var(--info-soft); color: var(--info); margin-left: 0; }
@media (max-width: 900px) { .hd-app .call-grid { grid-template-columns: 1fr; } .hd-app .call-grid aside { order: -1; } }
.hd-app .call-outcome { display: grid; gap: 8px; }

/* 1.8.0: o que foi feito e anexos */
.hd-app .resolution-panel .description { border-left: 3px solid var(--ok); padding-left: 12px; }
.hd-app .attach { display: grid; gap: 8px; border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); transition: border-color .15s, background .15s; }
.hd-app .attach.over { border-color: var(--brand); background: var(--brand-soft); }
.hd-app .attach-drop { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.hd-app .attach-drop label.hd-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.hd-app .attach-drop .hint { font-size: .8rem; color: var(--muted); flex: 1 1 240px; }
.hd-app .attach input[type=file]:focus-visible + .hint, .hd-app .attach-drop label:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.hd-app .attach-pending, .hd-app .att-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hd-app .attach-pending li, .hd-app .att-files li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: .88rem; min-width: 0; }
.hd-app .att-ico { color: var(--muted); display: inline-flex; flex: none; }
.hd-app .att-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-app .att-list { display: grid; gap: 10px; margin-top: 10px; }
.hd-app .att-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.hd-app .att-thumb { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; min-width: 0; }
.hd-app .att-open { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; aspect-ratio: 4 / 3; }
.hd-app .att-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hd-app .att-thumb figcaption { display: flex; align-items: center; gap: 6px; padding: 5px 8px; font-size: .78rem; min-width: 0; }
.hd-app .att-del { flex: none; border: 0; background: none; color: var(--bad); font: inherit; font-size: .78rem; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.hd-app .att-del:hover, .hd-app .att-del.armed { background: var(--bad-soft); }
.hd-app .msg .att-list { margin-top: 8px; }
.hd-app .att-viewer { border: 0; padding: 0; border-radius: var(--radius); max-width: min(96vw, 1100px); max-height: 92vh; background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.hd-app .att-viewer::backdrop { background: rgba(7, 14, 26, .7); }
.hd-app .att-viewer-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.hd-app .att-viewer-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hd-app .att-viewer-head .spacer { flex: 1; }
.hd-app .att-viewer img { display: block; max-width: 100%; max-height: calc(92vh - 60px); margin: 0 auto; object-fit: contain; }

/* 1.9.0: app instalável */
.hd-app .app-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: .92rem; }
.hd-app .login-main { align-content: center; gap: 20px; }
.hd-app .install-card { width: 100%; max-width: 390px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.hd-app .install-card img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.hd-app .install-text { flex: 1 1 180px; display: grid; gap: 2px; font-size: .88rem; color: var(--muted); }
.hd-app .install-text strong { color: var(--fg); font-size: .95rem; }
.hd-app .install-act { display: flex; gap: 8px; margin-left: auto; }

/* 1.11.0: deslocação e trabalho sem desconto */
.hd-app .tag.gift { background: var(--ok-soft); color: var(--ok); }
.hd-app .travel-time .hint { font-size: .82rem; color: var(--muted); }

/* 1.12.0: documentação interna do cliente */
.hd-app .tag.private { background: var(--warn-soft); color: var(--warn); }
.hd-app .doc-list { list-style: none; margin: 0; padding: 0; display: grid; }
.hd-app .doc-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hd-app .doc-list li:first-child { border-top: 0; }
.hd-app .doc-list .att-ico { margin-top: 2px; }
.hd-app .doc-main { flex: 1 1 260px; min-width: 0; display: grid; gap: 3px; }
.hd-app .doc-name { font-weight: 600; overflow-wrap: anywhere; }
.hd-app .doc-desc { font-size: .9rem; overflow-wrap: anywhere; }
.hd-app .doc-meta { font-size: .8rem; }
.hd-app .doc-act { display: flex; gap: 6px; flex-wrap: wrap; }
.hd-app .doc-edit { margin-top: 6px; }

/* 1.12.1: IP com ligação para o mapa */
.hd-app .ip-link { color: var(--brand); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; white-space: nowrap; }
.hd-app .ip-link::after { content: " ↗"; font-size: .8em; }

/* Integração com o Joomla */
body.contentpane { margin: 0; padding: 0; background: #f2f5f9; }
@media (prefers-color-scheme: dark) { body.contentpane { background: #070e1a; } }
.hd-app { min-height: 100vh; min-height: 100dvh; }
.hd-app h1, .hd-app h2, .hd-app h3 { color: inherit; }
.hd-app a:not(.hd-btn):not(.hd-logo):not(.trow):not(.kpi):not(.visit) { text-decoration-thickness: 1px; }
.hd-app label { display: revert; margin: 0; }
.hd-app [hidden] { display: none !important; }
