
:root {
  --green-950: #111317;
  --green-900: #191c22;
  --green-800: #252932;
  --green-700: #343945;
  --orange-600: #a88333;
  --orange-500: #c7a75a;
  --orange-100: #f6f0df;
  --cream: #f2f4f7;
  --white: #ffffff;
  --text: #20242b;
  --muted: #68707d;
  --border: #d6dae1;
  --danger: #a8212a;
  --danger-bg: #fbeaec;
  --success: #245f47;
  --success-bg: #eaf5ef;
  --warning: #866313;
  --warning-bg: #fbf3d9;
  --blue: #2457a6;
  --blue-bg: #eaf0fb;
  --shadow: 0 18px 55px rgba(17, 19, 23, 0.12);
  --radius: 18px;
  --sidebar-width: 270px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 10%, rgba(199,167,90,.18), transparent 28%),
    radial-gradient(circle at 5% 90%, rgba(36,87,166,.12), transparent 30%),
    var(--cream);
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
}
.auth-panel { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 52px; }
.brand-panel {
  position: relative;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(145deg, rgba(17,19,23,.99), rgba(37,41,50,.95)),
    var(--green-950);
}
.brand-panel::before,
.brand-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
}
.brand-panel::before { width: 520px; height: 520px; right: -180px; top: -160px; }
.brand-panel::after { width: 320px; height: 320px; left: -120px; bottom: -100px; }
.brand-copy { position: relative; z-index: 1; max-width: 650px; }
.brand-logo-large { width: min(520px, 90%); margin-bottom: 52px; background: white; border-radius: 16px; padding: 14px; }
.brand-copy h1 { font-size: clamp(2rem, 4vw, 4rem); line-height: 1.08; margin: 12px 0 22px; }
.brand-copy p:last-child { max-width: 610px; color: rgba(255,255,255,.76); font-size: 1.08rem; }
.form-panel { background: rgba(255,255,255,.72); backdrop-filter: blur(10px); }
.auth-card { width: min(440px, 100%); }
.auth-card h2, .install-card h1 { font-size: 2.1rem; margin: 4px 0 8px; }
.auth-logo { width: 250px; background: white; padding: 9px; border-radius: 12px; margin: 0 auto 26px; }
.mobile-logo { display: none; }
.support-note { margin-top: 22px; color: var(--muted); font-size: .92rem; text-align: center; }

.install-shell { min-height: 100vh; display: grid; place-items: center; padding: 38px 20px; }
.install-card { width: min(820px, 100%); background: white; border-radius: 28px; box-shadow: var(--shadow); padding: clamp(24px, 5vw, 52px); }
.install-card fieldset { border: 1px solid var(--border); border-radius: 16px; padding: 22px; margin: 0; }
.install-card legend { color: var(--green-900); font-weight: 800; padding: 0 8px; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--orange-600);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow.light { color: #ffb087; }
.muted { color: var(--muted); }

.stack-form { display: grid; gap: 18px; margin-top: 24px; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: 7px; font-weight: 700; font-size: .92rem; }
label small { color: var(--muted); font-weight: 500; }
input, select, textarea {
  width: 100%;
  border: 1px solid #c8ced8;
  background: white;
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--orange-500); box-shadow: 0 0 0 4px rgba(199,167,90,.16); }
textarea { resize: vertical; }
.password-field { position: relative; }
.password-field input { padding-right: 52px; }
.show-password {
  position: absolute;
  top: 50%; right: 8px;
  transform: translateY(-50%);
  border: 0; background: transparent; cursor: pointer;
  width: 38px; height: 38px; border-radius: 9px;
}
.show-password:hover { background: var(--cream); }
.checkbox-row { display: flex; gap: 24px; flex-wrap: wrap; }
.check-option { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.check-option input { width: 18px; height: 18px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--orange-600); color: white; box-shadow: 0 8px 22px rgba(168,131,51,.28); }
.btn.primary:hover { background: #8d6b28; }
.btn.secondary { background: var(--green-900); color: white; }
.btn.ghost { background: white; border-color: var(--border); color: var(--green-900); }
.btn.full { width: 100%; }

.alert { border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-weight: 650; }
.alert.success { background: var(--success-bg); color: var(--success); border: 1px solid #cbead7; }
.alert.danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #f4c8c4; }
.alert.warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #f3dfa3; }

.app-page { min-height: 100vh; }
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--green-950);
  color: white;
  padding: 22px 16px;
  overflow-y: auto;
  z-index: 50;
}
.sidebar-brand { display: grid; gap: 10px; text-decoration: none; margin: 0 7px 26px; }
.sidebar-brand img { width: 100%; background: white; border-radius: 10px; padding: 7px; }
.sidebar-brand span { font-weight: 850; letter-spacing: .02em; }
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-nav a {
  color: rgba(255,255,255,.78);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 11px;
  font-weight: 650;
}
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,.10); color: white; }
.sidebar-nav a.active { box-shadow: inset 3px 0 0 var(--orange-500); }
.nav-section { color: rgba(255,255,255,.42); text-transform: uppercase; font-size: .68rem; letter-spacing: .14em; font-weight: 800; margin: 22px 12px 6px; }
.main-column { min-width: 0; display: flex; min-height: 100vh; flex-direction: column; }
.topbar {
  min-height: 78px;
  display: flex; align-items: center; gap: 16px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 13px clamp(18px, 4vw, 38px);
  position: sticky; top: 0; z-index: 30;
}
.menu-button { display: none; width: 42px; height: 42px; border: 1px solid var(--border); background: white; border-radius: 11px; cursor: pointer; }
.topbar-title { margin: 0; font-weight: 850; }
.topbar-subtitle { margin: 1px 0 0; font-size: .78rem; color: var(--muted); }
.user-chip { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip > span:last-child { display: grid; }
.user-chip small { color: var(--muted); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--orange-100); color: var(--orange-600); display: grid; place-items: center; font-weight: 900; }
.content { padding: clamp(22px, 4vw, 42px); flex: 1; min-width: 0; }
.app-footer { display: flex; gap: 18px; justify-content: space-between; color: var(--muted); font-size: .78rem; padding: 18px clamp(22px,4vw,42px); border-top: 1px solid var(--border); }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(1.8rem, 3vw, 2.7rem); line-height: 1.12; margin: 4px 0 7px; color: var(--green-950); }
.page-heading p:last-child { margin: 0; color: var(--muted); }
.page-heading.split { align-items: center; }
.welcome-heading { background: linear-gradient(135deg, white, #f5f6f8); border: 1px solid var(--border); border-radius: 24px; padding: clamp(22px, 4vw, 38px); }
.status-pill { border-radius: 999px; padding: 8px 13px; background: var(--success-bg); color: var(--success); font-weight: 800; white-space: nowrap; }

.card { background: white; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 25px rgba(17,19,23,.055); padding: clamp(18px, 3vw, 28px); margin-bottom: 22px; }
.card-header { margin-bottom: 20px; }
.card-header.split { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.card h2 { margin: 3px 0 0; color: var(--green-950); }
.narrow-card { max-width: 650px; }
.form-card { max-width: 980px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: white; border: 1px solid var(--border); border-radius: 17px; padding: 20px; display: flex; gap: 15px; align-items: center; }
.stat-card strong { display: block; color: var(--green-950); font-size: 1.8rem; line-height: 1; }
.stat-card span:last-child { color: var(--muted); font-size: .87rem; }
.stat-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--orange-100); font-size: 1.35rem; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.profile-list { display: grid; gap: 0; }
.profile-list > div { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--border); }
.profile-list > div:last-child { border-bottom: 0; }
.profile-list strong { color: var(--orange-600); }
.roadmap-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.roadmap-list li { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.roadmap-list li span { width: 38px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #eef1ed; color: var(--green-900); font-weight: 850; }
.roadmap-list li.done { color: var(--green-900); font-weight: 750; }
.roadmap-list li.done span { background: var(--success-bg); color: var(--success); }
.empty-module-card { text-align: center; padding: 54px 25px; max-width: 720px; margin-inline: auto; }
.module-icon { width: 80px; height: 80px; display: grid; place-items: center; font-size: 2.4rem; margin: 0 auto 18px; background: var(--orange-100); border-radius: 25px; }

.two-column-layout { display: grid; grid-template-columns: minmax(270px, .75fr) minmax(0, 1.75fr); gap: 22px; align-items: start; }
.filter-card { padding: 16px; }
.filter-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.filter-form .grow { flex: 1 1 280px; }
.filter-form label:not(.grow) { min-width: 145px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 720px; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
tbody tr:hover { background: #f8f9fb; }
.table-subtitle { display: block; color: var(--muted); font-weight: 500; margin-top: 3px; }
.table-link { color: var(--orange-600); font-weight: 800; text-decoration: none; white-space: nowrap; }
.button-link { border: 0; background: transparent; padding: 0; cursor: pointer; }
.inline-form { display: inline; margin-left: 10px; }
.actions-cell { white-space: nowrap; }
.empty-state { text-align: center; color: var(--muted); padding: 32px; }
.table-note { color: var(--muted); font-size: .8rem; margin: 16px 0 0; }
.tag { display: inline-flex; background: #eff3ef; color: var(--green-800); border-radius: 999px; padding: 5px 9px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.status { display: inline-flex; border-radius: 999px; padding: 5px 9px; font-size: .72rem; font-weight: 850; }
.status.active { background: var(--success-bg); color: var(--success); }
.status.inactive { background: #f2f2f2; color: #717171; }
.sidebar-backdrop { display: none; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.three { grid-template-columns: 1fr 1fr; }
  .two-column-layout { grid-template-columns: 1fr; }
}

@media (max-width: 850px) {
  .auth-shell { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .form-panel { min-height: 100vh; padding: 28px 20px; }
  .mobile-logo { display: block; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(var(--sidebar-width), 86vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.38); z-index: 40; }
  .menu-button { display: grid; place-items: center; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .user-chip strong { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 620px) {
  .content { padding: 20px 14px; }
  .topbar { padding: 10px 14px; }
  .topbar > div:nth-child(2) { display: none; }
  .user-chip small { display: none; }
  .avatar { width: 36px; height: 36px; }
  .page-heading, .page-heading.split { align-items: stretch; flex-direction: column; }
  .status-pill { align-self: flex-start; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .filter-form { align-items: stretch; flex-direction: column; }
  .filter-form label:not(.grow) { width: 100%; }
  .app-footer { flex-direction: column; gap: 5px; }
  .checkbox-row { flex-direction: column; gap: 10px; }
}

/* Versão 0.2 — cardápios */
.menu-status.draft { background: #f2f2f2; color: #6d6d6d; }
.menu-status.published { background: #e7f7ec; color: #176b38; }
.menu-status.closed { background: #fff3d8; color: #8a5d00; }
.menu-status.finalized { background: #e9eef7; color: #34517b; }
.card-summary-strip { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; color: var(--muted); margin-bottom: 20px; }
.menu-stats { margin-bottom: 22px; }
.secondary-row td { background: #f8f9fb; padding-top: 8px; padding-bottom: 12px; }
.reopen-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.reopen-form label { flex: 1 1 320px; }
.update-checklist { background: #f5f6f8; border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.update-checklist ul { margin-bottom: 0; }

.compact-menu-list, .compact-log-list { display: grid; gap: 0; }
.compact-menu-list a, .compact-log-list > div {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text);
}
.compact-menu-list a:last-child, .compact-log-list > div:last-child { border-bottom: 0; }
.compact-menu-list a > span:first-child, .compact-log-list > div > span:first-child { display: grid; gap: 3px; }
.compact-menu-list small, .compact-log-list small { color: var(--muted); }

.meal-editor { padding: clamp(18px, 3vw, 30px); }
.meal-title-row { border-bottom: 1px solid var(--border); padding-bottom: 18px; }
.meal-notes-form { margin-bottom: 22px; }
.inline-control { display: flex; gap: 10px; align-items: center; }
.inline-control input { flex: 1; }
.groups-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.choice-group { border: 1px solid var(--border); border-radius: 17px; background: #f8f9fb; padding: 17px; }
.group-settings-form { display: grid; gap: 12px; }
.group-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.group-name-input { border: 0; padding: 4px 0; background: transparent; border-radius: 0; font-size: 1.1rem; font-weight: 850; color: var(--green-950); }
.group-name-input:focus { box-shadow: none; border-bottom: 2px solid var(--orange-500); }
.group-rules { display: grid; grid-template-columns: 90px 110px minmax(110px, 1fr); gap: 10px; align-items: end; }
.group-rules label { font-size: .76rem; color: var(--muted); }
.group-rules input { padding: 9px 10px; }
.btn.compact { padding: 9px 12px; font-size: .82rem; }
.option-list { display: grid; margin: 15px 0; border-top: 1px solid var(--border); }
.option-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.option-row > div:first-child { display: grid; gap: 2px; }
.option-row small { color: var(--muted); }
.option-row.is-inactive { opacity: .48; }
.option-actions { display: flex; gap: 4px; }
.option-actions form { margin: 0; }
.option-actions button { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border); background: white; border-radius: 8px; cursor: pointer; color: var(--green-900); }
.option-actions button:hover { border-color: var(--orange-500); }
.option-actions button.danger-icon { color: var(--danger); }
.empty-inline { color: var(--muted); margin: 14px 0; }
.add-option-panel, .add-group-panel { border-radius: 12px; background: white; border: 1px dashed #b8c3ba; }
.add-option-panel summary, .add-group-panel summary { cursor: pointer; padding: 12px 14px; font-weight: 800; color: var(--green-900); }
.compact-form { padding: 0 14px 14px; margin-top: 0; }
.delete-group-form { margin-top: 12px; text-align: right; }
.add-group-panel { margin-top: 20px; }
.group-add-grid { grid-template-columns: minmax(220px, 1fr) 100px 110px auto; gap: 12px; align-items: end; padding: 0 14px 14px; }
.sticky-actions { position: sticky; bottom: 14px; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 16px; padding: 12px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.sticky-actions form { margin: 0; }

.menu-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.menu-preview-card { overflow: hidden; border: 1px solid var(--border); border-radius: 22px; background: white; box-shadow: 0 8px 25px rgba(23,37,29,.05); }
.menu-preview-heading { padding: 22px; background: linear-gradient(135deg, var(--green-950), var(--green-800)); color: white; }
.menu-preview-heading span { color: #ffb087; text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; font-weight: 850; }
.menu-preview-heading h2 { margin: 7px 0 4px; color: white; }
.menu-preview-heading p { margin: 8px 0 0; color: rgba(255,255,255,.75); }
.menu-preview-body { padding: 20px; }
.preview-group + .preview-group { margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--border); }
.preview-group-title { display: flex; justify-content: space-between; gap: 10px; align-items: start; margin-bottom: 12px; }
.preview-group-title h3 { margin: 0; color: var(--green-950); }
.preview-group-title small { color: var(--muted); text-align: right; }
.preview-options { display: grid; gap: 9px; }
.preview-option { display: flex; gap: 10px; align-items: center; padding: 10px 11px; background: #f7f8fa; border-radius: 11px; }
.preview-option > div { display: grid; gap: 2px; }
.preview-option small { color: var(--muted); }
.fake-control { width: 18px; height: 18px; border: 2px solid #9cab9e; flex: 0 0 auto; }
.fake-control.radio { border-radius: 50%; }
.fake-control.check { border-radius: 4px; }
.preview-note { margin-top: 22px; }

@media (max-width: 1180px) {
  .menu-preview-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .groups-grid { grid-template-columns: 1fr; }
  .group-add-grid { grid-template-columns: 1fr 1fr; }
  .menu-preview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .inline-control { align-items: stretch; flex-direction: column; }
  .group-rules { grid-template-columns: 1fr 1fr; }
  .group-rules .btn { grid-column: 1 / -1; }
  .group-add-grid { grid-template-columns: 1fr; }
  .sticky-actions { position: static; justify-content: stretch; }
  .sticky-actions .btn, .sticky-actions form, .sticky-actions form .btn { width: 100%; }
  .option-row { align-items: flex-start; }
  .option-actions { flex-wrap: wrap; justify-content: flex-end; }
}

/* Versão 0.3 — pedidos, locais de entrega e refinamentos móveis */
.menu-preview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.menu-preview-card { min-width: 0; }
.menu-preview-heading { padding: 20px; }
.menu-preview-heading h2 { font-size: clamp(1.45rem, 2vw, 2rem); line-height: 1.12; }
.menu-preview-body { padding: 18px; }
.preview-group-title { display: grid; gap: 5px; }
.preview-group-title small { text-align: left; }
.preview-options { gap: 10px; }
.preview-option {
  align-items: flex-start;
  border: 1px solid #e6ebe6;
  padding: 12px;
}
.preview-option > div { min-width: 0; }
.preview-option strong { display: block; line-height: 1.25; overflow-wrap: anywhere; }
.preview-option small {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--orange-100);
  color: #a4471d;
  font-size: .72rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.preview-note { margin-top: 20px; }

.available-menu-list { display: grid; gap: 24px; }
.available-menu-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 12px 38px rgba(23,37,29,.06);
}
.available-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}
.available-menu-header h2 { margin: 0 0 4px; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.available-menu-header p { margin: 3px 0; color: var(--muted); }
.compact-alert { margin-bottom: 18px; }
.meal-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.meal-action-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: #f7f8fa;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.meal-action-card:hover { transform: translateY(-2px); border-color: #b9c7bc; box-shadow: 0 10px 28px rgba(23,37,29,.08); }
.meal-action-card.has-order { border-color: #abd1b8; background: #fbfffc; }
.meal-action-icon { font-size: 1.6rem; margin-bottom: 8px; }
.meal-action-content { display: grid; gap: 5px; flex: 1; margin-bottom: 16px; }
.meal-action-content h3 { margin: 0; color: var(--green-950); font-size: 1.25rem; }
.meal-action-content p { margin: 0; }
.meal-kicker { color: var(--orange-600); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 850; }

.order-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: .76rem;
  font-weight: 850;
}
.order-status.saved { background: var(--success-bg); color: var(--success); }
.order-status.declined { background: #f1f2f1; color: #636c66; }
.order-status.pending { background: var(--warning-bg); color: var(--warning); }

.order-form { display: grid; gap: 20px; }
.delivery-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 24px;
  align-items: end;
}
.delivery-card h2, .delivery-card p { margin-top: 0; }
.order-groups { display: grid; gap: 20px; }
.order-group-card { padding: clamp(18px, 3vw, 26px); }
.order-group-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.order-group-heading h2 { margin: 0; font-size: clamp(1.35rem, 2.2vw, 1.85rem); }
.selection-rule {
  flex: 0 0 auto;
  color: var(--muted);
  background: #f1f4f0;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .76rem;
  font-weight: 750;
}
.selectable-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.selectable-option {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 13px 14px;
  border: 1px solid #dbe2dc;
  border-radius: 14px;
  background: #f8f9fb;
  cursor: pointer;
  transition: border-color .18s, background .18s, box-shadow .18s, transform .18s;
}
.selectable-option:hover { border-color: #9db1a2; transform: translateY(-1px); }
.selectable-option:has(input:checked) {
  border-color: var(--orange-500);
  background: #fbf7ec;
  box-shadow: 0 0 0 3px rgba(243,112,45,.10);
}
.selectable-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.selectable-indicator {
  width: 21px;
  height: 21px;
  border: 2px solid #92a095;
  border-radius: 5px;
  background: #fff;
  display: grid;
  place-items: center;
}
.selectable-option input[type="radio"] + .selectable-indicator { border-radius: 50%; }
.selectable-option input:checked + .selectable-indicator { border-color: var(--orange-600); background: var(--orange-600); }
.selectable-option input:checked + .selectable-indicator::after {
  content: "";
  width: 7px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px,-1px);
}
.selectable-option input[type="radio"]:checked + .selectable-indicator::after {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  transform: none;
}
.selectable-option:has(input:disabled) { cursor: default; opacity: .78; }
.selectable-copy { display: grid; gap: 5px; min-width: 0; }
.selectable-copy strong { color: var(--green-950); line-height: 1.24; overflow-wrap: anywhere; }
.selectable-copy small {
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--orange-100);
  color: #9a431d;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.order-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.order-actions h2, .order-actions p { margin: 0; }
.order-actions p { color: var(--muted); }
.danger-soft { color: var(--danger) !important; border-color: #ecc7c3 !important; background: #fffafa !important; }

.history-order-list { display: grid; gap: 16px; }
.history-order-card { display: grid; gap: 14px; }
.history-order-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.history-order-top h2 { margin: 0; font-size: 1.3rem; }
.delivery-summary { margin: 0; }
.history-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.history-items > div { display: grid; gap: 3px; padding: 11px 12px; background: #f5f6f8; border-radius: 12px; }
.history-items small { color: var(--muted); }

.admin-create-order { margin-bottom: 18px; }
.admin-order-launch { align-items: end; }
.order-filter-form { gap: 10px; }
.table-item-list { display: flex; flex-wrap: wrap; gap: 5px; }
.table-item-list span { background: #f0f4ef; border-radius: 999px; padding: 3px 7px; font-size: .73rem; white-space: nowrap; }
.table-card td small { display: block; color: var(--muted); margin-top: 3px; }
.admin-justification-card { display: grid; gap: 18px; }
.employee-stats { max-width: 700px; }
.employee-action-card { display: flex; flex-direction: column; align-items: flex-start; }
.employee-action-card .btn { margin-top: auto; }

@media (max-width: 1180px) {
  .meal-action-grid { grid-template-columns: 1fr 1fr; }
  .selectable-options { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .delivery-card { grid-template-columns: 1fr; align-items: stretch; }
  .history-items { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .content { padding: 16px 12px; }
  .page-heading { margin-bottom: 18px; }
  .page-heading h1 { font-size: clamp(1.75rem, 8.4vw, 2.35rem); line-height: 1.1; overflow-wrap: anywhere; }
  .page-heading p { margin-bottom: 0; }
  .order-heading .form-actions { width: 100%; align-items: stretch; }
  .order-heading .form-actions .btn { width: 100%; }
  .available-menu-block { padding: 16px 13px; border-radius: 18px; }
  .available-menu-header { display: grid; gap: 10px; }
  .meal-action-grid { grid-template-columns: 1fr; }
  .meal-action-card { padding: 15px; }
  .order-group-card { padding: 16px 13px; border-radius: 16px; }
  .order-group-heading { display: grid; gap: 8px; margin-bottom: 12px; }
  .selection-rule { width: fit-content; }
  .selectable-option { min-height: 62px; padding: 11px 12px; }
  .selectable-copy strong { font-size: .98rem; }
  .selectable-copy small { font-size: .7rem; }
  .order-actions { align-items: stretch; flex-direction: column; }
  .order-action-buttons { width: 100%; display: grid; grid-template-columns: 1fr; }
  .order-action-buttons .btn { width: 100%; }
  .history-order-top { display: grid; gap: 8px; }
  .history-items { grid-template-columns: 1fr; }
  .menu-preview-grid { gap: 14px; }
  .menu-preview-card { border-radius: 17px; }
  .menu-preview-heading { padding: 16px; }
  .menu-preview-heading h2 { font-size: 1.45rem; }
  .menu-preview-body { padding: 14px; }
  .preview-group + .preview-group { margin-top: 16px; padding-top: 15px; }
  .preview-group-title { margin-bottom: 9px; }
  .preview-option { padding: 10px; }
  .admin-order-launch { grid-template-columns: 1fr; }
}
.admin-order-form .order-groups.is-disabled { opacity: .45; pointer-events: none; }

/* Versão 0.4 — operação da cozinha e etiquetas */
.kitchen-heading .form-actions { align-self: center; }
.kitchen-day-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.kitchen-day-summary h2, .kitchen-day-summary p { margin: 3px 0; }
.kitchen-meal-block { margin: 0 0 30px; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--border); border-radius: 24px; background: #f7f8fa; box-shadow: 0 12px 38px rgba(17,19,23,.065); }
.kitchen-meal-header { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 20px; }
.kitchen-meal-header h2 { margin: 2px 0 4px; color: var(--green-950); font-size: clamp(1.7rem, 3vw, 2.35rem); }
.kitchen-meal-header p { margin: 0; color: var(--muted); }
.kitchen-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.kitchen-stat { display: grid; gap: 4px; padding: 16px 17px; border-radius: 16px; border: 1px solid var(--border); background: white; }
.kitchen-stat strong { font-size: 1.8rem; line-height: 1; color: var(--green-950); }
.kitchen-stat span { color: var(--muted); font-size: .82rem; }
.kitchen-stat.requested { border-left: 4px solid #2e8b57; }
.kitchen-stat.declined { border-left: 4px solid #7f8a82; }
.kitchen-stat.pending { border-left: 4px solid #d89a19; }
.kitchen-stat.total { border-left: 4px solid var(--orange-500); }
.kitchen-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.kitchen-summary-card { margin-bottom: 18px; }
.kitchen-summary-card h3 { margin: 2px 0 0; color: var(--green-950); }
.kitchen-item-group + .kitchen-item-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.kitchen-item-group h4 { margin: 0 0 7px; color: var(--orange-600); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.kitchen-count-row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px dashed #dfe3e9; }
.kitchen-count-row:last-child { border-bottom: 0; }
.kitchen-count-row span { overflow-wrap: anywhere; }
.kitchen-count-row strong { flex: 0 0 auto; min-width: 34px; text-align: center; padding: 2px 8px; border-radius: 999px; background: var(--orange-100); color: var(--orange-600); }
.kitchen-details { padding: 0; overflow: hidden; }
.kitchen-details summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 20px; font-weight: 850; color: var(--green-950); }
.kitchen-details summary::-webkit-details-marker { display: none; }
.kitchen-details summary::after { content: '⌄'; margin-left: auto; color: var(--orange-600); }
.kitchen-details[open] summary::after { transform: rotate(180deg); }
.kitchen-details summary span { border-radius: 999px; padding: 4px 9px; background: #eceff3; color: var(--green-800); font-size: .74rem; }
.kitchen-details-body { border-top: 1px solid var(--border); padding: 18px 20px; }
.location-order-group + .location-order-group { margin-top: 22px; }
.location-order-group h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; color: var(--green-950); }
.location-order-group h3 span { font-size: .72rem; border-radius: 999px; padding: 4px 8px; background: var(--orange-100); color: var(--orange-600); }
.nominal-order-list { display: grid; gap: 9px; }
.nominal-order-list article { display: grid; grid-template-columns: minmax(180px,.65fr) minmax(0,1.35fr); gap: 14px; padding: 12px 13px; border: 1px solid #dde1e7; border-radius: 12px; background: #f8f9fb; }
.nominal-order-list article > div:first-child { display: grid; gap: 3px; }
.nominal-order-list small { color: var(--muted); }
.nominal-items { display: flex; flex-wrap: wrap; gap: 6px 12px; align-content: center; }
.nominal-items span { font-size: .82rem; }
.kitchen-lists-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.compact-name-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.compact-name-list > div { display: grid; gap: 2px; padding: 10px 11px; border-radius: 10px; background: #f5f6f8; }
.compact-name-list small { color: var(--muted); }

.label-filter-form select { min-width: 160px; }
.label-workspace-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(310px,.6fr); gap: 20px; align-items: start; }
.label-preview-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.label-preview-list article { display: grid; gap: 3px; padding: 12px 13px; border: 1px solid var(--border); border-radius: 12px; background: #f7f8fa; }
.label-preview-list strong { color: var(--orange-600); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.label-preview-list span { color: var(--green-950); font-weight: 850; }
.label-preview-list small { color: var(--muted); overflow-wrap: anywhere; }
.label-calibration-layout { grid-template-columns: minmax(260px,.6fr) minmax(0,1.4fr); }
.printer-profile-list { display: grid; gap: 8px; }
.printer-profile-list a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--green-950); }
.printer-profile-list a.active { border-color: var(--orange-500); background: #fbf7ec; box-shadow: 0 0 0 3px rgba(199,167,90,.12); }
.printer-profile-list a span:first-child { display: grid; gap: 3px; }
.printer-profile-list small { color: var(--muted); }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 1050px) {
  .kitchen-stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .label-workspace-grid { grid-template-columns: 1fr; }
  .label-calibration-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .kitchen-day-summary, .kitchen-meal-header { align-items: stretch; flex-direction: column; }
  .kitchen-meal-header .btn { width: 100%; }
  .kitchen-summary-grid, .kitchen-lists-grid { grid-template-columns: 1fr; }
  .nominal-order-list article { grid-template-columns: 1fr; }
  .compact-name-list, .label-preview-list { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .kitchen-meal-block { padding: 14px 11px; border-radius: 17px; }
  .kitchen-stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kitchen-stat { padding: 13px; }
  .kitchen-stat strong { font-size: 1.5rem; }
  .kitchen-details summary, .kitchen-details-body { padding-left: 13px; padding-right: 13px; }
}

/* Versão 0.5 — produção diária e insumos */
.production-create-card { margin-bottom: 18px; }
.production-create-form { align-items: end; }
.production-stats .stat-card strong { font-size: clamp(1.25rem, 2.4vw, 1.85rem); }
.production-indicators { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 18px; }
.mini-indicator { display: grid; gap: 7px; padding: 17px 18px; }
.mini-indicator span { color: var(--muted); font-size: .8rem; }
.mini-indicator strong { color: var(--green-950); font-size: 1.15rem; overflow-wrap: anywhere; }
.production-edit-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.quantity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quantity-grid input { font-variant-numeric: tabular-nums; }
.field-hint { margin: -4px 0 2px; padding: 10px 12px; border-radius: 10px; background: #f1f3f6; color: var(--muted); font-size: .8rem; }
.category-badge { display: inline-flex; width: fit-content; margin-bottom: 5px; padding: 3px 8px; border-radius: 999px; background: #eceff3; color: var(--green-800); font-size: .68rem; font-weight: 800; letter-spacing: .02em; }
.block-title { display: block; color: var(--green-950); }
.table-subtext { display: block; margin-top: 3px; color: var(--muted); }
.production-finalize-card, .finalized-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; }
.production-finalize-card h2, .production-finalize-card p, .finalized-banner h2, .finalized-banner p { margin: 3px 0; }
.finalized-banner { border-left: 5px solid #2e8b57; background: #f7fbf7; }
.text-danger { color: #b33a2d !important; }
.report-stats { margin-top: 18px; }
.production-report-grid { align-items: start; }
.compact-production-days { display: grid; gap: 8px; }
.compact-production-days a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 13px; border: 1px solid var(--border); border-radius: 12px; color: inherit; text-decoration: none; background: #f7f8fa; }
.compact-production-days a:hover { border-color: var(--orange-500); background: #fbf7ec; }
.compact-production-days a > span { display: grid; gap: 3px; }
.compact-production-days a > span:last-child { text-align: right; }
.compact-production-days small { color: var(--muted); }
.reopen-form { display: grid; grid-template-columns: minmax(230px, 1fr) auto; gap: 10px; align-items: end; min-width: min(100%, 520px); }
.reopen-form label { margin: 0; }

@media (max-width: 1050px) {
  .production-edit-grid { grid-template-columns: 1fr; }
  .production-indicators { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .production-create-form { align-items: stretch; }
  .production-finalize-card, .finalized-banner { align-items: stretch; flex-direction: column; }
  .production-finalize-card .btn, .finalized-banner .btn { width: 100%; }
  .reopen-form { grid-template-columns: 1fr; min-width: 0; width: 100%; }
  .compact-production-days a { align-items: flex-start; }
}
@media (max-width: 560px) {
  .quantity-grid, .production-indicators { grid-template-columns: 1fr; }
  .compact-production-days a { display: grid; }
  .compact-production-days a > span:last-child { text-align: left; }
}

/* Versão 0.6 — gestão, indicadores e relatórios */
.management-heading { align-items: center; }
.management-filter { align-items: end; }
.filter-summary { margin: 14px 0 0; color: var(--muted); font-size: .84rem; }
.management-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.management-stats .stat-card strong, .waste-stats .stat-card strong { font-size: clamp(1.12rem, 2.1vw, 1.65rem); }
.management-grid { display: grid; gap: 20px; margin-bottom: 22px; }
.management-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.management-grid > .card { margin-bottom: 0; }
.metric-list { display: grid; gap: 17px; }
.metric-row { display: grid; gap: 7px; }
.metric-row-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.metric-row-heading strong { color: var(--green-950); }
.metric-row-heading span, .metric-row small { color: var(--muted); font-size: .78rem; }
progress { width: 100%; height: 10px; border: 0; border-radius: 999px; overflow: hidden; background: #edf1ec; color: var(--orange-500); }
progress::-webkit-progress-bar { background: #edf1ec; border-radius: 999px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--orange-500), #f6a16f); border-radius: 999px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--orange-500), #f6a16f); border-radius: 999px; }
.production-health-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.production-health-grid > div { display: grid; gap: 5px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: #f7f8fa; }
.production-health-grid span { color: var(--muted); font-size: .78rem; }
.production-health-grid strong { color: var(--green-950); font-size: 1.2rem; }
.info-note { padding: 13px 15px; border-radius: 12px; background: #f3f6f2; color: var(--muted); font-size: .84rem; }
.clinical-note { margin: 0 0 22px; border-left: 4px solid var(--orange-500); }
.ranking-list { display: grid; gap: 8px; }
.ranking-row { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 11px 0; border-bottom: 1px solid #edf0ed; }
.ranking-row:last-child { border-bottom: 0; }
.ranking-position { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--orange-100); color: var(--orange-600); font-size: .76rem; font-weight: 900; }
.ranking-main { min-width: 0; display: grid; gap: 4px; }
.ranking-main strong { color: var(--green-950); overflow-wrap: anywhere; }
.ranking-main small { color: var(--muted); overflow-wrap: anywhere; }
.ranking-main progress { height: 7px; }
.ranking-total { color: var(--orange-600); font-size: 1rem; white-space: nowrap; }
.weight-total { color: var(--green-800); font-size: .82rem; }
.compact-ranking .ranking-row { padding: 9px 0; }
.trend-table { display: grid; gap: 4px; }
.trend-row { display: grid; grid-template-columns: 125px minmax(0,1fr); gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid #edf0ed; }
.trend-row:last-child { border-bottom: 0; }
.trend-row > div:first-child { display: grid; gap: 2px; }
.trend-row small { color: var(--muted); }
.trend-progress { display: grid; gap: 5px; }
.management-actions { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.management-actions h2, .management-actions p { margin: 3px 0; }
.report-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; margin-bottom: 22px; }
.report-module-card { display: grid; grid-template-rows: auto 1fr auto; gap: 15px; margin: 0; }
.report-module-card h2 { margin: 3px 0 7px; }
.report-module-card p:last-child { margin: 0; color: var(--muted); }
.report-filter-form { align-items: end; }
.report-filter-form select { min-width: 145px; }
.report-stats { grid-template-columns: repeat(5, minmax(0,1fr)); }
.report-hub-stats { grid-template-columns: repeat(4, minmax(0,1fr)); }
.waste-stats { grid-template-columns: repeat(6, minmax(0,1fr)); }
.wide-cell { min-width: 280px; max-width: 560px; overflow-wrap: anywhere; }
.table-responsive table progress { min-width: 150px; height: 6px; margin-top: 7px; display: block; }
.profile-filter-form { align-items: end; }
.profile-identity-card { display: flex; align-items: center; gap: 18px; }
.profile-identity-card h2, .profile-identity-card p { margin: 3px 0; }
.profile-avatar-large { width: 72px; height: 72px; flex: 0 0 auto; border-radius: 22px; display: grid; place-items: center; background: var(--orange-100); color: var(--orange-600); font-size: 2rem; font-weight: 900; }
.profile-stats { grid-template-columns: repeat(4, minmax(0,1fr)); }
.profile-ranking { grid-template-columns: repeat(2, minmax(0,1fr)); column-gap: 24px; }
.empty-state-card { text-align: center; padding: 46px 24px; }
.empty-state-card .module-icon { margin: 0 auto 12px; }
.consumption-summary-grid { align-items: start; }
.dashboard-management-stats { margin-top: 0; }
.management-dashboard-card { background: linear-gradient(145deg, white, #f6f9f5); }
.dashboard-audit-grid { grid-template-columns: 1fr; }

@media (max-width: 1180px) {
  .management-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .waste-stats { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .report-stats { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .management-grid.two-columns, .report-card-grid { grid-template-columns: 1fr; }
  .profile-ranking { grid-template-columns: 1fr; }
  .management-actions { align-items: stretch; flex-direction: column; }
  .management-actions .form-actions { width: 100%; }
  .management-actions .btn { flex: 1 1 190px; }
}
@media (max-width: 760px) {
  .management-heading { align-items: stretch; }
  .management-heading .btn { width: 100%; }
  .report-hub-stats, .profile-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .trend-row { grid-template-columns: 1fr; gap: 6px; }
  .profile-identity-card { align-items: flex-start; }
  .report-filter-form, .profile-filter-form, .management-filter { align-items: stretch; }
  .report-filter-form .btn, .profile-filter-form .btn, .management-filter .btn { width: 100%; }
}
@media (max-width: 560px) {
  .management-stats, .waste-stats, .report-stats, .report-hub-stats, .profile-stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .management-stats .stat-card, .waste-stats .stat-card, .report-stats .stat-card, .report-hub-stats .stat-card, .profile-stats .stat-card { padding: 14px 12px; gap: 10px; }
  .management-stats .stat-icon, .waste-stats .stat-icon, .report-stats .stat-icon, .report-hub-stats .stat-icon, .profile-stats .stat-icon { width: 40px; height: 40px; border-radius: 11px; }
  .production-health-grid { grid-template-columns: 1fr; }
  .ranking-row { grid-template-columns: 28px minmax(0,1fr); }
  .ranking-total { grid-column: 2; justify-self: start; }
  .profile-identity-card { display: grid; }
  .wide-cell { min-width: 220px; }
}

/* Versão 0.7 — importação de usuários e manutenção */
.import-heading { align-items: center; }
.import-upload-card { max-width: 980px; }
.check-card { display: flex !important; align-items: flex-start; gap: 12px; min-height: 100%; padding: 15px; border: 1px solid var(--border); border-radius: 14px; background: #f7f8fa; cursor: pointer; }
.check-card input { width: 19px; height: 19px; margin-top: 2px; flex: 0 0 auto; }
.check-card span { display: grid; gap: 4px; }
.check-card strong { color: var(--green-950); }
.check-card small { color: var(--muted); }
.preview-summary { align-items: center; margin-bottom: 16px; }
.import-preview-table td { vertical-align: top; }
.import-preview-table .row-error { background: #fff7f5; }
.import-confirm-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: #f5f6f8; }
.import-confirm-box p { margin: 0; color: var(--muted); }
.import-confirm-box .form-actions { flex: 0 0 auto; }
.import-result-card { border-left: 5px solid var(--orange-500); }
.import-stats { grid-template-columns: repeat(4, minmax(0,1fr)); margin-top: 18px; }
.status.import-importado, .status.import-novo { background: #e7f6ea; color: #246a38; }
.status.import-atualizado, .status.import-atualizar { background: #e8f1fa; color: #2c5e88; }
.status.import-ignorado, .status.import-ignorar { background: #f2f2f0; color: #626860; }
.status.import-erro { background: #fde9e5; color: #a33b2f; }
.text-warning { color: #9a5a1a; }
.text-success { color: #2b7041; }
.maintenance-heading { align-items: center; }
.maintenance-stats { grid-template-columns: repeat(4, minmax(0,1fr)); }
.maintenance-grid { align-items: stretch; }
.code-block { margin: 14px 0; padding: 15px 16px; overflow-x: auto; border-radius: 13px; background: #18251d; color: #f5f7f5; font-size: .82rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.maintenance-list { margin: 12px 0 0; padding-left: 20px; color: var(--muted); line-height: 1.75; }
.maintenance-action-card { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.maintenance-action-card h2, .maintenance-action-card p { margin: 3px 0; }
.manual-maintenance-form { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 10px; min-width: min(100%, 500px); }
.manual-maintenance-form label { margin: 0; }

@media (max-width: 900px) {
  .import-confirm-box, .maintenance-action-card { align-items: stretch; flex-direction: column; }
  .import-confirm-box .form-actions, .maintenance-action-card .manual-maintenance-form { width: 100%; }
  .import-confirm-box .btn { flex: 1 1 180px; }
}
@media (max-width: 760px) {
  .import-heading, .preview-summary, .maintenance-heading { align-items: stretch; }
  .import-heading .form-actions, .import-heading .btn { width: 100%; }
  .import-stats, .maintenance-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .manual-maintenance-form { grid-template-columns: 1fr; min-width: 0; }
  .manual-maintenance-form .btn { width: 100%; }
}
@media (max-width: 520px) {
  .import-stats, .maintenance-stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .import-stats .stat-card, .maintenance-stats .stat-card { padding: 13px 11px; }
}


/* Versão 0.8 — identidade comercial, página Sobre e múltiplas unidades */
.sidebar-brand img { aspect-ratio: 1 / 1; object-fit: cover; max-height: 180px; }
.sidebar-brand small { color: rgba(255,255,255,.48); font-size: .72rem; line-height: 1.35; }
.brand-logo-large { max-width: 420px; aspect-ratio: 1 / 1; object-fit: cover; }
.auth-logo { aspect-ratio: 1 / 1; object-fit: cover; max-width: 230px; }
.btn.info { background: var(--blue); color: white; }
.text-success { color: var(--success); }
.measurement-badge, .supply-type-badge {
  display: inline-flex; align-items: center; width: fit-content; border-radius: 999px;
  padding: 3px 8px; font-size: .68rem; font-weight: 850; letter-spacing: .02em;
}
.measurement-badge { background: var(--blue-bg); color: var(--blue); }
.supply-type-badge { background: var(--orange-100); color: var(--orange-600); }
.unit-help-box { border-left: 4px solid var(--blue); background: var(--blue-bg); padding: 12px 14px; border-radius: 12px; color: #26446f; }
.production-measurement-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.measurement-card { display: grid; gap: 5px; }
.measurement-card strong { font-size: 1.35rem; color: var(--green-950); }
.measurement-card span { color: var(--muted); font-size: .8rem; }
.packaging-suggestion { border-left: 5px solid var(--orange-500); background: #fcf9f0; }
.packaging-suggestion strong { color: var(--green-950); }
.unit-live-label { display: inline-flex; gap: 6px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--blue-bg); color: var(--blue); font-weight: 800; }

.about-hero { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 30px; align-items: center; padding: clamp(24px,4vw,42px); }
.developer-photo-frame { width: 180px; height: 180px; padding: 7px; border-radius: 50%; background: linear-gradient(145deg,var(--orange-500),var(--green-800)); box-shadow: 0 14px 35px rgba(17,19,23,.18); }
.developer-photo-frame img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 5px solid white; }
.about-developer-copy h2 { margin: 4px 0 3px; font-size: clamp(1.8rem,3vw,2.7rem); color: var(--green-950); }
.about-title { margin: 0 0 14px; color: var(--orange-600); font-weight: 800; }
.about-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.about-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.client-license-block { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 20px; align-items: start; }
.client-about-logo { width: 150px; height: 150px; object-fit: contain; border: 1px solid var(--border); border-radius: 18px; background: white; padding: 10px; }
.license-card { border-top: 4px solid var(--orange-500); }
.commercial-model { display: grid; gap: 6px; margin: 18px 0; padding: 14px 16px; border-radius: 13px; background: var(--green-900); color: white; }
.commercial-model span { color: rgba(255,255,255,.72); }

@media (max-width: 800px) {
  .about-hero { grid-template-columns: 1fr; text-align: center; }
  .developer-photo-frame { margin: 0 auto; }
  .about-developer-copy .form-actions { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
  .production-measurement-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .client-license-block { grid-template-columns: 1fr; }
  .client-about-logo { margin: 0 auto; }
  .sidebar-brand img { max-height: 150px; }
}
/* =========================================================
   Hotfix responsivo v0.8.1
   Contenção de grids, formulários, tabelas e logomarcas
   ========================================================= */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/*
 * Permite que grids e elementos flexíveis diminuam
 * até a largura disponível no celular.
 */
.app-shell,
.main-column,
.content,
.page-heading,
.card,
.card-header,
.dashboard-grid,
.two-column-layout,
.report-card-grid,
.management-grid,
.production-report-grid,
.form-grid,
.filter-form,
.stack-form {
    min-width: 0;
}

.dashboard-grid > *,
.two-column-layout > *,
.report-card-grid > *,
.management-grid > *,
.production-report-grid > *,
.form-grid > *,
.filter-form > *,
.stack-form > * {
    min-width: 0;
    max-width: 100%;
}

/*
 * Impede campos e conteúdos auxiliares de ultrapassarem
 * os limites dos respectivos cards.
 */
form,
label,
input,
select,
textarea,
.unit-help-box,
.field-hint {
    min-width: 0;
    max-width: 100%;
}

input,
select,
textarea {
    width: 100%;
}

.form-actions,
.card-header.split {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
}

/*
 * Permite quebra segura de textos longos.
 */
.page-heading p,
.card p,
label small,
.unit-help-box,
.field-hint,
.table-subtitle,
.table-subtext,
.btn {
    overflow-wrap: anywhere;
    word-break: normal;
}

.btn {
    white-space: normal;
}

/*
 * A página permanece fixa.
 * Somente a área da tabela pode rolar horizontalmente.
 */
.table-wrap,
.table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
}

.table-wrap table,
.table-responsive table {
    min-width: 720px;
}

/*
 * Organização dos botões Editar, Ativar e Inativar.
 */
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.table-actions form {
    margin: 0;
}

/*
 * Exibe logomarcas completas, sem recortar suas bordas.
 */
.sidebar-brand img,
.brand-logo-large,
.auth-logo {
    aspect-ratio: auto;
    object-fit: contain;
    height: auto;
}

/*
 * Ajustes adicionais para celulares.
 */
@media (max-width: 620px) {
    .dashboard-grid,
    .two-column-layout,
    .report-card-grid,
    .management-grid.two-columns,
    .production-report-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .filter-form > *,
    .filter-form .grow,
    .filter-form label:not(.grow) {
        width: 100%;
        min-width: 0;
        flex: 1 1 auto;
    }

    .filter-form .btn {
        width: 100%;
    }

    .card-header.split {
        align-items: flex-start;
    }

    .card-header.split .tag {
        align-self: flex-start;
    }
}
/* Evita que o formulário seja esticado pela altura da listagem */
.two-column-layout,
.management-grid.two-columns {
    align-items: start;
}

.two-column-layout > .card,
.management-grid.two-columns > .card {
    align-self: start;
    height: auto;
}
/* =========================================================
   Utilitário para grids cujos cards devem manter
   suas alturas naturais
   ========================================================= */

.align-items-start {
    align-items: start;
}

.align-items-start > * {
    min-width: 0;
    align-self: start;
}

.align-items-start > .card {
    height: auto;
    min-height: 0;
    align-self: start;
}

/* =========================================================
   Versão 0.8.5 — catálogo padronizado e refinamentos móveis
   ========================================================= */
.catalog-guidance {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.45;
}
.catalog-guidance a {
    color: var(--orange-600);
    font-weight: 800;
}

@media (max-width: 900px) {
    /* Sobrescreve regras legadas posteriores que mantinham três colunas. */
    .menu-preview-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 620px) {
    .menu-preview-grid {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .menu-preview-card,
    .menu-preview-heading,
    .menu-preview-body,
    .preview-group,
    .preview-option {
        min-width: 0;
        max-width: 100%;
    }

    .preview-option strong,
    .preview-option small {
        overflow-wrap: normal;
        word-break: normal;
        hyphens: auto;
    }

    .profile-list > .system-description-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
        align-items: start;
    }

    .profile-list > .system-description-row strong {
        text-align: left;
        overflow-wrap: anywhere;
    }
}
