:root {
  --mb-yellow: #EAB504;
  --mb-gold: #D89D05;
  --mb-light-yellow: #FCC836;
  --mb-blue: #2E5FCD;
  --mb-red: #F80C07;
  --mb-brown: #774A22;
  --mb-white: #F7F3EE;
  --mb-dark: #2B1B12;
  --mb-success: #20A44A;
  --mb-warning: #FFB703;
  --mb-danger: #F80C07;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff8dd;
  color: var(--mb-dark);
  font-family: "Fredoka", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.guest-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, rgba(119, 74, 34, 0.10) 0 2px, transparent 3px),
    linear-gradient(135deg, var(--mb-yellow), var(--mb-gold));
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--mb-white);
  border: 3px solid rgba(119, 74, 34, 0.18);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(43, 27, 18, 0.20);
  padding: 28px;
  text-align: center;
}

.login-logo {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 24px;
  border: 3px solid var(--mb-light-yellow);
}

h1,
h2,
.brand,
.metric-card strong {
  font-family: "Baloo 2", Arial, sans-serif;
}

h1 {
  margin: 16px 0 0;
  color: var(--mb-blue);
  font-size: 32px;
  line-height: 1;
}

.tagline {
  margin: 4px 0 22px;
  color: var(--mb-red);
  font-weight: 800;
}

.login-form {
  display: grid;
  gap: 10px;
  text-align: left;
}

.login-form label {
  font-weight: 700;
}

.login-form input {
  width: 100%;
  border: 2px solid rgba(119, 74, 34, 0.20);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: var(--mb-dark);
}

.login-form input:focus {
  border-color: var(--mb-blue);
  outline: 3px solid rgba(46, 95, 205, 0.18);
}

.btn {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  padding: 10px 16px;
  font-weight: 800;
}

.btn-primary {
  background: var(--mb-blue);
  color: #fff;
}

.btn-danger {
  background: var(--mb-danger);
  color: #fff;
}

.btn-yellow {
  background: var(--mb-yellow);
  color: var(--mb-dark);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-block {
  width: 100%;
  margin-top: 12px;
}

.alert {
  border-radius: 14px;
  margin-bottom: 16px;
  padding: 12px;
  text-align: left;
}

.alert-danger {
  background: rgba(248, 12, 7, 0.10);
  color: #9f0905;
  border: 1px solid rgba(248, 12, 7, 0.22);
}

.login-hint {
  margin: 18px 0 0;
  color: rgba(43, 27, 18, 0.70);
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, var(--mb-yellow), var(--mb-gold));
  color: var(--mb-dark);
  padding: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.75);
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.side-nav a,
.side-nav span {
  border-radius: 14px;
  display: block;
  font-weight: 800;
  padding: 12px 14px;
}

.side-nav .active {
  background: var(--mb-blue);
  color: #fff;
}

.side-nav .disabled {
  background: rgba(255, 255, 255, 0.28);
  color: rgba(43, 27, 18, 0.62);
}

.main-panel {
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 2px solid rgba(119, 74, 34, 0.12);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(43, 27, 18, 0.08);
  margin-bottom: 24px;
  padding: 14px 16px;
}

.topbar span {
  color: rgba(43, 27, 18, 0.62);
  display: block;
}

.branch-switcher select {
  border: 2px solid rgba(119, 74, 34, 0.18);
  border-radius: 12px;
  padding: 9px 12px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-header h1 {
  margin-top: 0;
}

.page-header p {
  margin: 6px 0 0;
  color: rgba(43, 27, 18, 0.72);
}

.eyebrow {
  color: var(--mb-red);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.metric-card,
.content-panel {
  background: #fff;
  border: 2px solid rgba(119, 74, 34, 0.12);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(43, 27, 18, 0.08);
  padding: 18px;
}

.metric-card span {
  color: rgba(43, 27, 18, 0.70);
  font-weight: 700;
}

.metric-card strong {
  color: var(--mb-blue);
  display: block;
  font-size: 42px;
  line-height: 1;
  margin-top: 8px;
}

.content-panel h2 {
  margin: 0 0 16px;
  color: var(--mb-blue);
}

.details-list {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 16px;
  margin: 0;
}

.details-list dt {
  color: rgba(43, 27, 18, 0.66);
  font-weight: 800;
}

.details-list dd {
  margin: 0;
}

.pos-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.pos-products,
.cart-panel,
.receipt-paper,
.kitchen-card {
  background: #fff;
  border: 2px solid rgba(119, 74, 34, 0.12);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(43, 27, 18, 0.08);
}

.pos-products {
  padding: 18px;
}

.pos-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

.pos-search input,
.checkout-form input,
.checkout-form select {
  border: 2px solid rgba(119, 74, 34, 0.18);
  border-radius: 14px;
  padding: 12px;
  width: 100%;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.category-tabs a {
  background: #fff8dd;
  border: 2px solid var(--mb-light-yellow);
  border-radius: 999px;
  font-weight: 800;
  padding: 8px 12px;
}

.category-tabs .active {
  background: var(--mb-blue);
  border-color: var(--mb-blue);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.pos-product-card {
  border: 0;
  margin: 0;
}

.pos-product-card button {
  background: #fff;
  border: 3px solid var(--mb-light-yellow);
  border-radius: 20px;
  cursor: pointer;
  display: grid;
  gap: 6px;
  min-height: 148px;
  padding: 14px;
  text-align: left;
  width: 100%;
}

.pos-product-image {
  border-radius: 14px;
  height: 86px;
  object-fit: cover;
  width: 100%;
}

.pos-product-card button:hover,
.pos-product-card button:focus {
  box-shadow: 0 10px 24px rgba(43, 27, 18, 0.16);
  outline: 3px solid rgba(46, 95, 205, 0.16);
  transform: translateY(-2px);
}

.pos-product-name {
  color: var(--mb-blue);
  font-family: "Baloo 2", Arial, sans-serif;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.05;
}

.pos-product-category {
  color: rgba(43, 27, 18, 0.62);
  font-weight: 700;
}

.pos-product-price {
  align-self: end;
  color: var(--mb-red);
  font-size: 19px;
  font-weight: 800;
}

.cart-panel {
  padding: 18px;
  position: sticky;
  top: 18px;
}

.cart-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cart-header h2 {
  color: var(--mb-blue);
  margin: 0;
}

.cart-items {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  max-height: 360px;
  overflow: auto;
}

.cart-item {
  border-bottom: 1px solid rgba(119, 74, 34, 0.12);
  display: grid;
  gap: 8px;
  padding-bottom: 10px;
}

.cart-item span {
  color: rgba(43, 27, 18, 0.66);
  display: block;
}

.qty-form {
  align-items: center;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
}

.qty-form input {
  border: 2px solid rgba(119, 74, 34, 0.18);
  border-radius: 12px;
  padding: 9px;
}

.link-button {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  padding: 0;
}

.link-button.danger {
  color: var(--mb-red);
}

.checkout-form {
  display: grid;
  gap: 9px;
}

.checkout-form label {
  font-weight: 800;
}

.totals-box,
.receipt-totals {
  background: #fff8dd;
  border: 2px solid rgba(119, 74, 34, 0.12);
  border-radius: 16px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.totals-box div,
.receipt-totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.grand-total {
  border-top: 2px solid rgba(119, 74, 34, 0.16);
  color: var(--mb-red);
  font-size: 20px;
  padding-top: 8px;
}

.checkout-button {
  font-size: 18px;
  min-height: 52px;
}

.empty-state {
  background: #fff8dd;
  border: 2px dashed rgba(119, 74, 34, 0.22);
  border-radius: 16px;
  color: rgba(43, 27, 18, 0.68);
  font-weight: 800;
  padding: 18px;
  text-align: center;
}

.receipt-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.receipt-paper {
  margin: 0 auto;
  max-width: 460px;
  padding: 22px;
}

.receipt-header {
  text-align: center;
}

.receipt-header img {
  border-radius: 18px;
  height: 84px;
  object-fit: cover;
  width: 84px;
}

.receipt-header h1 {
  margin: 8px 0 4px;
}

.receipt-header p {
  margin: 2px 0;
}

.receipt-header strong {
  color: var(--mb-red);
  display: block;
  margin-top: 8px;
}

.receipt-meta {
  border-bottom: 1px dashed rgba(43, 27, 18, 0.28);
  border-top: 1px dashed rgba(43, 27, 18, 0.28);
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 10px;
  margin: 16px 0;
  padding: 12px 0;
}

.receipt-meta dt {
  font-weight: 800;
}

.receipt-meta dd {
  margin: 0;
  text-align: right;
}

.receipt-table {
  border-collapse: collapse;
  width: 100%;
}

.receipt-table th,
.receipt-table td {
  border-bottom: 1px solid rgba(119, 74, 34, 0.12);
  padding: 8px 4px;
  text-align: left;
}

.receipt-table th:nth-child(2),
.receipt-table td:nth-child(2),
.receipt-table th:nth-child(3),
.receipt-table td:nth-child(3) {
  text-align: right;
}

.receipt-payments h2 {
  color: var(--mb-blue);
  margin-bottom: 4px;
}

.kitchen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.kitchen-card {
  border-top: 8px solid var(--mb-warning);
  padding: 16px;
}

.kitchen-card.status-preparing {
  border-top-color: var(--mb-blue);
}

.kitchen-card.status-ready {
  border-top-color: var(--mb-success);
}

.kitchen-card header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.kitchen-card h2 {
  color: var(--mb-blue);
  margin: 2px 0;
}

.kitchen-card p {
  color: rgba(43, 27, 18, 0.66);
  margin: 0;
}

.kitchen-no {
  color: var(--mb-red);
  font-weight: 800;
}

.status-pill {
  background: #fff8dd;
  border-radius: 999px;
  color: var(--mb-dark);
  font-weight: 800;
  padding: 6px 10px;
}

.kitchen-items {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 16px 0;
  padding: 0;
}

.kitchen-items li {
  background: #fff8dd;
  border-radius: 12px;
  display: flex;
  gap: 8px;
  padding: 10px;
}

.kitchen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inventory-actions,
.panel-header,
.form-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

.filter-bar {
  align-items: end;
  background: #fff;
  border: 2px solid rgba(119, 74, 34, 0.12);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(43, 27, 18, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
}

.filter-bar label {
  display: grid;
  font-weight: 800;
  gap: 4px;
}

.filter-bar select,
.filter-bar input,
.inventory-form input,
.inventory-form select,
.inventory-form textarea {
  border: 2px solid rgba(119, 74, 34, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
  width: 100%;
}

.inventory-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.warning-card strong {
  color: var(--mb-warning);
}

.danger-card strong {
  color: var(--mb-red);
}

.inventory-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.alert-row {
  border-bottom: 1px solid rgba(119, 74, 34, 0.12);
  display: grid;
  gap: 2px;
  padding: 10px 0;
}

.alert-row strong {
  color: var(--mb-blue);
}

.alert-row.danger strong {
  color: var(--mb-red);
}

.alert-row span {
  color: rgba(43, 27, 18, 0.68);
}

.inventory-form {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: grid;
  font-weight: 800;
  gap: 6px;
}

.form-grid-wide {
  grid-column: 1 / -1;
}

.delete-form {
  margin-top: 14px;
}

.table-actions {
  white-space: nowrap;
}

.table-actions a {
  color: var(--mb-blue);
  font-weight: 800;
  margin-right: 8px;
}

.dataTables_wrapper .dt-search input,
.dataTables_wrapper .dt-length select {
  border: 2px solid rgba(119, 74, 34, 0.18);
  border-radius: 10px;
  padding: 6px 8px;
}

.movement-filter {
  align-items: end;
}

.menu-thumb {
  border-radius: 10px;
  height: 48px;
  object-fit: cover;
  width: 64px;
}

.menu-detail-image {
  border-radius: 18px;
  display: block;
  margin-bottom: 16px;
  max-width: 260px;
  width: 100%;
}

.action-row,
.panel-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.report-tabs a {
  background: #fff;
  border: 2px solid rgba(119, 74, 34, 0.12);
  border-radius: 999px;
  box-shadow: 0 5px 14px rgba(43, 27, 18, 0.06);
  font-weight: 800;
  padding: 9px 14px;
}

.report-tabs a.active {
  background: var(--mb-blue);
  border-color: var(--mb-blue);
  color: #fff;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.report-table-panel {
  min-width: 0;
}

.report-filter select,
.report-filter input {
  min-width: 160px;
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .filter-bar,
  .report-tabs,
  .action-row,
  .no-print {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .main-panel {
    padding: 0;
  }

  .receipt-paper {
    border: 0;
    box-shadow: none;
    max-width: none;
    padding: 0;
  }

  .content-panel,
  .metric-card {
    border: 1px solid #ddd;
    box-shadow: none;
  }
}

@media (max-width: 840px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 16px;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .pos-shell {
    grid-template-columns: 1fr;
  }

  .inventory-metrics,
  .inventory-two-col,
  .report-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
  }

  .pos-search {
    grid-template-columns: 1fr;
  }
}
