:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --border: #e2e5e9;
  --text: #1f2430;
  --text-muted: #6b7280;
  --primary: #2d6a4f;
  --primary-dark: #1b4332;
  --accent: #f4a261;
  --danger: #d64545;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--primary-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  background: var(--primary-dark);
  color: #fff;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

.mobile-title { font-weight: 700; font-size: 1.05rem; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
}

.brand {
  font-size: 1.3rem;
  font-weight: 700;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  max-height: 40px;
  max-width: 100%;
  object-fit: contain;
}

.nav-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  text-align: left;
  padding: 12px 20px;
  font-size: 0.95rem;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.nav-btn.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 600;
}

.nav-section-label {
  padding: 16px 20px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.nav-section-label:first-of-type {
  padding-top: 4px;
}

.content {
  flex: 1;
  padding: 32px 40px;
  max-width: 1000px;
}

.view { display: none; }
.view.active { display: block; }

h1 { margin-top: 0; font-size: 1.6rem; }
h2 { font-size: 1.1rem; color: var(--text-muted); margin-top: 32px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card.highlight {
  border-color: var(--primary);
  background: #edf7f1;
}

.card-label { font-size: 0.8rem; color: var(--text-muted); }
.card-value { font-size: 1.4rem; font-weight: 700; }

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 640px;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

legend {
  font-weight: 600;
  padding: 0 6px;
  color: var(--primary-dark);
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

.hint { font-size: 0.78rem; color: var(--text-muted); margin: 0; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

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

.btn-secondary {
  background: none;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
}

.btn-danger {
  background: none;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
}

.form-actions { display: flex; align-items: center; gap: 12px; }
.saved-msg { color: var(--primary); font-size: 0.85rem; }

.distance-result {
  font-size: 0.9rem;
  color: var(--text);
  min-height: 1.2em;
}

.price-breakdown {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.88rem;
}

.price-breakdown .row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.price-breakdown .row.total {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary-dark);
}

.rides-table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

th { background: #f0f2f4; color: var(--text-muted); font-weight: 600; }

tr:last-child td { border-bottom: none; }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-agendado { background: #fff3cd; color: #8a6d00; }
.status-em_andamento { background: #cfe2ff; color: #084298; }
.status-concluido { background: #d1e7dd; color: #0f5132; }
.status-cancelado { background: #f8d7da; color: #842029; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.filters { margin-bottom: 14px; display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filters label { flex-direction: row; align-items: center; gap: 8px; font-size: 0.85rem; }

.period-filter { max-width: 620px; margin-bottom: 16px; }
.period-filter-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.period-filter-row label { font-size: 0.85rem; }

.link-btn {
  background: none;
  border: none;
  color: var(--primary-dark);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 4px;
}

.logo-preview-wrap { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.logo-preview {
  max-width: 160px;
  max-height: 80px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  padding: 4px;
}

.help-accordion details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 10px;
}
.help-accordion summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--primary-dark);
}
.help-accordion p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 10px 0 0;
}

.palette-swatch-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.palette-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
  font-family: inherit;
}
.palette-swatch.active { border-color: var(--text); }
.palette-swatch-colors { display: flex; border-radius: 6px; overflow: hidden; width: 64px; height: 28px; box-shadow: var(--shadow); }
.palette-swatch-colors span { flex: 1; }
.palette-swatch-label { font-size: 0.75rem; color: var(--text-muted); }

.inline-form {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.inline-form input { flex: 1; min-width: 180px; }

.empty-state {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 20px;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.addr-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
}

.addr-suggestion-item {
  padding: 8px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

.addr-suggestion-item:hover {
  background: #f0f2f4;
}

.addr-suggestion-main { font-weight: 600; color: var(--text); }
.addr-suggestion-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-maps {
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-maps:hover { opacity: 0.92; }

.trip-type-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trip-type-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: #fff;
  flex-direction: row;
}

.trip-type-option:has(input:checked) {
  border-color: var(--primary);
  background: #edf7f1;
}

.trip-type-option input { width: auto; padding: 0; margin: 0; }
.trip-type-icon { font-size: 1.4rem; flex-shrink: 0; }
.trip-type-text { display: flex; flex-direction: column; gap: 2px; }
.trip-type-text strong { color: var(--text); font-size: 0.92rem; }
.trip-type-text small { color: var(--text-muted); font-size: 0.78rem; }

.client-suggestions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.client-suggestion-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  font-size: 0.85rem;
}

.client-suggestion-item:hover { background: #f0f2f4; }
.client-suggestion-item .cs-name { font-weight: 600; color: var(--text); }
.client-suggestion-item .cs-pet { color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; }

.client-selected {
  padding: 8px 12px;
  background: #edf7f1;
  border: 1px solid var(--primary);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--primary-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.client-selected button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-input {
  width: 100%;
  max-width: 400px;
  margin-bottom: 14px;
}

.client-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
}

.client-item:hover { border-color: var(--primary); }
.client-item .ci-name { font-weight: 600; }
.client-item .ci-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal h2 { margin-top: 0; }

.report-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 16px 0;
}

.report-hero .rh-label { font-size: 0.8rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.5px; }
.report-hero .rh-value { font-size: 2rem; font-weight: 800; margin: 4px 0; }
.report-hero .rh-sub { font-size: 0.85rem; opacity: 0.85; display: flex; gap: 16px; flex-wrap: wrap; }

.composition-bar {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: #f0f2f4;
  margin: 10px 0;
}

.composition-bar .cost { background: var(--danger); }
.composition-bar .profit { background: var(--primary); }

.report-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.report-row:last-child { border-bottom: none; }

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-dark);
  padding: 20px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow);
}

.auth-brand {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

.auth-message {
  font-size: 0.85rem;
  color: var(--primary-dark);
  min-height: 1.2em;
  text-align: center;
}

.sidebar-spacer { flex: 1; }

.sync-status {
  padding: 8px 20px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
}

@media (max-width: 768px) {
  .app { flex-direction: column; }

  .mobile-topbar { display: flex; }

  .sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    height: 100vh;
    width: 240px;
    z-index: 100;
    transition: left 0.25s ease;
    box-shadow: 2px 0 16px rgba(0,0,0,0.35);
  }

  .sidebar.open { left: 0; }

  .sidebar-overlay.show { display: block; }

  .content { padding: 16px; max-width: 100%; }

  .cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

  .form-row-2 { grid-template-columns: 1fr; }

  .form-grid { max-width: 100%; }

  fieldset { padding: 14px; }

  .price-breakdown .row,
  .cost-summary .row {
    flex-direction: column;
    gap: 1px;
    padding: 6px 0;
  }

  table { font-size: 0.8rem; }
  th, td { padding: 8px; }

  .modal { width: 94%; padding: 18px; }

  .auth-card { padding: 24px 20px; }
}

.radio-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.radio-inline {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.radio-inline input { width: auto; }

#maintenance-detalhada, #fixed-costs-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.calc-result {
  background: #f0f2f4;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.cost-summary {
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 0.9rem;
}

.cost-summary .cs-title {
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.cost-summary .row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.cost-summary .row.total {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 8px;
  font-weight: 700;
  font-size: 1rem;
}

/* ---------- Agenda ---------- */
.ag-new { background: var(--surface, #fff); border: 1px solid var(--border, #e4e1d8); border-radius: 10px; padding: 10px 14px; margin: 10px 0 14px; }
.ag-new summary { cursor: pointer; font-weight: 700; color: var(--primary-dark, #1b4332); }
.ag-form { display: grid; gap: 12px; margin-top: 12px; max-width: 520px; }
.ag-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.ag-form label.ag-inline { display: inline-flex; flex-direction: row; gap: 6px; margin-right: 14px; font-weight: 500; }
.ag-label { font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.ag-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.ag-slot { padding: 9px 0; border: 1.5px solid var(--border, #e4e1d8); border-radius: 8px; background: #fff; font-weight: 700; cursor: pointer; }
.ag-slot.sel { background: var(--primary, #2d6a4f); border-color: var(--primary, #2d6a4f); color: #fff; }
.ag-error { background: #fdecea; border: 1px solid #e6a49c; color: #8a2a1f; border-radius: 8px; padding: 10px 12px; font-size: 0.85rem; }
.ag-card { display: flex; gap: 14px; background: #fff; border: 1px solid var(--border, #e4e1d8); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.ag-card.dead { opacity: 0.6; }
.ag-time { min-width: 62px; font-size: 1.25rem; font-weight: 800; color: var(--primary-dark, #1b4332); }
.ag-time small { display: block; font-size: 0.7rem; font-weight: 500; color: var(--text-muted, #8a9385); }
.ag-body { flex: 1; font-size: 0.9rem; line-height: 1.5; }
.ag-line1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ag-muted { color: var(--text-muted, #5c6b58); font-size: 0.82rem; }
.ag-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ag-actions button { padding: 6px 12px; font-size: 0.8rem; }
.ag-badge { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.ag-confirmed { background: #fff3cd; color: #8a6d00; }
.ag-in_progress { background: #cfe2ff; color: #084298; }
.ag-completed { background: #d1e7dd; color: #0f5132; }
.ag-cancelled, .ag-no_show { background: #f8d7da; color: #842029; }

/* ---------- Serviços ---------- */
.sv-table input[type=text], .sv-table input[type=number], .sv-table select { width: 100%; min-width: 80px; padding: 6px 8px; }
.sv-table td:first-child input { min-width: 180px; }
.sv-table tr.sv-off { opacity: 0.55; }
.sv-add-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; max-width: 900px; }
.sv-add-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; }

.ag-alert { background: #fff3cd; border: 1px solid #e8a33d; color: #8a4b12; border-radius: 8px; padding: 10px 14px; font-size: 0.88rem; font-weight: 600; margin: 8px 0 12px; }
.ag-taxi { border-radius: 8px; padding: 10px 12px; margin-top: 8px; font-size: 0.85rem; border: 1px solid var(--border, #e4e1d8); }
.ag-taxi.pend { background: #fff8ec; border-color: #e8a33d; }
.ag-taxi.quo { background: #eef4ff; border-color: #9db8ee; }
.ag-taxi.ok { background: #e8f2ec; border-color: #7fb69a; }
.ag-taxi-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.ag-taxi-row input { width: 110px; padding: 6px 8px; }
.ag-link { display: inline-block; text-decoration: none; padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; }

/* ---------- Celular (app da Fran) ---------- */
@media (max-width: 768px) {
  .content input[type=text], .content input[type=tel], .content input[type=number], .content input[type=date], .content select, .content textarea { font-size: 16px; min-height: 44px; }
  .content button, .content .btn-primary, .content .btn-secondary, .content .btn-danger { min-height: 44px; }
  .nav-btn { min-height: 46px; }

  /* Agenda */
  .filters { gap: 8px; }
  .filters input[type=date] { flex: 1 1 140px; }
  .filters button { flex: 1 1 auto; }
  .ag-card { flex-direction: column; gap: 8px; padding: 12px; }
  .ag-time { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
  .ag-actions { gap: 8px; }
  .ag-actions button, .ag-actions .ag-link { flex: 1 1 45%; min-height: 44px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
  .ag-taxi-row { flex-direction: column; align-items: stretch; }
  .ag-taxi-row input, .ag-taxi-row button { width: 100%; }
  .ag-taxi-row a { padding: 6px 0; }
  .ag-form { max-width: 100%; }
  .ag-slots { grid-template-columns: repeat(3, 1fr); }
  .ag-slot { min-height: 46px; }

  /* Serviços: cada serviço vira um cartão em vez de uma tabela */
  .sv-table, .sv-table tbody, .sv-table tr, .sv-table td { display: block; width: 100%; }
  .sv-table thead { display: none; }
  .sv-table tr { background: #fff; border: 1px solid var(--border, #e4e1d8); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
  .sv-table td { padding: 6px 0; border: 0; }
  .sv-table td::before { content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-muted, #5c6b58); margin-bottom: 3px; }
  .sv-table td[data-label="Ativo"] { display: flex; align-items: center; gap: 10px; }
  .sv-table td[data-label="Ativo"]::before { margin: 0; }
  .sv-table input[type=checkbox] { width: 24px; height: 24px; }
  .sv-table td:first-child input { min-width: 0; }
  .sv-table .sv-save { width: 100%; }
  .sv-add-form { grid-template-columns: 1fr; }
}

/* Agenda: avisos agrupados e botões objetivos (PC e celular) */
.ag-notices { background: #fff8e1; border: 1px solid #ecd28a; border-radius: 12px; margin: 8px 0 14px; overflow: hidden; }
.ag-notices:not(:has(.ag-alert:not([hidden]))) { display: none; }
.ag-notices .ag-alert { background: transparent; border: none; border-radius: 0; margin: 0; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ag-notices .ag-alert[hidden] { display: none; }
.ag-notices .ag-alert + .ag-alert:not([hidden]) { border-top: 1px solid #ecd28a; }
.ag-notices .ag-alert button { margin: 0 !important; flex: 0 0 auto; padding: 8px 16px; font-size: 0.85rem; min-height: 40px; }
.ag-actions { align-items: center; }
.ag-actions > button { flex: 0 0 auto; min-width: 130px; }
@media (max-width: 768px) {
  .ag-actions > button { flex: 1 1 45%; }
  .ag-notices .ag-alert { flex-wrap: nowrap; }
  .ag-notices .ag-alert span { flex: 1 1 auto; }
}

/* Dias e horários de atendimento */
.hr-row { display: grid; grid-template-columns: 190px 1fr auto; align-items: start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border, #e4e1d8); }
.hr-row:last-child { border-bottom: none; }
.hr-day { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; margin: 0; min-height: 40px; }
.hr-day input { width: 22px; height: 22px; flex: 0 0 auto; }
.hr-times input[type="time"] { padding: 8px 10px; font-size: 1rem; border: 1px solid var(--border, #e4e1d8); border-radius: 8px; background: #fff; }
.hr-times em { font-style: normal; color: #777; margin: 0 8px; }
.hr-line { display: flex; align-items: center; flex-wrap: wrap; }
.hr-closed { display: none; color: #999; line-height: 40px; }
.hr-lunch-toggle { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 0.9rem; color: #555; font-weight: 400; cursor: pointer; }
.hr-lunch-toggle input { width: 18px; height: 18px; }
.hr-lunch-times { display: none; margin-top: 8px; }
.hr-row.lunch .hr-lunch-times { display: flex; }
.hr-row.off .hr-open { display: none; }
.hr-row.off .hr-closed { display: inline; }
.hr-row.off .hr-name { color: #999; }
.hr-status { font-size: 0.8rem; min-width: 90px; text-align: right; line-height: 40px; }
.hr-status.ok { color: #1d6b3a; }
.hr-status.err { color: #b3261e; font-weight: 600; line-height: 1.2; padding-top: 6px; }
@media (max-width: 768px) {
  .hr-row { grid-template-columns: 1fr auto; grid-template-areas: "day status" "times times"; row-gap: 6px; }
  .hr-day { grid-area: day; }
  .hr-status { grid-area: status; }
  .hr-times { grid-area: times; }
  .hr-times input[type="time"] { min-height: 44px; flex: 1 1 0; min-width: 0; }
  .hr-line em { flex: 0 0 auto; }
  .hr-lunch-toggle { min-height: 44px; }
}

/* Serviços: botão Excluir ao lado de Salvar */
.sv-actions { display: flex; gap: 8px; white-space: nowrap; }
.sv-del { background: #fff; color: #b3261e; border: 1px solid #e3b7b3; border-radius: 8px; padding: 8px 12px; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.sv-del:hover { background: #fdf0ef; }
@media (max-width: 768px) {
  .sv-table td.sv-actions { display: flex; gap: 8px; }
  .sv-table .sv-actions .sv-save { flex: 1 1 auto; width: auto; }
  .sv-table .sv-actions .sv-del { flex: 0 0 auto; min-height: 44px; padding: 8px 16px; }
}

/* Padrão de avisos: erro ou indisponível = vermelho e negrito (mesmo estilo no painel e na página do cliente) */
.is-error, .hint.is-error, .empty-state.is-error { color: #b3261e !important; font-weight: 700; }
.ag-error { background: #fdecea; border: 1px solid #e6a49c; color: #b3261e; font-weight: 700; }
.toast-error { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); background: #fdecea; color: #b3261e; border: 1px solid #e6a49c; font-weight: 700; padding: 12px 18px; border-radius: 8px; font-size: 0.92rem; line-height: 1.4; z-index: 1000; box-shadow: 0 4px 14px rgba(0,0,0,0.18); text-align: center; }

/* Administração geral */
.adm-h2 { font-size: 1.1rem; margin: 22px 0 10px; }
.adm-form { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 10px; align-items: end; margin-top: 10px; }
.adm-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 600; margin: 0; }
.adm-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.adm-card.off { opacity: 0.7; }
.adm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.adm-meta { color: var(--text-muted); font-size: 0.82rem; margin: 6px 0 10px; }
.adm-people { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.adm-chip { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: 0.8rem; word-break: break-all; }
.adm-chip em { font-style: normal; color: var(--text-muted); margin-left: 4px; }
.adm-link { display: flex; gap: 8px; margin-bottom: 10px; }
.adm-link input { flex: 1 1 auto; min-width: 0; font-size: 0.85rem; }
.adm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-toggle { background: #fff; color: #b3261e; border: 1px solid #e3b7b3; border-radius: 8px; padding: 8px 12px; font-weight: 600; cursor: pointer; }
.adm-addrow { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 10px; }
@media (max-width: 768px) {
  .adm-form { grid-template-columns: 1fr; }
  .adm-form button, .adm-actions button, .adm-link button { min-height: 44px; }
  .adm-actions button { flex: 1 1 45%; }
  .adm-addrow { grid-template-columns: 1fr; }
  .adm-link { flex-direction: column; }
}
