/* Developed by Ujang Abdus Salam | NIM 24120110005 */
/* Dasar */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f5f1ea;
  --surface: #ffffff;
  --surface-strong: #efe7dc;
  --text: #241c16;
  --text-soft: #6b6159;
  --brand: #6d4328;
  --brand-dark: #3f281b;
  --accent: #6f8a66;
  --border: #d8cec2;
  --shadow: 0 10px 24px rgba(40, 27, 18, 0.08);
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image: linear-gradient(180deg, #f7f3ed 0%, #f1ebe2 100%);
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

a:hover {
  color: var(--brand);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
label:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

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

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

input,
select,
textarea,
button {
  font: inherit;
}

/* Tata letak */
.container {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
}

.cluster--between {
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.cluster--end {
  align-items: end;
  gap: 20px;
}

.cluster--nav {
  gap: 10px;
}

.cluster--actions {
  gap: 12px;
}

.flow > * + * {
  margin-top: 16px;
}

.flow--sm > * + * {
  margin-top: 10px;
}

.flow--lg > * + * {
  margin-top: 28px;
}

.switcher {
  display: grid;
  gap: 18px;
}

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

.split {
  display: grid;
  gap: 24px;
  align-items: stretch;
}

.split--hero {
  grid-template-columns: 1.4fr 1fr;
}

.sidebar {
  display: grid;
  gap: 20px;
  align-items: start;
}

.sidebar--wide {
  grid-template-columns: 1.4fr 0.8fr;
}

.frame {
  overflow-x: auto;
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.app-main {
  min-width: 0;
}

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

.login-main-shell {
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

/* Helper kecil */
.eyebrow {
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.muted-text {
  color: var(--text-soft);
}

.text-contrast {
  color: #fff0d9;
  font-weight: 700;
}

.text-link {
  font-weight: 700;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.breadcrumb span {
  color: var(--text-soft);
}

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

/* Komponen */
.site-header {
  position: sticky;
  top: 10px;
  z-index: 40;
  margin-bottom: 28px;
  padding: 16px 20px;
  background-color: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.site-header .nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.nav-drawer {
  margin-left: auto;
  position: relative;
}

.nav-toggle {
  display: none;
}

.nav-toggle-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background-color: #f2ede6;
  color: var(--brand-dark);
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
}

.nav-drawer-close {
  display: none;
}

.brand {
  font-size: 1.7rem;
  line-height: 1.1;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(77, 47, 30, 0.12);
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  display: none;
}

.meta-chip {
  padding: 8px 12px;
  background-color: #f2ede6;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.sidebar-nav {
  display: none;
}

.nav-list {
  list-style: none;
}

.nav-link {
  display: inline-flex;
  width: auto;
  padding: 11px 16px;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  background-color: #f3ece3;
  border-color: var(--border);
  color: var(--brand-dark);
  transform: none;
}

.hero {
  margin-bottom: 28px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #fbf8f4 0%, #f2ebe2 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.hero-title {
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1.1;
  text-wrap: balance;
}

.hero-panel,
.card,
.form-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 14px;
  color: var(--text);
}

.label,
.card-kicker {
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.list {
  padding-left: 20px;
}

.section-head {
  margin-bottom: 16px;
}

.card-grid {
  margin-bottom: 28px;
}

.card {
  padding: 14px;
}

.card-title {
  font-size: 1.08rem;
}

.stat-value {
  font-size: 1.8rem;
  color: var(--brand-dark);
}

.table-wrap {
  margin-bottom: 28px;
  padding: 8px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #eadccb;
  vertical-align: middle;
}

.table thead th {
  color: var(--brand-dark);
  background-color: #f4eee6;
  font-size: 0.92rem;
}

.table tbody tr {
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.table tbody tr:hover {
  background-color: #fbf3e8;
}

.product-thumb {
  width: 96px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
}

.form-box {
  padding: 18px;
}

.form {
  width: 100%;
}

.fieldset {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.legend {
  padding: 0 10px;
  color: var(--brand-dark);
  font-weight: 700;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.input {
  width: 100%;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #ccb7a0;
  border-radius: 12px;
  background-color: #fffdfa;
  color: var(--text);
}

.textarea {
  resize: vertical;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 140px;
  padding: 11px 18px;
  border: none;
  border-radius: 12px;
  background-color: var(--brand);
  color: #fff8f2;
  box-shadow: 0 8px 18px rgba(77, 47, 30, 0.14);
  cursor: pointer;
  font-weight: 700;
}

.btn:hover {
  background-color: var(--brand-dark);
  color: #fff8f2;
}

.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.site-footer {
  margin-top: 28px;
  padding: 16px 20px;
  background-color: rgba(77, 47, 30, 0.96);
  border-radius: 16px;
  color: #fff3e7;
  text-align: center;
  box-shadow: var(--shadow);
}

.login-note {
  margin-top: 16px;
  color: var(--text-soft);
}

.login-page {
  background-image:
    linear-gradient(rgba(32, 22, 16, 0.28), rgba(32, 22, 16, 0.28)),
    linear-gradient(180deg, #f7f3ed 0%, #ece4d9 100%);
}

.login-page .sidebar-nav,
.login-page .site-footer,
.login-page .breadcrumb {
  display: none;
}

.login-page .site-header {
  margin-bottom: 20px;
}

.login-main {
  min-height: calc(100vh - 220px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-hero {
  display: none;
}

.login-modal-card {
  position: relative;
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(33, 22, 16, 0.16);
}

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

.mini-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  border-radius: 10px;
  background-color: #f2ede6;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
}

.mini-link:hover {
  background-color: var(--brand);
  color: #fff7ef;
}

.compact-note {
  padding: 14px 16px;
  background-color: #f7efe4;
  border-radius: 12px;
}

.chip-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  background-color: #f2ede6;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.chip-filter:hover {
  background-color: var(--brand);
  color: #fff7ef;
}

.ops-grid,
.queue-board {
  margin-bottom: 28px;
}

.summary-list {
  padding: 16px;
  background-color: #f7efe4;
  border-radius: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2d2bf;
}

.summary-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.summary-sticky {
  position: sticky;
  top: 24px;
}

.choice-table .select-cell {
  width: 84px;
}

.select-label {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  background-color: #f4eadb;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.select-label:hover {
  background-color: var(--brand);
  color: #fff7ef;
}

.customer-panel {
  display: none;
}

#cust-1:checked ~ .app-shell .customer-row--1,
#cust-2:checked ~ .app-shell .customer-row--2,
#cust-3:checked ~ .app-shell .customer-row--3,
#cust-4:checked ~ .app-shell .customer-row--4,
#cust-5:checked ~ .app-shell .customer-row--5 {
  background-color: #f7efe4;
}

#cust-1:checked ~ .app-shell .customer-row--1 .select-label,
#cust-2:checked ~ .app-shell .customer-row--2 .select-label,
#cust-3:checked ~ .app-shell .customer-row--3 .select-label,
#cust-4:checked ~ .app-shell .customer-row--4 .select-label,
#cust-5:checked ~ .app-shell .customer-row--5 .select-label {
  background-color: var(--brand);
  color: #fff7ef;
}

#cust-1:checked ~ .app-shell .customer-panel--1,
#cust-2:checked ~ .app-shell .customer-panel--2,
#cust-3:checked ~ .app-shell .customer-panel--3,
#cust-4:checked ~ .app-shell .customer-panel--4,
#cust-5:checked ~ .app-shell .customer-panel--5 {
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  padding: 32px 16px;
  background-color: rgba(36, 25, 18, 0.55);
  z-index: 50;
}

.modal:target {
  display: grid;
  place-items: center;
}

.modal__card {
  width: min(560px, 100%);
  padding: 20px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  position: relative;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background-color: #f2ede6;
  border: 1px solid var(--border);
  color: transparent;
  overflow: hidden;
  font-size: 0;
}

.modal__close::before {
  content: "×";
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
}

.modal__card .btn {
  width: auto;
}

.modal__card .inline-actions {
  margin-top: 6px;
  padding-top: 4px;
}

.modal__card .compact-note {
  margin-top: 4px;
}

.quick-edit {
  display: grid;
  gap: 12px;
}

.quick-edit summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  border-radius: 12px;
  background-color: #f2ede6;
  font-weight: 700;
}

.quick-edit[open] summary {
  background-color: var(--brand);
  color: #fff7ef;
}

.selection-grid {
  display: grid;
  gap: 12px;
}

.selection-card {
  display: block;
  padding: 10px 12px;
  border: 1px solid #dcc9b2;
  border-radius: 12px;
  background-color: #fffaf2;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.selection-card:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.selection-card strong {
  display: block;
  color: var(--brand-dark);
}

.selection-card span {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.compact-grid {
  display: grid;
  gap: 12px;
}

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

.compact-list {
  display: grid;
  gap: 10px;
}

.data-list {
  display: grid;
  gap: 8px;
}

.data-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eadccb;
}

.data-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.quick-edit__body {
  padding: 14px;
  border-radius: 12px;
  background-color: #f7efe4;
}

.filter-panel {
  display: none;
}

.action-state {
  display: none;
}

.action-state:target {
  display: block;
}

#item-latte,
#item-coffee,
#item-donut {
  display: none;
}

#menu-view-all:checked ~ .app-shell .menu-panel--all,
#menu-view-drinks:checked ~ .app-shell .menu-panel--drinks,
#menu-view-snacks:checked ~ .app-shell .menu-panel--snacks,
#stock-view-all:checked ~ .app-shell .stock-panel--all,
#stock-view-alert:checked ~ .app-shell .stock-panel--alert,
#stock-view-safe:checked ~ .app-shell .stock-panel--safe {
  display: block;
}

#item-latte:checked ~ .app-shell label[for="item-latte"],
#item-coffee:checked ~ .app-shell label[for="item-coffee"],
#item-donut:checked ~ .app-shell label[for="item-donut"] {
  border-color: var(--brand);
  background-color: #f1e3cf;
}

#item-latte:checked ~ .app-shell .order-state--latte,
#item-coffee:checked ~ .app-shell .order-state--coffee,
#item-donut:checked ~ .app-shell .order-state--donut {
  display: block;
}

#menu-view-all:checked ~ .app-shell label[for="menu-view-all"],
#menu-view-drinks:checked ~ .app-shell label[for="menu-view-drinks"],
#menu-view-snacks:checked ~ .app-shell label[for="menu-view-snacks"],
#stock-view-all:checked ~ .app-shell label[for="stock-view-all"],
#stock-view-alert:checked ~ .app-shell label[for="stock-view-alert"],
#stock-view-safe:checked ~ .app-shell label[for="stock-view-safe"] {
  background-color: var(--brand);
  color: #fff7ef;
}

/* Variasi */
.is-dashboard {
  background: linear-gradient(180deg, #faf6f1 0%, #ede3d6 100%);
}

.is-order {
  background: linear-gradient(180deg, #faf6f1 0%, #ece1d2 100%);
}

.is-login {
  grid-template-columns: 1fr;
  text-align: center;
  background: linear-gradient(180deg, #faf6f1 0%, #ece1d2 100%);
}

.is-subpage {
  grid-template-columns: 1fr;
}

.is-featured,
.is-form-featured,
.is-form-login {
  position: relative;
  overflow: hidden;
}

.is-featured::after,
.is-form-featured::after,
.is-form-login::after {
  content: "";
  position: absolute;
  inset: auto -40px -50px auto;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(149, 178, 135, 0.3), transparent 70%);
}

.is-featured {
  background: linear-gradient(180deg, #fffaf6 0%, #f4eadf 100%);
  border-color: #cbb197;
  transform: none;
}

.is-form-featured {
  background: linear-gradient(180deg, #fffdf9 0%, #f3eadf 100%);
}

.is-form-login {
  width: min(520px, 100%);
  margin: 0 auto;
  background: linear-gradient(180deg, #fffdf9 0%, #f3eadf 100%);
}

.is-ghost {
  background-color: var(--surface-strong);
  color: var(--text);
}

.is-ghost:hover {
  background-color: #e8d6bf;
  color: var(--text);
}

.is-available {
  background-color: #d8ead0;
  color: #35542d;
}

.is-low {
  background-color: #f7ddb3;
  color: #8c5a17;
}

.is-out {
  background-color: #f5c6bf;
  color: #8b3024;
}

@media (max-width: 900px) {
  .sidebar-nav {
    position: static;
  }

  .cluster--between,
  .cluster--end {
    flex-direction: column;
    align-items: stretch;
  }

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

  .split--hero,
  .sidebar--wide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 20px, 1120px);
  }

  .site-header,
  .hero,
  .card,
  .form-box,
  .site-footer,
  .sidebar-nav {
    padding: 20px;
  }

  .switcher--4 {
    grid-template-columns: 1fr;
  }

  .site-header {
    top: 0;
  }

  .site-header {
    gap: 12px;
    align-items: center;
  }

  .nav-drawer {
    margin: 0;
    align-self: center;
  }

  .brand-lockup {
    margin: 0;
    align-self: center;
  }

  .nav-toggle-button {
    display: inline-flex;
  }

  .site-header .nav-list {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 82vw);
    margin: 0;
    padding: 72px 16px 16px;
    display: grid;
    grid-auto-rows: min-content;
    grid-template-columns: 1fr;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.98);
    border-right: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(36, 24, 16, 0.16);
    transform: translateX(-108%);
    transition: transform 0.22s ease;
    z-index: 60;
  }

  .nav-toggle:checked ~ .nav-list {
    transform: translateX(0);
  }

  .nav-drawer-close {
    position: fixed;
    inset: 0;
    display: none;
    background-color: rgba(36, 24, 16, 0.22);
    z-index: 50;
  }

  .nav-toggle:checked ~ .nav-drawer-close {
    display: block;
  }

  .nav-link,
  .btn {
    width: 100%;
    justify-content: center;
  }

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

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

  .site-header,
  .sidebar-nav,
  .site-footer,
  .btn,
  .mini-link,
  .modal,
  .breadcrumb,
  .header-meta {
    display: none !important;
  }

  .container {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .app-shell,
  .sidebar,
  .split {
    display: block;
  }

  .hero,
  .card,
  .form-box,
  .table-wrap {
    box-shadow: none;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    break-inside: avoid;
  }
}
