/* 📅 Agendamentos no estilo do Google Agenda (app/agenda-visao.js) */
.tzv { --tzv-line: var(--line, #dadce0); --tzv-g: #4285f4; --tzv-g-past: #d2e3fc; --tzv-t: #8e24aa; --tzv-t-past: #ead1f0; }
.tzv-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.tzv-bar h3 { margin: 0 0 0 8px; font-size: 20px; font-weight: 500; }
.tzv-grow { flex: 1; }
.tzv-btn, .tzv-seg button, .tzv-nav, .tzv-new { font: inherit; cursor: pointer; }
.tzv-btn { padding: 7px 16px; border: 1px solid var(--tzv-line); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; }
.tzv-nav { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: 22px; line-height: 1; }
.tzv-nav:hover, .tzv-btn:hover { background: var(--panel, #f1f3f4); }
.tzv-seg { display: flex; border: 1px solid var(--tzv-line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.tzv-seg button { padding: 7px 16px; border: 0; background: transparent; color: var(--ink); font-weight: 600; }
.tzv-seg button.on { background: var(--blue2, #e8f0fe); color: var(--blue, #1a73e8); }
.tzv-new { padding: 8px 16px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 700; }
/* grade de dia/semana */
.tzv-grid { border: 1px solid var(--tzv-line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.tzv-headrow, .tzv-alldayrow { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(0, 1fr)); border-bottom: 1px solid var(--tzv-line); }
.tzv-alldayrow { grid-template-columns: 56px repeat(var(--cols), minmax(0, 1fr)); }
.tzv-gmt { align-self: end; padding: 0 6px 6px; font-size: 12px; color: var(--muted); text-align: right; }
.tzv-colhead { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; border-left: 1px solid var(--tzv-line); cursor: pointer; }
.tzv-colhead span { font-size: 12px; font-weight: 600; letter-spacing: .5px; color: var(--muted); }
.tzv-colhead b { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 22px; font-weight: 400; }
.tzv-colhead.today span { color: var(--blue, #1a73e8); }
.tzv-colhead.today b { background: var(--blue, #1a73e8); color: #fff; }
.tzv-colhead:hover b { background: var(--panel, #f1f3f4); }
.tzv-colhead.today:hover b { background: var(--blue); }
.tzv-allday-cell { display: flex; flex-direction: column; gap: 2px; padding: 3px; border-left: 1px solid var(--tzv-line); min-width: 0; }
.tzv-scroll { max-height: calc(100vh - 330px); min-height: 360px; overflow-y: auto; }
.tzv-body { position: relative; display: grid; grid-template-columns: 56px 1fr; }
.tzv-gutter { position: relative; }
.tzv-hour { position: absolute; right: 8px; transform: translateY(-50%); font-size: 12px; color: var(--muted); }
.tzv-cols { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); background-image: linear-gradient(to bottom, var(--tzv-line) 1px, transparent 1px); background-size: 100% 48px; }
.tzv-col { position: relative; border-left: 1px solid var(--tzv-line); cursor: cell; }
.tzv-col.today { background: color-mix(in srgb, var(--blue2, #e8f0fe) 35%, transparent); }
.tzv-now { position: absolute; left: 0; right: 0; height: 2px; background: #ea4335; z-index: 3; pointer-events: none; }
.tzv-now i { position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: #ea4335; }
/* eventos */
.tzv-ev { position: absolute; display: flex; flex-direction: column; gap: 1px; padding: 3px 6px; border: 0; border-radius: 6px; text-align: left; overflow: hidden; cursor: pointer; font: inherit; font-size: 12px; line-height: 1.25; color: #fff; box-shadow: 0 0 0 1px var(--surface); }
.tzv-ev.g { background: var(--tzv-g); }
.tzv-ev.tz { background: var(--tzv-t); }
.tzv-ev b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tzv-ev small { font-size: 11px; opacity: .92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tzv-ev:hover { filter: brightness(1.08); z-index: 4; }
/* o que já passou fica mais claro, como no Google */
.tzv-ev.past.g { background: var(--tzv-g-past); color: #5f6368; }
.tzv-ev.past.tz { background: var(--tzv-t-past); color: #6d4a76; }
.tzv-ev.done b { text-decoration: line-through; }
.tzv-ev.allday { position: static; padding: 2px 6px; flex-direction: row; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; box-shadow: none; }
/* mês */
.tzv-month { border: 1px solid var(--tzv-line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.tzv-mheadrow, .tzv-mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tzv-mhead { padding: 8px 0; text-align: center; font-size: 12px; font-weight: 600; letter-spacing: .5px; color: var(--muted); border-bottom: 1px solid var(--tzv-line); }
.tzv-mcell { min-height: 116px; padding: 4px; border-right: 1px solid var(--tzv-line); border-bottom: 1px solid var(--tzv-line); display: flex; flex-direction: column; gap: 2px; cursor: cell; min-width: 0; }
.tzv-mcell:nth-child(7n) { border-right: 0; }
.tzv-mcell .n { align-self: center; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 13px; font-size: 12px; font-weight: 600; cursor: pointer; }
.tzv-mcell .n:hover { background: var(--panel, #f1f3f4); }
.tzv-mcell.other .n { color: var(--muted); font-weight: 400; }
.tzv-mcell.today .n { background: var(--blue, #1a73e8); color: #fff; }
.tzv-mcell.past:not(.today) { background: color-mix(in srgb, var(--panel, #f1f3f4) 45%, transparent); }
.tzv-ev.mini { position: static; display: flex; flex-direction: row; align-items: center; gap: 4px; padding: 1px 5px; box-shadow: none; white-space: nowrap; overflow: hidden; }
.tzv-ev.mini.g, .tzv-ev.mini.tz { background: transparent; color: var(--ink); }
.tzv-ev.mini i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--tzv-g); }
.tzv-ev.mini.tz i { background: var(--tzv-t); }
.tzv-ev.mini span { flex: none; font-size: 12px; color: var(--muted); }
.tzv-ev.mini.past { background: transparent; color: var(--muted); }
.tzv-ev.mini.past i { opacity: .45; }
.tzv-ev.mini.allday { background: var(--tzv-g); color: #fff; display: block; }
.tzv-ev.mini.allday i { display: none; }
.tzv-ev.mini.allday.past { background: var(--tzv-g-past); color: #5f6368; }
.tzv-ev.mini:hover { background: var(--panel, #f1f3f4); filter: none; }
.tzv-ev.mini.allday:hover { filter: brightness(1.08); background: var(--tzv-g); }
.tzv-more { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; text-align: left; padding: 1px 5px; cursor: pointer; }
.tzv-legend { margin: 10px 2px 0; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tzv-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.tzv-legend i:first-child { margin-left: 0; }
.tzv-legend i.tz { background: var(--tzv-t); } .tzv-legend i.g { background: var(--tzv-g); }
.tzv-empty { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--tz-outline-container); border-left: 3px solid var(--blue); border-radius: var(--tz-r-md); background: var(--panel); color: var(--muted); font-size: 13px; line-height: 1.4; }
.tzv-empty svg { width: 18px; height: 18px; flex: none; stroke: var(--blue); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tzv-week-hint { display: none; }
.tzv-modal .danger { margin-right: auto; }
body[data-theme="graphite"] .tzv { --tzv-g-past: #2c3e5f; --tzv-t-past: #4a2b55; }
body[data-theme="graphite"] .tzv-ev.past.g { color: #aebbd6; }
body[data-theme="graphite"] .tzv-ev.past.tz { color: #d6b6e0; }
@media (max-width: 760px) {
  .tzv-bar h3 { font-size: 16px; margin: 0; flex-basis: 100%; order: 5; }
  /* celular (23/10/2026): título e Google Agenda na mesma linha, "Atualizar" some (o Google é conferido sozinho a cada
     2 min) e "Novo agendamento" vira botão flutuante acima da barra de baixo: a grade aparece logo */
  .tzv .module-head { flex-direction: row !important; align-items: center !important; flex-wrap: nowrap; }
  .tzv .module-head > div:first-child { min-width: 0; }
  .tzv .module-head .tzag-button { flex-shrink: 0; width: auto !important; height: 38px; padding: 0 12px; white-space: nowrap; }
  .tzv-bar { gap: 6px; }
  .tzv-bar [data-refresh], .tzv-bar .tzv-grow { display: none; }
  .tzv-bar .tzv-seg { margin-left: auto; }
  .tzv-btn { min-height: 40px; padding-inline: 14px; }
  .tzv-nav { width: 40px; height: 40px; }
  .tzv-seg button { min-height: 40px; padding-inline: 13px; }
  .tzv-new { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 35; height: 48px; padding: 0 18px; border-radius: 999px; box-shadow: var(--tz-shadow-lg); }
  body.open .tzv-new { display: none; }
  .tzv-scroll { max-height: calc(100vh - 280px); }
  .tzv-headrow, .tzv-alldayrow { grid-template-columns: 40px repeat(var(--cols), minmax(0, 1fr)); }
  .tzv-body { grid-template-columns: 40px 1fr; }
  .tzv-colhead b { width: 32px; height: 32px; font-size: 16px; }
  .tzv-mcell { min-height: 74px; }
  .tzv-ev.mini { display: flex; justify-content: center; width: 100%; height: 12px; min-height: 12px; margin: 1px 0; padding: 0; border-radius: 0; background: transparent !important; color: inherit; }
  .tzv-ev.mini span, .tzv-ev.mini .tzv-mini-title { display: none; }
  .tzv-ev.mini i, .tzv-ev.mini.allday i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--tzv-g); }
  .tzv-ev.mini.tz i { background: var(--tzv-t); }
  .tzv-empty { gap: 8px; margin-bottom: 8px; padding: 9px 10px; font-size: 12.5px; }
  .tzv-week-hint { display: block; margin: -4px 2px 8px; color: var(--muted); font-size: 11px; }
  .tzv-grid[style*="--cols:7"] { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  .tzv-grid[style*="--cols:7"] > .tzv-headrow,
  .tzv-grid[style*="--cols:7"] > .tzv-alldayrow { width: 712px; min-width: 712px; grid-template-columns: 40px repeat(7, minmax(96px, 1fr)); }
  .tzv-grid[style*="--cols:7"] > .tzv-scroll { width: 712px; min-width: 712px; max-width: none; overflow-x: hidden; }
  .tzv-grid[style*="--cols:7"] .tzv-body { width: 712px; min-width: 712px; grid-template-columns: 40px minmax(0, 1fr); }
  .tzv-grid[style*="--cols:7"] .tzv-cols { grid-template-columns: repeat(7, minmax(96px, 1fr)); }
}
