/* ============ Reset & base ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 300;
  color: #1a1a1a;
  background: #fafaf7;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #111;
  margin: 0 0 0.5em 0;
}
h1 { font-size: 3rem; line-height: 1.1; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; font-weight: 600; }

p { margin: 0 0 1rem 0; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

/* ============ Header ============ */
.site-header {
  border-bottom: 1px solid #e8e6de;
  background: #fafaf7;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: 'Cormorant Garamond', serif;
}
.brand-mark { color: #b8955e; font-size: 1.2rem; }
.brand-name { font-size: 1.4rem; font-weight: 600; letter-spacing: 0.02em; }
.site-nav { display: flex; gap: 2rem; }
.site-nav a {
  font-size: 0.9rem;
  font-weight: 400;
  color: #4a4a4a;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: color 0.2s;
}
.site-nav a:hover, .site-nav a.active { color: #b8955e; }

/* ============ Footer ============ */
.site-footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid #e8e6de;
  font-size: 0.8rem;
  color: #777;
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-actions { display: flex; gap: 1.25rem; }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #777;
  font-size: 0.8rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.link-btn:hover { color: #b8955e; }

main { padding: 3rem 0 4rem; flex: 1; }

/* ============ Home / Cardápio ============ */
.home-hero {
  text-align: center;
  margin-bottom: 4rem;
}
.home-hero h1 { font-size: 3.5rem; margin-bottom: 0.5rem; }
.home-hero .subtitle {
  font-size: 1.1rem;
  color: #6a6a6a;
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
}

.home-stats-mini {
  font-size: 0.75rem;
  color: #999;
  letter-spacing: 0.08em;
  margin-top: 0.75rem;
  text-align: center;
}

.grid-dishes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
}
.card-dish {
  background: #fff;
  border: 1px solid #ebe9e1;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.card-dish:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}
.card-photo {
  aspect-ratio: 4 / 3;
  background: #f0ede3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-photo .placeholder {
  color: #b8955e;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-style: italic;
}
.card-body { padding: 1.5rem 1.75rem 1.75rem; }
.card-body h3 { font-size: 1.35rem; margin-bottom: 0.3rem; }
.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #ebe9e1;
}
.card-meta strong { color: #1a1a1a; font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 0.95rem; }

/* ============ Breadcrumb do cliente no header ============ */
.brand-cliente {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  color: #888;
  letter-spacing: 0.02em;
  margin-left: 0.3rem;
  text-transform: none;
}

/* ============ Sub-ficha card (kitchen mode / custo mode) ============ */
.sf-card {
  background: #fff;
  border: 1px solid #ebe9e1;
  padding: 1.75rem 2rem;
  margin-bottom: 1.25rem;
  scroll-margin-top: 80px;  /* compensa action-bar sticky + nav */
}
.sf-card.sf-final {
  border-left: 3px solid #b8955e;
  background: #fffdf8;
}
.sf-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #f0ede3;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.sf-num-name {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.sf-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  color: #b8955e;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.sf-title, .sf-cost-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0;
  display: inline;
}
.sf-final-tag {
  display: inline-block;
  background: #b8955e;
  color: #fff;
  font-size: 0.65rem;
  padding: 0.2rem 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-left: 0.5rem;
}
.sf-rend-inline {
  font-size: 0.88rem;
  white-space: nowrap;
}

/* Ficha custo version */
.sf-cost-card {
  background: #fff;
  border: 1px solid #ebe9e1;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  scroll-margin-top: 1rem;
}
.sf-cost-card.sf-final {
  border-left: 3px solid #b8955e;
}
.sf-cost-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

/* Quick-nav */
.sf-quicknav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ebe9e1;
}
.sf-quicknav a {
  font-size: 0.78rem;
  padding: 0.35rem 0.8rem;
  background: #f7f5ee;
  border: 1px solid #ebe9e1;
  color: #4a4a4a;
  text-decoration: none;
  transition: all 0.15s;
}
.sf-quicknav a:hover {
  background: #b8955e;
  border-color: #b8955e;
  color: #fff;
}
.sf-quicknav a.is-final {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}
.sf-quicknav a.is-final:hover { background: #b8955e; border-color: #b8955e; }

/* Action bar — sticky */
.ficha-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fafaf7;
  border-bottom: 1px solid #ebe9e1;
}
.export-actions { display: flex; gap: 0.5rem; }
.export-actions .btn-small { padding: 0.45rem 0.85rem; font-size: 0.78rem; }

.ficha-header-v2 {
  margin-bottom: 0.5rem;
}
.ficha-header-v2 .back-link {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: #888;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ficha-header-v2 h1 {
  font-size: 2.5rem;
  margin: 0;
  line-height: 1.1;
}

.cost-total-note {
  font-size: 0.82rem;
  font-style: italic;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f7f5ee;
  border-left: 2px solid #b8955e;
}

/* ============ Ficha (dish detail) ============ */
.ficha-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e8e6de;
}
.ficha-header .back-link {
  font-size: 0.85rem;
  color: #888;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 1rem;
}
.ficha-header .back-link:hover { color: #b8955e; }
.ficha-header h1 { font-size: 3rem; margin-bottom: 0.5rem; }

/* Gallery — fotos compactas, centralizadas quando 1-2 */
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 0 auto 2rem;
  max-width: 600px;
}
.gallery .photo {
  flex: 0 1 180px;
  min-width: 140px;
}
.gallery .photo {
  aspect-ratio: 4 / 3;
  background: #f0ede3;
  overflow: hidden;
}
.gallery .photo img { width: 100%; height: 100%; object-fit: cover; }

/* Toggle views */
.view-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
  gap: 0;
  border: 1px solid #d8d5cb;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.view-toggle button {
  background: transparent;
  border: none;
  padding: 0.7rem 1.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #666;
  transition: all 0.2s;
}
.view-toggle button.active {
  background: #1a1a1a;
  color: #fff;
}

/* Sub-ficha tabs */
.subficha-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid #e8e6de;
}
.subficha-tabs button {
  background: none;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  color: #666;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.05rem;
}
.subficha-tabs button.active {
  color: #1a1a1a;
  border-bottom-color: #b8955e;
}
.subficha-tabs button:hover { color: #1a1a1a; }

/* Ficha sections */
.ficha-body {
  background: #fff;
  border: 1px solid #ebe9e1;
  padding: 3rem;
  max-width: 1000px;
  margin: 0 auto;
}
.ficha-body h2 {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 2rem;
}
.ficha-meta-line {
  text-align: center;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #888;
  margin-bottom: 2rem;
}
.ficha-meta-line strong { color: #1a1a1a; font-weight: 500; }

table.ficha-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.ficha-table th {
  text-align: left;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid #d8d5cb;
}
.ficha-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid #f0ede3;
  vertical-align: top;
}
.ficha-table tr:last-child td { border-bottom: none; }
.ficha-table td.num, .ficha-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ficha-table tfoot td {
  font-weight: 600;
  border-top: 2px solid #1a1a1a;
  border-bottom: none;
  padding-top: 1rem;
}

/* Sub-ficha reference styling */
.row-subref td:first-child { color: #1a1a1a; }
.subref-cell { font-style: italic; }
.subref-arrow { color: #b8955e; font-style: normal; font-weight: 600; margin-right: 0.2rem; }
.subref-note { color: #999; font-size: 0.82rem; font-style: italic; }

/* Fator de correção badge */
.fc-badge { color: #b8955e; font-size: 0.75rem; font-weight: 500; cursor: help; }
.fc-badge[title]:hover { text-decoration: underline dotted; }

/* ============ Insumos: filter chips + actions ============ */
.insumos-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.insumo-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #ebe9e1;
}
.chip-filter {
  font-size: 0.78rem;
  padding: 0.35rem 0.85rem;
  background: #f7f5ee;
  border: 1px solid #ebe9e1;
  color: #555;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.chip-filter:hover { border-color: #b8955e; color: #b8955e; }
.chip-filter.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

/* ============ Sub-ficha editor: acordeão ============ */
.subficha-editor {
  border: 1px solid #ebe9e1;
  background: #fff;
  margin-bottom: 0.75rem;
  padding: 0;
}
.subficha-editor[open] {
  background: #fafaf7;
  border-color: #d8d5cb;
}
.subficha-editor-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  list-style: none;
}
.subficha-editor-summary::-webkit-details-marker { display: none; }
.sf-editor-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  color: #b8955e;
  font-weight: 600;
}
.sf-editor-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sf-editor-meta {
  font-size: 0.78rem;
  color: #888;
  white-space: nowrap;
}
.sf-editor-chev {
  color: #888;
  font-size: 0.85rem;
  transition: transform 0.2s;
}
.subficha-editor[open] .sf-editor-chev { transform: rotate(180deg); }
.sf-editor-actions { display: flex; gap: 0.3rem; margin-left: 0.5rem; }
.subficha-editor > *:not(summary) { padding: 0 1.1rem; }
.subficha-editor > *:not(summary):last-child { padding-bottom: 1rem; }

/* ============ Sticky save bar ============ */
.sticky-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: #1a1a1a;
  color: #fff;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 0 -2rem -4rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
.sticky-save-bar .muted { color: #d8d5cb; }
.sticky-save-bar .btn { color: #1a1a1a; background: #fff; border-color: #fff; }
.sticky-save-bar .btn-primary { background: #b8955e; color: #fff; border-color: #b8955e; }

/* ============ Scroll hint para tabelas mobile ============ */
.insumos-table-wrap, .ficha-section {
  position: relative;
}
@media (max-width: 640px) {
  .insumos-table-wrap::after, .ficha-section::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to right, transparent, rgba(250, 250, 247, 0.9));
    pointer-events: none;
    opacity: 0.8;
  }
}

.ficha-section { margin-top: 2.5rem; }
.ficha-section h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #888;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  border-bottom: 1px solid #e8e6de;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.modo-preparo { white-space: pre-line; line-height: 1.8; font-size: 0.95rem; }

/* Cost summary */
.cost-summary {
  background: #f7f5ee;
  padding: 1.75rem 2rem;
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}
.cost-summary .stat { }
.cost-summary .stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #888;
  display: block;
  margin-bottom: 0.25rem;
}
.cost-summary .stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: #1a1a1a;
}
.cost-summary .stat-value.accent { color: #b8955e; }
.cost-summary input {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 600;
  border: none;
  background: transparent;
  width: 100%;
  border-bottom: 1px dashed #b8955e;
  padding: 2px 0;
}

.total-dish-cost {
  margin-top: 3rem;
  padding: 2rem;
  background: #1a1a1a;
  color: #fff;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  text-align: center;
}
.total-dish-cost .stat-label { color: #999; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; display: block; margin-bottom: 0.3rem; }
.total-dish-cost .stat-value { font-family: 'Cormorant Garamond', serif; font-size: 2.2rem; }
.total-dish-cost .stat-value.gold { color: #d8b878; }

/* Export buttons */
.ficha-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.btn {
  background: #fff;
  border: 1px solid #1a1a1a;
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #1a1a1a;
  transition: all 0.2s;
  font-weight: 500;
}
.btn:hover { background: #1a1a1a; color: #fff; }
.btn-primary { background: #1a1a1a; color: #fff; }
.btn-primary:hover { background: #b8955e; border-color: #b8955e; }
.btn-danger { border-color: #a63a2a; color: #a63a2a; }
.btn-danger:hover { background: #a63a2a; color: #fff; }
.btn-small { padding: 0.45rem 0.9rem; font-size: 0.72rem; }

/* Info boxes (louça, equipamentos) */
.info-box {
  background: #f7f5ee;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}
.info-box strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  margin-bottom: 0.3rem;
  font-weight: 500;
}
.equipamentos-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.equipamentos-list .chip {
  background: #fff;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  border: 1px solid #e0ddd2;
}

/* ============ Insumos page ============ */
.insumos-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.insumos-header h1 { margin-bottom: 0; }
.insumos-search {
  width: 300px;
  max-width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid #d8d5cb;
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
}
table.insumos-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #ebe9e1;
}
.insumos-table th {
  background: #f7f5ee;
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  font-weight: 500;
  border-bottom: 1px solid #d8d5cb;
}
.insumos-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0ede3;
  font-size: 0.95rem;
}
.insumos-table input {
  padding: 0.4rem 0.6rem;
  border: 1px solid #e0ddd2;
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  width: 100%;
}
.insumos-table input[type=number] { max-width: 140px; font-variant-numeric: tabular-nums; }
.insumos-table input.unit-input { max-width: 80px; }
.insumos-table .unit-select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #e0ddd2;
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
  max-width: 120px;
}
.insumos-table .unit-select:disabled { background: #f7f5ee; cursor: not-allowed; color: #888; }
.unit-select {
  padding: 0.5rem 0.7rem;
  border: 1px solid #d8d5cb;
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
}

/* ============ Admin ============ */
.admin-panel {
  background: #fff;
  border: 1px solid #ebe9e1;
  padding: 2rem;
  margin-bottom: 2rem;
}
.admin-panel h2 { margin-top: 0; }
.dish-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1rem;
}
.dish-admin-item {
  background: #fafaf7;
  border: 1px solid #ebe9e1;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.dish-admin-item .info { flex: 1; min-width: 0; }
.dish-admin-item .info h4 { margin: 0 0 0.2rem 0; font-family: 'Cormorant Garamond', serif; }
.dish-admin-item .info p { margin: 0; font-size: 0.8rem; color: #888; }
.dish-admin-actions { display: flex; gap: 0.4rem; }

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
label.field { display: block; }
label.field span.label-text {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  margin-bottom: 0.35rem;
  font-weight: 500;
}
label.field input, label.field textarea, label.field select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid #d8d5cb;
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
}
label.field textarea { min-height: 90px; resize: vertical; }

.photo-upload {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.photo-slot {
  aspect-ratio: 1;
  border: 2px dashed #d8d5cb;
  background: #fafaf7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #b8955e;
  position: relative;
  overflow: hidden;
  font-family: 'Cormorant Garamond', serif;
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  display: none;
}
.photo-slot:hover .remove { display: block; }

.subficha-editor {
  background: #fafaf7;
  border: 1px solid #ebe9e1;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-sizing: border-box;
  max-width: 100%;
}
.subficha-editor h4 {
  margin: 0 0 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ingredient-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 0.7fr) minmax(0, 0.7fr) minmax(0, 1.4fr) minmax(0, 0.6fr) auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}
.ingredient-row input, .ingredient-row select {
  padding: 0.45rem 0.6rem;
  border: 1px solid #e0ddd2;
  background: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.ingredient-row button {
  padding: 0.35rem 0.6rem;
  font-size: 0.72rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.equipamentos-select {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.4rem;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #e0ddd2;
  padding: 0.85rem;
  background: #fff;
}
.equipamentos-select label {
  font-size: 0.85rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  cursor: pointer;
}

/* ============ Login landing / info screens ============ */
.login-landing {
  text-align: center;
  max-width: 500px;
  margin: 4rem auto;
}
.login-landing h1 { font-size: 3rem; margin-bottom: 0.5rem; }
.login-landing .subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  color: #6a6a6a;
  font-style: italic;
  margin-bottom: 2rem;
}
.btn-lg { padding: 1rem 2.5rem; font-size: 0.95rem; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2.5rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.page-header h1 { margin-bottom: 0.25rem; }
.page-header p { color: #6a6a6a; margin: 0; }
.muted { color: #888; }

.empty-state {
  background: #fff;
  border: 1px solid #ebe9e1;
  padding: 3rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

/* ============ Clientes (restaurant) grid ============ */
.cliente-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.cliente-card {
  background: #fff;
  border: 1px solid #ebe9e1;
  padding: 2rem 1.75rem;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.cliente-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.06);
  border-color: #b8955e;
}
.cliente-card h3 {
  font-size: 1.6rem;
  margin: 0 0 0.5rem 0;
}
.cliente-card p { margin: 0; font-size: 0.8rem; }

/* ============ Credito de consultoria ============ */
.consultor-credit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin: -1rem auto 2.5rem;
  padding: 0.75rem 1.5rem;
  text-align: center;
  max-width: 500px;
  border-top: 1px solid #ebe9e1;
  border-bottom: 1px solid #ebe9e1;
}
.consultor-credit .consultor-by {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #999;
  font-weight: 500;
}
.consultor-credit .consultor-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: #1a1a1a;
  letter-spacing: 0.02em;
}
.consultor-credit .consultor-info {
  font-size: 0.78rem;
  color: #888;
  font-style: italic;
  margin-top: 0.1rem;
}
.consultor-credit-ficha {
  display: block;
  margin: 0 0 1.25rem;
  padding: 0.55rem 0.9rem;
  border: none;
  border-left: 2px solid #b8955e;
  background: #faf8f2;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: #6a6a6a;
  font-style: italic;
  letter-spacing: 0.01em;
  line-height: 1.4;
  max-width: none;
  text-align: left;
}
@media (max-width: 640px) {
  .consultor-credit { margin: -0.5rem 0 1.75rem; padding: 0.6rem 0.9rem; }
  .consultor-credit .consultor-name { font-size: 1.05rem; }
  .consultor-credit-ficha { padding: 0.45rem 0.75rem; margin-bottom: 1rem; font-size: 0.78rem; }
}

/* ============ Cardápio list (home) ============ */
.cardapio-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.dish-group {
  background: #fff;
  border: 1px solid #ebe9e1;
  padding: 1.75rem 2rem;
}
.dish-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ebe9e1;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.dish-title {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.dish-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: #b8955e;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  font-weight: 500;
  flex-shrink: 0;
}
.dish-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.15;
}
.dish-title:hover .dish-name { color: #b8955e; }
.dish-meta {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0.4rem 1rem;
  font-size: 0.8rem;
  color: #555;
  flex-shrink: 0;
}
.dish-meta em {
  font-style: normal;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
}
.dish-meta .meta-item { white-space: nowrap; }

.subficha-sublist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.subficha-item a {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding: 0.55rem 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px dotted #f0ede3;
  transition: color 0.15s, padding 0.15s;
}
.subficha-item:last-child a { border-bottom: none; }
.subficha-item a:hover {
  color: #b8955e;
  padding-left: 0.25rem;
}
.sf-marker {
  color: #b8955e;
  font-size: 0.7rem;
  width: 1em;
  flex-shrink: 0;
}
.subficha-item.is-final .sf-marker { color: #1a1a1a; }
.sf-name {
  flex: 1;
  font-size: 0.98rem;
  min-width: 0;
  word-break: break-word;
}
.subficha-item.is-final .sf-name { font-weight: 500; }
.sf-rend {
  font-size: 0.8rem;
  color: #888;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Context bar (breadcrumb + cliente quick links) — legacy, mantido só por compat */
.context-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ebe9e1;
  flex-wrap: wrap;
  gap: 1rem;
}
.ctx-links { display: flex; gap: 1.5rem; }
.ctx-link {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #666;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.ctx-link:hover { color: #b8955e; border-bottom-color: #b8955e; }

/* ============ Nova navegação do cliente (tabs) ============ */
.cliente-nav {
  margin-bottom: 2rem;
}
.cliente-back {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #999;
  padding: 0.75rem 0 0.5rem;
  text-decoration: none;
  transition: color 0.15s;
}
.cliente-back:hover { color: #b8955e; }

.cliente-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #ebe9e1;
  margin-top: 0.25rem;
}
.cliente-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #777;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  white-space: nowrap;
}
.cliente-tab:hover { color: #1a1a1a; background: #f7f5ee; }
.cliente-tab.active {
  color: #1a1a1a;
  border-bottom-color: #b8955e;
  font-weight: 600;
}
.cliente-tab.active .tab-icon { color: #b8955e; }
.cliente-tab .tab-icon {
  font-size: 1rem;
  color: #b8955e;
  line-height: 1;
}

@media (max-width: 640px) {
  .cliente-nav { margin-bottom: 1.5rem; }
  .cliente-back { font-size: 0.7rem; padding: 0.4rem 0 0.2rem; }
  .cliente-tabs { gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cliente-tab {
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    gap: 0.4rem;
    flex-shrink: 0;
  }
  .cliente-tab .tab-icon { font-size: 0.9rem; }
}

/* ============ Admin panel / page structure ============ */
.admin-panel-card {
  background: #fff;
  border: 1px solid #ebe9e1;
  padding: 2rem 2.25rem;
  margin-bottom: 2rem;
}
.admin-panel-card h3 {
  margin: 0 0 0.3rem 0;
  font-size: 1.5rem;
}
.admin-panel-card .muted { margin-bottom: 1.5rem; font-size: 0.9rem; }
.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #888;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  margin: 2.5rem 0 1rem;
}
.panel-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}
.inline-form {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}
.inline-input {
  flex: 1;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d8d5cb;
  background: #fff;
  font-family: inherit;
  font-size: 1rem;
}
.inline-input:focus { outline: none; border-color: #b8955e; }

/* ============ Cliente admin cards ============ */
.cliente-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.cliente-admin-card {
  background: #fff;
  border: 1px solid #ebe9e1;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cc-head { border-bottom: 1px solid #f0ede3; padding-bottom: 1rem; }
.cc-name {
  margin: 0 0 0.35rem 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.55rem;
  font-weight: 500;
  color: #1a1a1a;
}
.cc-id {
  font-size: 0.75rem;
  color: #999;
  font-family: monospace;
}
.cc-actions { display: flex; flex-direction: column; gap: 0.6rem; }
.btn-block { display: block; text-align: center; width: 100%; }
.cc-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}
.btn-accent { border-color: #b8955e; color: #b8955e; }
.btn-accent:hover { background: #b8955e; color: #fff; }

/* ============ User admin cards ============ */
.user-admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.user-card {
  background: #fff;
  border: 1px solid #ebe9e1;
  padding: 1.35rem 1.65rem;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.5rem 1rem;
  align-items: start;
}
.user-card-head {
  grid-row: 1;
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.user-id { min-width: 0; flex: 1; }
.user-name {
  margin: 0 0 0.15rem 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: #1a1a1a;
}
.user-email { font-size: 0.85rem; color: #777; }
.role-badge {
  display: inline-block;
  padding: 0.22rem 0.7rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  border-radius: 2px;
  flex-shrink: 0;
}
.role-master { background: #b8955e; color: #fff; }
.role-staff { background: #2d4a6e; color: #fff; }
.role-cliente { background: #e8e6de; color: #4a4a4a; }
.role-none { background: #f3f3f3; color: #999; }
.user-chips {
  grid-row: 2;
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.user-chip {
  background: #f7f5ee;
  border: 1px solid #e8e6de;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  color: #4a4a4a;
}
.user-actions {
  grid-row: 2;
  grid-column: 2;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

/* ============ Cliente chip picker (invite / edit user) ============ */
.cliente-chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem;
  border: 1px solid #e0ddd2;
  background: #fafaf7;
  min-height: 55px;
  border-radius: 2px;
}
.cliente-chip-picker:empty::before {
  content: 'Nenhum restaurante disponível — cadastre um primeiro em Gerenciar restaurantes';
  color: #999;
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.25rem 0.5rem;
}
.cliente-chip-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #fff;
  border: 1.5px solid #d8d5cb;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  color: #4a4a4a;
  transition: all 0.15s;
  user-select: none;
}
.cliente-chip-option:hover { border-color: #b8955e; color: #1a1a1a; }
.cliente-chip-option:has(input:checked) {
  background: #b8955e;
  border-color: #b8955e;
  color: #fff;
}
.cliente-chip-option:has(input:checked)::after {
  content: '✓';
  font-size: 0.9rem;
}
.cliente-chip-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ============ Update from file modal — opções ============ */
.update-options-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1rem 0 0;
}
.upd-opt {
  display: flex;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid #e0ddd2;
  background: #fafaf7;
  cursor: pointer;
  transition: all 0.15s;
}
.upd-opt:hover { border-color: #b8955e; }
.upd-opt input[type=radio] {
  margin-top: 0.25rem;
  cursor: pointer;
}
.upd-opt:has(input:checked) {
  background: #fff;
  border-color: #b8955e;
  box-shadow: 0 0 0 1px #b8955e;
}
.upd-opt-body { flex: 1; min-width: 0; }
.upd-opt-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}
.upd-opt-icon { font-size: 1rem; }
.upd-opt-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
}
.upd-opt-tag {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.45rem;
  background: #e8e6de;
  color: #555;
  font-weight: 600;
}
.upd-opt-tag.warn { background: #f4d4c4; color: #a63a2a; }
.upd-opt-desc {
  font-size: 0.85rem;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

/* ============ Edit user modal wide ============ */
.modal-content-wide { max-width: 560px; }
.field-wide { grid-column: 1 / -1; }
.modal-read {
  background: #f7f5ee;
  padding: 0.65rem 0.85rem;
  border-left: 2px solid #b8955e;
  margin-bottom: 1rem;
}
.modal-read .label-text { display: block; font-size: 0.7rem; color: #888; margin-bottom: 0.15rem; }
.modal-read > div { font-size: 0.95rem; color: #1a1a1a; }

/* Users table (kept for backwards compat, not used anymore but stays) */
.users-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #ebe9e1;
}
.users-table th {
  background: #f7f5ee;
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  font-weight: 500;
  border-bottom: 1px solid #d8d5cb;
}
.users-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f0ede3;
  font-size: 0.92rem;
  vertical-align: middle;
}

/* ============ Kitchen mode (ficha de trabalho — cozinheiro) ============ */
.kitchen-mode h2 {
  font-size: 2.4rem;
  text-align: left;
  margin-bottom: 0.5rem;
}
.rend-bar {
  background: #f7f5ee;
  padding: 1rem 1.25rem;
  margin: 1rem 0 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  border-left: 3px solid #b8955e;
}
.rend-info { display: flex; flex-direction: column; }
.rend-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #888;
}
.rend-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 600;
}
.scale-ctrl {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  flex-wrap: wrap;
}
.scale-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
}
.scale-ctrl input {
  width: 110px;
  padding: 0.5rem 0.7rem;
  border: 1px solid #d8d5cb;
  background: #fff;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.scale-ctrl input:focus { outline: none; border-color: #b8955e; }
.scale-unit { color: #666; font-size: 0.9rem; }
.btn-ghost { background: transparent; border: 1px solid #b8955e; color: #b8955e; }
.btn-ghost:hover { background: #b8955e; color: #fff; }
.scale-note { margin-top: 0.5rem; width: 100%; font-size: 0.8rem; }

.k-section-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #888;
  font-weight: 500;
  border-bottom: 1px solid #e8e6de;
  padding-bottom: 0.5rem;
  margin: 2rem 0 1rem;
}

.kitchen-ingredients {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}
.kitchen-ing {
  display: block;
  padding: 0.85rem 0;
  border-bottom: 1px dotted #ebe9e1;
}
.kitchen-ing:last-child { border-bottom: none; }
.k-row-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.k-name {
  flex: 1;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.3;
  overflow-wrap: break-word;
}
.k-qty {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.k-qty .qty-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1;
}
.k-qty .qty-unit {
  font-size: 0.88rem;
  color: #666;
  text-transform: lowercase;
}
.k-obs, .k-sub-note {
  display: block;
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
  margin-top: 4px;
  padding-left: 0.25rem;
}
.kitchen-ing.is-subref .k-name { color: #8b6d3a; }
.kitchen-ing.is-subref .k-qty .qty-num { color: #8b6d3a; }

.kitchen-preparo {
  font-size: 1.05rem;
  line-height: 1.8;
  white-space: pre-line;
  color: #1a1a1a;
  font-weight: 300;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Prevent long content overflow */
.k-name, .dish-name, .sf-name, .insumos-table td, .ficha-table td,
.card-body h3, .subficha-editor h4 {
  overflow-wrap: break-word;
  word-wrap: break-word;
  min-width: 0;
}
.ficha-header h1 { word-break: break-word; hyphens: auto; }
.ficha-body h2 { word-break: break-word; }
.ficha-body { overflow: hidden; }

/* Cost summary fix on narrow screens */
@media (max-width: 900px) {
  .cost-summary { grid-template-columns: 1fr 1fr; }
  .total-dish-cost { grid-template-columns: 1fr 1fr; }
}

/* ============ Modal ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal[hidden] { display: none; }
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,26,26,0.55);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: #fff;
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  border: 1px solid #ebe9e1;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-content h2 { margin-top: 0; margin-bottom: 0.25rem; }
.modal-subtitle {
  color: #888;
  font-size: 0.9rem;
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  margin-bottom: 1.5rem;
}
.modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}
.login-error {
  color: #a63a2a;
  font-size: 0.85rem;
  margin: 0.75rem 0 0;
}

/* Auth button in nav */
.auth-btn {
  text-transform: uppercase !important;
  letter-spacing: 0.12em !important;
  font-size: 0.9rem !important;
  color: #4a4a4a !important;
  padding: 0 !important;
}
.auth-btn:hover { color: #b8955e !important; }
.auth-btn.logged-in { color: #b8955e !important; }

/* Admin-only badge visible on nav */
#nav-admin.visible { display: inline !important; }

/* Loading state */
.loading-state { min-height: 50vh; display: flex; align-items: center; justify-content: center; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 0.85rem 1.75rem;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  z-index: 100;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  animation: toast-in 0.3s;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============ Responsive ============ */

/* Tablets */
@media (max-width: 900px) {
  .container { padding: 0 1.5rem; }
  main { padding: 2rem 0 3rem; }
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.8rem; }
  .home-hero h1 { font-size: 2.8rem; }
  .ficha-header h1 { font-size: 2.4rem; }
  .ficha-body { padding: 2rem; }
}

/* Mobile */
@media (max-width: 640px) {
  .container { padding: 0 1rem; }
  main { padding: 1.5rem 0 2.5rem; }

  /* Typography */
  h1 { font-size: 2rem; line-height: 1.15; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  /* Header — stacked */
  .site-header { position: static; }
  .header-inner {
    padding: 0.9rem 1rem;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
  }
  .brand-name { font-size: 1.2rem; }
  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
    border-top: 1px solid #ebe9e1;
    padding-top: 0.6rem;
  }
  .site-nav a { font-size: 0.72rem; letter-spacing: 0.08em; }

  /* Footer */
  .site-footer { padding: 1.25rem 0; font-size: 0.72rem; }
  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
  }
  .footer-actions {
    gap: 1rem;
    flex-wrap: wrap;
  }
  .link-btn { font-size: 0.7rem; }

  /* Home */
  .home-hero { margin-bottom: 2.5rem; }
  .home-hero h1 { font-size: 2.2rem; }
  .home-hero .subtitle { font-size: 0.95rem; }
  .home-stats {
    gap: 1.2rem;
    margin-top: 1.5rem;
    font-size: 0.7rem;
  }
  .home-stats span strong { font-size: 1.4rem; }
  .grid-dishes {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .card-body { padding: 1.25rem 1.25rem 1.5rem; }
  .card-body h3 { font-size: 1.2rem; }
  .card-meta { font-size: 0.72rem; }
  .card-meta strong { font-size: 0.88rem; }

  /* Ficha header */
  .ficha-header { margin-bottom: 1.5rem; padding-bottom: 1.25rem; }
  .ficha-header h1 { font-size: 1.8rem; }
  .ficha-header .back-link { font-size: 0.78rem; margin-bottom: 0.75rem; }

  /* Gallery mobile: centralizadas, max 2 colunas */
  .gallery {
    gap: 0.5rem;
    margin: 0 auto 1.25rem;
    max-width: 280px;
  }
  .gallery .photo { aspect-ratio: 4 / 3; flex: 0 1 130px; min-width: 120px; }

  /* View toggle — full width, 2 buttons flex */
  .view-toggle {
    width: 100%;
    display: flex;
  }
  .view-toggle button {
    flex: 1;
    padding: 0.7rem 0.5rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  /* Sub-ficha tabs: horizontal scroll on mobile */
  .subficha-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .subficha-tabs::-webkit-scrollbar { height: 2px; }
  .subficha-tabs::-webkit-scrollbar-thumb { background: #d8d5cb; }
  .subficha-tabs button {
    flex-shrink: 0;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    white-space: nowrap;
  }

  /* Ficha body: less padding, break edge-to-edge where useful */
  .ficha-body {
    padding: 1.5rem 1rem;
    margin: 0 -1rem;
    border-left: none;
    border-right: none;
  }
  .ficha-body h2 { font-size: 1.6rem; margin-bottom: 1.25rem; }
  .ficha-meta-line { font-size: 0.72rem; letter-spacing: 0.1em; }

  /* Ficha de custo mobile — stacked card compacto */
  .sf-cost-card { padding: 0.9rem 1rem; }
  .sf-cost-head { flex-direction: column; gap: 0.3rem; align-items: flex-start; margin-bottom: 0.6rem; }
  .sf-cost-title { font-size: 1.15rem; }

  /* Tabela vira lista vertical com posicionamento absoluto pro custo */
  .ficha-table, .ficha-table thead, .ficha-table tbody, .ficha-table tfoot, .ficha-table tr {
    display: block;
    width: 100%;
  }
  .ficha-table { font-size: 0.82rem; }
  .ficha-table thead { display: none; }
  .ficha-table tr {
    position: relative;
    padding: 0.65rem 90px 0.65rem 0;  /* espaço à direita para o custo */
    border-bottom: 1px dotted #ebe9e1;
  }
  .ficha-table td {
    display: inline;
    border: none !important;
    padding: 0 !important;
    text-align: left !important;
    font-size: 0.8rem;
    line-height: 1.4;
  }
  .ficha-table td::before { display: none; }
  /* Nome: ocupa linha inteira */
  .ficha-table td:nth-child(1) {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: #1a1a1a;
    font-weight: 500;
    line-height: 1.25;
    margin-bottom: 0.2rem;
  }
  /* Meta (qty, unit, preço) flow inline em linha secundária */
  .ficha-table td:nth-child(2),
  .ficha-table td:nth-child(3),
  .ficha-table td:nth-child(4) {
    display: inline;
    color: #888;
    font-size: 0.78rem;
  }
  .ficha-table td:nth-child(2)::after { content: ' '; }
  .ficha-table td:nth-child(3)::after { content: ' · '; }
  /* Custo: absoluto à direita, centrado verticalmente */
  .ficha-table td:nth-child(5) {
    position: absolute;
    right: 0;
    top: 0.65rem;
    display: block;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.95rem;
    white-space: nowrap;
    text-align: right !important;
  }
  /* tfoot (subtotal) */
  .ficha-table tfoot { display: block; padding-top: 0.3rem; }
  .ficha-table tfoot tr {
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 0.7rem 1rem;
    margin-top: 0.35rem;
    position: relative;
  }
  .ficha-table tfoot td {
    font-family: 'Inter', sans-serif !important;
  }
  .ficha-table tfoot td:first-child {
    display: block;
    padding-right: 90px !important;
    font-size: 0.72rem !important;
    color: #d8d5cb !important;
    font-weight: 400 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .ficha-table tfoot td:last-child {
    position: absolute;
    right: 1rem;
    top: 0.65rem;
    display: block;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
  }
  .sf-final .ficha-table tfoot tr { background: #b8955e; }

  /* Section headers */
  .ficha-section h3 { font-size: 0.85rem; }
  .modo-preparo { font-size: 0.92rem; line-height: 1.7; }

  /* Cost summary / Totals — stack */
  .cost-summary, .total-dish-cost {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem 1.25rem;
    text-align: left;
  }
  .total-dish-cost { padding: 1.5rem; }
  .total-dish-cost > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #2b2b2b;
    padding-bottom: 0.8rem;
  }
  .total-dish-cost > div:last-child { border-bottom: none; padding-bottom: 0; }
  .total-dish-cost .stat-label { margin-bottom: 0; }
  .total-dish-cost .stat-value { font-size: 1.6rem; flex-shrink: 0; }
  .cost-summary .stat {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #e8e6de;
    padding-bottom: 0.8rem;
  }
  .cost-summary .stat:last-child { border-bottom: none; padding-bottom: 0; }
  .cost-summary .stat-label { margin-bottom: 0; }
  .cost-summary .stat-value { font-size: 1.5rem; flex-shrink: 0; }
  .cost-summary input {
    font-size: 1.5rem;
    width: auto;
    max-width: 120px;
    text-align: right;
  }

  /* Ficha actions: stack full-width buttons */
  .ficha-actions { flex-direction: column; gap: 0.6rem; }
  .ficha-actions .btn { width: 100%; }

  /* Info boxes */
  .info-box { padding: 1rem 1.1rem; font-size: 0.9rem; }

  /* Insumos page */
  .insumos-header {
    flex-direction: column;
    align-items: stretch;
  }
  .insumos-header h1 { font-size: 1.8rem; }
  .insumos-search { width: 100%; }

  /* Insumos mobile — formato tabela (com scroll horizontal se precisar) */
  .insumos-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem 0.5rem;
  }
  .insumos-table {
    min-width: 520px;
    width: 100%;
    background: #fff;
    border: 1px solid #ebe9e1;
    font-size: 0.85rem;
  }
  .insumos-table th {
    padding: 0.55rem 0.55rem;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    background: #f7f5ee;
  }
  .insumos-table td {
    padding: 0.5rem 0.55rem;
    vertical-align: middle;
  }
  .insumos-table td:first-child {
    font-weight: 500;
    color: #1a1a1a;
    min-width: 160px;
  }
  .insumos-table input.unit-input { width: 55px; font-size: 0.9rem; padding: 0.3rem 0.4rem; }
  .insumos-table input[type=number] { width: 85px; font-size: 0.9rem; padding: 0.3rem 0.4rem; font-weight: 500; }
  .insumos-table .btn-small { padding: 0.3rem 0.55rem; font-size: 0.68rem; }

  /* Admin page */
  .admin-panel { padding: 1.25rem; }
  .dish-admin-list { grid-template-columns: 1fr; }
  .dish-admin-item {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
  }
  .dish-admin-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  /* Admin edit: stack ingredient row */
  .ingredient-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 0.4rem;
  }
  .ingredient-row > input:nth-child(1) { grid-column: 1 / -1; }
  .ingredient-row > input:nth-child(4) { grid-column: 1 / -1; }
  .ingredient-row button { grid-column: 1 / -1; width: 100%; }

  .form-grid { gap: 1rem; grid-template-columns: 1fr; }
  .photo-upload { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .photo-slot .remove { display: block; }

  .subficha-editor { padding: 1rem; }
  .subficha-editor h4 {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .equipamentos-select { grid-template-columns: 1fr 1fr; }

  /* ---- Cardápio list (mobile) ---- */
  .dish-group { padding: 1.25rem 1.25rem; }
  .dish-head {
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
  }
  .dish-title { gap: 0.65rem; flex-wrap: wrap; }
  .dish-number { font-size: 0.95rem; }
  .dish-name { font-size: 1.35rem; }
  .dish-meta {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.85rem;
    width: 100%;
    font-size: 0.78rem;
  }
  .sf-name { font-size: 0.92rem; }
  .sf-rend { font-size: 0.72rem; }
  .subficha-item a { gap: 0.65rem; padding: 0.5rem 0; flex-wrap: wrap; }

  /* ---- Kitchen mode mobile (modo cozinha) ---- */
  .kitchen-mode h2 { font-size: 1.8rem; line-height: 1.15; word-break: break-word; }
  .rend-bar { flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 0.85rem 1rem; }
  .rend-info { width: 100%; }
  .rend-value { font-size: 1.35rem; }
  .scale-ctrl {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .scale-ctrl input { flex: 0 1 auto; width: 120px; font-size: 1.15rem; padding: 0.55rem 0.7rem; }
  .scale-label { flex-shrink: 0; }
  .scale-unit { flex-shrink: 0; }
  .k-section-title { font-size: 0.72rem; margin: 1.75rem 0 0.75rem; letter-spacing: 0.14em; }

  .kitchen-ingredients { margin-bottom: 1.25rem; }
  .kitchen-ing { padding: 0.85rem 0; }
  .k-row-main { gap: 0.75rem; }
  .k-name { font-size: 1rem; line-height: 1.3; }
  .k-qty { gap: 0.25rem; }
  .k-qty .qty-num { font-size: 1.25rem; }
  .k-qty .qty-unit { font-size: 0.82rem; }
  .k-obs, .k-sub-note { font-size: 0.82rem; }

  .kitchen-preparo { font-size: 1rem; line-height: 1.75; }

  /* Login landing */
  .login-landing { margin: 2rem auto; padding: 1rem; }
  .login-landing h1 { font-size: 2.2rem; }
  .btn-lg { padding: 0.85rem 2rem; }

  /* Cliente cards */
  .cliente-grid { grid-template-columns: 1fr; gap: 1rem; }
  .cliente-card h3 { font-size: 1.3rem; }

  /* Context bar */
  .context-bar { flex-direction: column; align-items: flex-start; gap: 0.75rem; padding-bottom: 0.75rem; margin-bottom: 1.5rem; }
  .ctx-links { width: 100%; justify-content: flex-start; gap: 1rem; flex-wrap: wrap; }
  .ctx-link { font-size: 0.72rem; }

  /* Users table becomes stacked cards */
  .users-table thead { display: none; }
  .users-table, .users-table tbody, .users-table tr { display: block; width: 100%; }
  .users-table { border: none; background: transparent; }
  .users-table tr {
    background: #fff;
    border: 1px solid #ebe9e1;
    padding: 0.85rem 1rem;
    margin-bottom: 0.55rem;
  }
  .users-table td {
    display: flex;
    border: none !important;
    padding: 0.3rem 0 !important;
    font-size: 0.9rem;
    flex-direction: column;
  }
  .users-table td::before {
    content: attr(data-label);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #888;
    margin-bottom: 2px;
  }
  .users-table td:empty::before { display: none; }

  /* Sub-ficha cards mobile */
  .sf-card { padding: 1.15rem 1.1rem; }
  .sf-card-head { flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; padding-bottom: 0.7rem; }
  .sf-num-name { width: 100%; align-items: center; gap: 0.5rem; }
  .sf-title { font-size: 1.35rem; }
  .sf-cost-card { padding: 1rem 1.1rem; }
  .sf-cost-head { flex-direction: column; gap: 0.3rem; align-items: flex-start; }
  .sf-quicknav { gap: 0.35rem; margin-bottom: 1rem; padding-bottom: 0.75rem; }
  .sf-quicknav a { font-size: 0.7rem; padding: 0.3rem 0.6rem; }

  /* Action bar mobile: toggle + exports on same row */
  .ficha-action-bar {
    padding: 0.6rem 0;
    margin: 0 -1rem 0.85rem;
    padding-left: 1rem; padding-right: 1rem;
    position: sticky;
    top: 0;
  }
  .export-actions .btn-small { padding: 0.4rem 0.6rem; font-size: 0.72rem; }
  .ficha-header-v2 h1 { font-size: 1.85rem; }

  /* Breadcrumb no header — compacta em telas pequenas */
  .brand-cliente { font-size: 0.7rem; margin-left: 0.2rem; display: none; }

  /* Update from file modal */
  .upd-opt { padding: 0.75rem; flex-direction: column; gap: 0.4rem; }
  .upd-opt-label { font-size: 1.05rem; }

  /* Admin panels mobile */
  .admin-panel-card { padding: 1.25rem 1.1rem; }
  .admin-panel-card h3 { font-size: 1.2rem; }
  .inline-form { flex-direction: column; gap: 0.5rem; }
  .panel-actions { justify-content: stretch; flex-direction: column; }
  .panel-actions .btn { width: 100%; }

  /* Cliente admin cards mobile */
  .cliente-admin-grid { grid-template-columns: 1fr; gap: 0.85rem; }
  .cliente-admin-card { padding: 1.2rem 1.1rem; }
  .cc-menu { grid-template-columns: repeat(2, 1fr); gap: 0.35rem; }
  .cc-menu .btn-small { padding: 0.45rem 0.55rem; font-size: 0.72rem; }

  /* User cards mobile */
  .user-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 1.1rem 1.15rem;
  }
  .user-card-head { flex-wrap: wrap; gap: 0.6rem; }
  .user-actions {
    grid-row: 3;
    grid-column: 1;
    justify-content: flex-start;
  }
  .role-badge { font-size: 0.62rem; padding: 0.2rem 0.55rem; }

  .cliente-chip-picker { padding: 0.55rem; }
  .cliente-chip-option { font-size: 0.85rem; padding: 0.35rem 0.7rem; }

  /* Modal on mobile */
  .modal-content {
    padding: 1.75rem 1.5rem;
  }
  .modal-content-wide { max-width: 100%; }

  /* Site nav with auth button on mobile */
  .auth-btn { font-size: 0.7rem !important; letter-spacing: 0.08em !important; }

  /* Toast */
  .toast {
    left: 1rem;
    right: 1rem;
    transform: none;
    text-align: center;
    bottom: 1rem;
    font-size: 0.85rem;
  }
  @keyframes toast-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
}

/* Very small phones */
@media (max-width: 380px) {
  .home-stats { gap: 0.8rem; }
  .home-stats span strong { font-size: 1.2rem; }
  .site-nav a { font-size: 0.65rem; }
  .brand-name { font-size: 1.05rem; }
}

/* ============ Print ============ */
@media print {
  body { background: #fff; }
  .site-header, .site-footer, .ficha-actions, .view-toggle, .subficha-tabs { display: none; }
  .ficha-body { border: none; padding: 0; }
}
