/* Tema resultMD (recriado dos prints) — deep purple / Metro-Material */
:root {
  --purple: #5a2d8c;
  --purple-bar: #5b2d8e;
  --purple-dark: #4a2375;
  --purple-header: #512d7e;
  --purple-light: #6a3ca3;
  --bg: #f4f4f7;
  --surface: #ffffff;
  --text: #2b2b2b;
  --muted: #8a8a8a;
  --line: #e0e0e6;
  --row-alt: #fde7ef;      /* rosa das linhas agendadas */
  --row-sel: #cde7ee;      /* azul claro de seleção */
  --font: "Segoe UI", Roboto, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; }

/* Barra de título superior */
.titlebar {
  background: var(--purple-dark); color: #fff; height: 30px; display: flex; align-items: center;
  padding: 0 10px; font-size: 12px; gap: 12px;
}
.titlebar .app { font-weight: 600; letter-spacing: .3px; }
.titlebar .spacer { flex: 1; }
.titlebar .right { display: flex; align-items: center; gap: 16px; opacity: .95; }
.titlebar .winbtns { display: flex; gap: 14px; margin-left: 10px; }

/* Faixa de abas (Início | Tela) */
.tabs { background: var(--purple-bar); color: #fff; height: 34px; display: flex; align-items: stretch; padding-left: 10px; }
.tabs a { color: #cdbce0; text-decoration: none; display: flex; align-items: center; padding: 0 16px; font-size: 13px; }
.tabs a.active { color: #fff; border-bottom: 3px solid #ffd54f; }

/* Cabeçalho da tela com ferramentas à direita */
.screenhead { background: var(--purple-bar); color: #fff; display: flex; align-items: center; padding: 10px 16px; gap: 14px; }
.screenhead .burger { font-size: 20px; }
.screenhead h2 { margin: 0; font-weight: 400; font-size: 20px; flex: 0 0 auto; }
.screenhead .spacer { flex: 1; }
.tools { display: flex; gap: 18px; }
.tool { display: flex; flex-direction: column; align-items: center; color: #fff; font-size: 11px; cursor: pointer; gap: 3px; opacity: .95; }
.tool .ic { font-size: 18px; }
.tool:hover { opacity: 1; }

/* Painéis com cabeçalho roxo */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 2px; margin: 0; }
.panel > .ph { background: var(--purple-header); color: #fff; padding: 7px 12px; font-size: 13px; display: flex; align-items: center; justify-content: space-between; }
.panel > .pb { padding: 12px; }

/* Campos estilo "underline" (Material) */
.ufield { display: flex; flex-direction: column; margin: 8px 10px; }
.ufield label { font-size: 11px; color: var(--muted); }
.ufield input, .ufield select {
  border: 0; border-bottom: 1px solid #bdbdbd; background: transparent; padding: 5px 2px; font: inherit; outline: none;
}
.ufield input:focus, .ufield select:focus { border-bottom: 2px solid var(--purple); }

/* Botões */
.btn { background: var(--purple); color: #fff; border: 0; border-radius: 2px; padding: 9px 20px; font: 600 13px var(--font); cursor: pointer; }
.btn:hover { background: var(--purple-dark); }
.btn-lg { font-size: 18px; padding: 14px 28px; }

/* Grade de dados */
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; color: #555; font-weight: 600; padding: 8px 10px; border-bottom: 2px solid var(--line); background: #fafafa; position: sticky; top: 0; }
table.grid td { padding: 7px 10px; border-bottom: 1px solid #eee; white-space: nowrap; }
table.grid tr.booked td { background: var(--row-alt); }
table.grid tr.sel td { background: var(--row-sel); }
table.grid tr:hover td { background: #f0eef6; }

/* Barra de status inferior */
.statusbar { position: fixed; bottom: 0; left: 0; right: 0; height: 26px; background: var(--purple-dark); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; font-size: 12px; }
.content { padding: 14px 16px 40px; }
a.plain { color: inherit; text-decoration: none; }

/* Shared interaction and responsive additions. */
:root { --muted: #64616c; --error: #a92335; --success: #226b43; }
button, input, select, textarea { font: inherit; }
button:disabled { opacity: .48; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #b78ee8; outline-offset: 3px; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.titlebar { min-height: 40px; height: auto; padding: 8px 16px; }
.titlebar .right { gap: 14px; }
.tabs { min-height: 42px; height: auto; overflow-x: auto; }
.tabs a { padding: 12px 18px; white-space: nowrap; }
.screenhead { flex-wrap: wrap; min-height: 76px; }
.screenhead h1 { font-size: 23px; font-weight: 600; margin: 0; }
.panel { border-radius: 6px; overflow: hidden; }
.panel > .ph { min-height: 38px; font-weight: 600; gap: 10px; }
.panel > .ph h2 { font: inherit; margin: 0; }
.panel > .pb { padding: 14px; }
.ufield { min-width: 0; margin: 8px 0; gap: 4px; }
.ufield label { font-size: 12px; color: #57525e; }
.ufield input, .ufield select, .ufield textarea { border: 1px solid #c9c4d0; border-radius: 4px; background: #fff; min-height: 36px; width: 100%; padding: 7px 8px; }
.ufield input:focus, .ufield select:focus, .ufield textarea:focus { border: 1px solid var(--purple); }
.ufield input[readonly] { color: #57525e; background: #f5f3f8; }
.ufield textarea { resize: vertical; }
.btn { border-radius: 4px; min-height: 36px; }
.btn.secondary, .btn-secondary { background: #f2edf8; color: var(--purple-dark); border: 1px solid #cfc0df; }
.btn.secondary:hover, .btn-secondary:hover { background: #e9e0f4; }
.btn.danger { background: var(--error); }
.btn.small { padding: 6px 10px; font-size: 12px; min-height: 30px; }
.text-button, .icon-button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 5px; }
.text-button { text-decoration: underline; text-underline-offset: 3px; }
.icon-button { min-width: 34px; min-height: 34px; border-radius: 4px; }
.icon-button:hover { background: #ffffff25; }
.panel-stack { display: grid; gap: 14px; align-content: start; }
.row2, .row3 { display: grid; gap: 0 12px; }
.row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-actions, .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field-actions .ufield { flex: 1; }
.help, .muted { font-size: 12px; color: var(--muted); line-height: 1.5; }
.message { padding: 10px 12px; border-radius: 4px; background: #eee9f5; color: #48276b; line-height: 1.45; }
.message.error, .error { color: var(--error); }
.message.error { background: #fbeaec; }
.message.success, .success { color: var(--success); }
.message.success { background: #e9f5ee; }
.message.warning { color: #795614; background: #fff6dc; }
.table-wrap { overflow-x: auto; }
.empty-cell { text-align: center; padding: 24px !important; white-space: normal !important; color: var(--muted); }
.grid button { font-size: 12px; }
.rmd-dialog { border: 0; padding: 0; border-radius: 8px; width: min(680px, calc(100vw - 32px)); max-height: 88vh; color: var(--text); box-shadow: 0 15px 60px #1d0d3640; }
.rmd-dialog::backdrop { background: #21133180; }
.dialog-head { background: var(--purple-header); color: white; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-head h2 { margin: 0; font-size: 18px; }
.dialog-body { padding: 18px; overflow: auto; max-height: 65vh; white-space: pre-wrap; }
.dialog-body table { white-space: normal; }
.dialog-actions { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.toast { position: fixed; right: 18px; bottom: 45px; max-width: min(460px, calc(100vw - 36px)); z-index: 500; padding: 13px 18px; background: #fff; border: 1px solid #cbbddc; border-left: 5px solid var(--purple); border-radius: 6px; box-shadow: 0 4px 24px #23133520; line-height: 1.4; }
.toast.error { border-left-color: var(--error); }
.toast.success { border-left-color: var(--success); }
.statusbar { z-index: 10; gap: 10px; }
.badge { display: inline-block; font-size: 12px; border-radius: 12px; padding: 3px 9px; background: #eee7f6; color: var(--purple); }
.scheduling-cols { display: grid; grid-template-columns: minmax(300px, 1.05fr) minmax(300px, 1fr) minmax(260px, .85fr); gap: 16px; align-items: start; }
.modebar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.toggle { display: flex; border: 1px solid #c9b3df; border-radius: 5px; overflow: hidden; }
.toggle button { background: white; color: var(--purple); border: 0; padding: 9px 18px; cursor: pointer; font-weight: 600; }
.toggle button.off { background: transparent; color: white; }
.calhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; color: var(--purple); }
.cal table { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.cal th { font-size: 11px; color: var(--muted); padding: 8px 0; }
.cal td { padding: 0; text-align: center; }
.cal td button { width: 100%; min-height: 35px; background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer; }
.cal td button:hover { background: #eee7f6; }
.cal td button.other-month { color: #9a92a3; }
.cal td button.today { border-color: #c8b4dd; }
.cal td button.selected { background: var(--purple); color: white; }
.timepick { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 10px 0; }
.timepick .big { font-size: 32px; font-weight: 600; color: var(--purple); }
.slot-date { text-align: center; font-size: 13px; color: var(--muted); margin: 6px 0 12px; }
.resumo dl { display: grid; grid-template-columns: 95px 1fr; gap: 9px 12px; margin: 0; font-size: 13px; }
.resumo dt { color: var(--muted); }
.resumo dd { margin: 0; overflow-wrap: anywhere; }
.price-list { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); margin-top: 12px; }
.price-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.price-line strong { white-space: nowrap; }
.price-total { color: var(--purple); padding-top: 8px; border-top: 1px solid var(--line); font-size: 16px; }
.instructions { white-space: pre-wrap; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
.instructions h3 { font-size: 13px; margin-bottom: 4px; }
.chip-list { display: grid; gap: 6px; margin-top: 10px; }
.chip { background: #f3edf9; padding: 5px 10px; display: flex; justify-content: space-between; align-items: center; border-radius: 4px; font-size: 12px; gap: 8px; }
.check-row { display: flex; align-items: start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check-row input { margin-top: 3px; }
.compromissos { margin-top: 16px; }
#salvar { width: 100%; }
@media (max-width: 1160px) { .scheduling-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .scheduling-cols > :last-child { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .content { padding: 12px 10px 58px; } .titlebar .app { font-size: 11px; } .titlebar .right { font-size: 11px; gap: 8px; } .screenhead { padding: 14px 12px; gap: 12px; } .screenhead .spacer { display: none; } .scheduling-cols, .scheduling-cols > :last-child { grid-template-columns: 1fr; } .scheduling-cols > :last-child { grid-column: auto; } .row3 { grid-template-columns: 1fr; } .statusbar { height: auto; min-height: 30px; padding: 5px 10px; font-size: 10px; } .tools { gap: 12px; } }
@media print { .titlebar, .tabs, .screenhead, .statusbar, .no-print, .toast { display: none !important; } body { background: white; } .content { padding: 0; } .table-wrap { overflow: visible; } table.grid th { position: static; } }
