/* ==========================================================================
   Panificadora Frank - Painel ADM
   Mobile-first: a administracao e feita principalmente pelo celular.
   ========================================================================== */

:root {
  --red: #c1121f;
  --red-dark: #8f0d17;
  --red-soft: #fdeceb;
  --green: #1b7f4b;
  --green-dark: #14603a;
  --green-soft: #e8f5ee;
  --gold: #d99a2b;

  --bg: #f6f2ec;
  --surface: #ffffff;
  --ink: #241c15;
  --ink-soft: #4c433a;
  --muted: #776b5f;
  --line: #e7ddd0;

  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(36, 28, 21, 0.06), 0 1px 4px rgba(36, 28, 21, 0.04);
  --shadow: 0 2px 8px rgba(36, 28, 21, 0.07), 0 10px 24px rgba(36, 28, 21, 0.07);
  --shadow-lg: 0 12px 40px rgba(36, 28, 21, 0.18);

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --header-h: 60px;
  --tabbar-h: 62px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 6px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.4rem;
}
h2 {
  font-size: 1.15rem;
}
h3 {
  font-size: 1rem;
}

p {
  margin: 0 0 10px;
}

a {
  color: var(--green-dark);
}

img {
  max-width: 100%;
  display: block;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Autenticacao / instalacao
   -------------------------------------------------------------------------- */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: radial-gradient(circle at 18% 12%, rgba(193, 18, 31, 0.12), transparent 45%),
    radial-gradient(circle at 85% 88%, rgba(27, 127, 75, 0.13), transparent 45%), var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 430px;
  padding: 26px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-brand__mark {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: Georgia, serif;
  box-shadow: 0 5px 14px rgba(193, 18, 31, 0.28);
}

.auth-brand__title {
  margin: 0;
  font-size: 1.1rem;
}

.auth-brand__sub {
  color: var(--muted);
  font-size: 0.85rem;
}

.auth-actions {
  margin-top: 20px;
  text-align: center;
  font-size: 0.88rem;
}

/* --------------------------------------------------------------------------
   Formularios
   -------------------------------------------------------------------------- */
.field {
  margin-bottom: 15px;
}

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.field__hint {
  display: block;
  margin-top: 5px;
  font-size: 0.78rem;
  color: var(--muted);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 12px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.96rem;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
  appearance: none;
}

.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.55;
}

.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23776b5f' stroke-width='2.4'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(27, 127, 75, 0.14);
}

.input.is-invalid,
.textarea.is-invalid,
.select.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(193, 18, 31, 0.12);
}

.input[type="password"] {
  letter-spacing: 0.06em;
}

.field-row {
  display: grid;
  gap: 12px;
}

@media (min-width: 620px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Switch */
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch__track {
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 999px;
  background: #d5cdc3;
  position: relative;
  transition: background-color 0.2s var(--ease);
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s var(--ease);
}

.switch input:checked + .switch__track {
  background: var(--green);
}

.switch input:checked + .switch__track::after {
  transform: translateX(20px);
}

.switch input:focus-visible + .switch__track {
  box-shadow: 0 0 0 3px rgba(217, 154, 43, 0.5);
}

.switch__text {
  font-size: 0.92rem;
  font-weight: 600;
}

.switch__sub {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Botoes
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: #fff;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.14s var(--ease), background-color 0.16s var(--ease), box-shadow 0.16s var(--ease),
    opacity 0.16s;
}

.btn:hover:not(:disabled) {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--red);
}
.btn--primary:hover:not(:disabled) {
  background: var(--red-dark);
}

.btn--ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn--ghost:hover:not(:disabled) {
  background: #faf6f1;
  color: var(--ink);
}

.btn--danger {
  background: #fff;
  border-color: rgba(193, 18, 31, 0.4);
  color: var(--red-dark);
}
.btn--danger:hover:not(:disabled) {
  background: var(--red-soft);
}

.btn--sm {
  padding: 9px 13px;
  font-size: 0.85rem;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  padding: 9px;
  width: 38px;
  height: 38px;
}

.btn__spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   Estrutura do painel
   -------------------------------------------------------------------------- */
.app {
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar-h) + 16px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--header-h);
  padding: 8px 14px;
  max-width: 1080px;
  margin: 0 auto;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.topbar__brand > div {
  min-width: 0;
  overflow: hidden;
}

.topbar__mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.topbar__title {
  margin: 0;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__sub {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__spacer {
  margin-left: auto;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

/* Em telas estreitas, esconde o rotulo textual do botao "Ver site". */
@media (max-width: 700px) {
  .hide-sm {
    display: none;
  }
}

.main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 14px 24px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.page-head__sub {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

/* Abas */
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  scrollbar-width: none;
}

/* A navegacao por abas do topo aparece apenas no desktop;
   no celular usamos a barra inferior fixa. */
.tabs--desktop {
  display: none;
}

@media (min-width: 900px) {
  .tabs--desktop {
    display: flex;
  }
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  padding: 9px 15px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s var(--ease);
}

.tab:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.view {
  animation: fadeIn 0.22s var(--ease);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Barra inferior (celular) */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--tabbar-h);
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.16s var(--ease);
}

.tabbar__btn.is-active {
  color: var(--red);
}

.tabbar__btn.is-active svg {
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Cards / listas
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  overflow: hidden;
}

.card--pad {
  padding: 16px;
}

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbf8f4;
}

.card__title {
  margin: 0;
  font-size: 0.98rem;
}

.card__sub {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.card__body {
  padding: 16px;
}

.card__footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fbf8f4;
}

.card__spacer {
  margin-left: auto;
}

/* Item de lista (produto / secao) */
.item {
  display: flex;
  gap: 12px;
  padding: 13px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
  align-items: flex-start;
}

.item__thumb {
  width: 66px;
  height: 66px;
  flex-shrink: 0;
  border-radius: 11px;
  object-fit: cover;
  background: #f3ece3;
  border: 1px solid var(--line);
}

.item__thumb--empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.item__main {
  flex: 1;
  min-width: 0;
}

.item__title {
  margin: 0 0 3px;
  font-size: 0.98rem;
  word-break: break-word;
}

.item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 7px;
}

.item__desc {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.item__order {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--on {
  background: var(--green-soft);
  color: var(--green-dark);
}

.badge--off {
  background: var(--red-soft);
  color: var(--red-dark);
}

.badge--warn {
  background: #fdf3e2;
  color: #8a5a0b;
}

.badge--neutral {
  background: #f0ece6;
  color: var(--ink-soft);
}

.badge--gold {
  background: #fbf1dc;
  color: #8a5a0b;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}

/* --------------------------------------------------------------------------
   Alertas e estados
   -------------------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.alert--error {
  background: var(--red-soft);
  border-color: rgba(193, 18, 31, 0.22);
  color: var(--red-dark);
}

.alert--success {
  background: var(--green-soft);
  border-color: rgba(27, 127, 75, 0.22);
  color: var(--green-dark);
}

.alert--info {
  background: #eef4fb;
  border-color: rgba(37, 99, 235, 0.2);
  color: #1e3a8a;
}

.alert__icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.alert ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

/* Toast */
.toast-area {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tabbar-h) + 14px);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: #241c15;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s var(--ease);
  pointer-events: auto;
}

.toast--success {
  background: var(--green-dark);
}
.toast--error {
  background: var(--red-dark);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 700px) {
  .toast-area {
    left: auto;
    right: 20px;
    bottom: 20px;
    width: 340px;
  }
}

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, #ece5dc 25%, #f6f1ea 50%, #ece5dc 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  height: 76px;
  margin-bottom: 10px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.empty {
  padding: 36px 20px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
  color: var(--muted);
}

.empty svg {
  color: var(--red);
  margin-bottom: 10px;
}

.empty h3 {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Modal / gaveta
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(36, 28, 21, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.18s var(--ease);
}

@media (min-width: 700px) {
  .overlay {
    align-items: center;
    padding: 24px;
  }
}

.sheet {
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheetUp 0.25s var(--ease);
}

@media (min-width: 700px) {
  .sheet {
    border-radius: var(--radius-lg);
    max-height: 88vh;
  }
}

@keyframes sheetUp {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.sheet--sm {
  max-width: 430px;
}

.sheet__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.sheet__title {
  margin: 0;
  font-size: 1.02rem;
}

.sheet__close {
  margin-left: auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
}

.sheet__close:hover {
  background: #faf6f1;
}

.sheet__body {
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sheet__foot {
  display: flex;
  gap: 10px;
  padding: 13px 16px calc(13px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fbf8f4;
  flex-shrink: 0;
}

.sheet__foot .btn {
  flex: 1;
}

/* --------------------------------------------------------------------------
   Upload de imagem
   -------------------------------------------------------------------------- */
.uploader {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: #fbf8f4;
  padding: 16px;
  text-align: center;
}

.uploader.is-dragover {
  border-color: var(--green);
  background: var(--green-soft);
}

.uploader__preview {
  position: relative;
  margin: 0 auto 12px;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #efe7dc;
  border: 1px solid var(--line);
}

.uploader__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uploader__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  gap: 6px;
}

.uploader__progress {
  height: 6px;
  border-radius: 999px;
  background: #ece5dc;
  overflow: hidden;
  margin-top: 12px;
}

.uploader__bar {
  height: 100%;
  width: 0;
  background: var(--green);
  transition: width 0.2s var(--ease);
}

.uploader__info {
  margin-top: 7px;
  font-size: 0.78rem;
  color: var(--muted);
}

.uploader input[type="file"] {
  display: none;
}

/* --------------------------------------------------------------------------
   Galeria de imagens
   -------------------------------------------------------------------------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}

.media-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.media-card.is-selected {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(27, 127, 75, 0.18);
}

.media-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  background: #f3ece3;
}

.media-card__meta {
  padding: 6px 8px;
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-card__del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(36, 28, 21, 0.72);
  color: #fff;
  cursor: pointer;
}

.media-card__del:hover {
  background: var(--red-dark);
}

/* Seletor de produtos */
.picker {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.picker__row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-bottom: 1px solid #f3ece3;
  cursor: pointer;
}

.picker__row:last-child {
  border-bottom: 0;
}

.picker__row:hover {
  background: #faf6f1;
}

.picker__row input {
  width: 19px;
  height: 19px;
  accent-color: var(--green);
  flex-shrink: 0;
}

.picker__name {
  font-size: 0.9rem;
  font-weight: 600;
}

.picker__meta {
  font-size: 0.76rem;
  color: var(--muted);
}

/* Tabela de horarios */
.hours-editor__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid #f3ece3;
}

.hours-editor__row:last-child {
  border-bottom: 0;
}

.hours-editor__label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  grid-column: 1 / -1;
}

.hours-editor__label input {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
}

.hours-editor__times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  grid-column: 1 / -1;
}

/* --------------------------------------------------------------------------
   Diversos
   -------------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 620px) {
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.stat__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--red-dark);
  line-height: 1.1;
}

.stat__label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

.help {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: #fbf8f4;
  border: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.help code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #efe7dc;
  font-size: 0.84em;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.split-actions {
  display: grid;
  gap: 8px;
}

@media (min-width: 620px) {
  .split-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Desktop: esconder barra inferior e mostrar espaco extra */
@media (min-width: 900px) {
  .app {
    padding-bottom: 32px;
  }

  .tabbar {
    display: none;
  }

  .toast-area {
    bottom: 20px;
  }
}
