:root {
  --navy: #10263f;
  --navy-2: #183652;
  --cyan: #0da9b4;
  --cyan-hover: #088f99;
  --cyan-soft: #e7f7f7;
  --canvas: #f4f7f9;
  --surface: #ffffff;
  --surface-alt: #f9fbfc;
  --line: #e4ecef;
  --text-main: #10263f;
  --muted: #6d7b87;
  --danger: #d95858;
  --danger-soft: #fff0f0;
  --success: #168763;
  --success-soft: #e8f7f1;
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }

body {
  font-family: var(--font-body);
  background-color: var(--canvas);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; }

.win-header {
  background: var(--navy);
  color: #ffffff;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(16, 38, 63, 0.1);
  z-index: 20;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-right { display: flex; align-items: center; gap: 10px; }

.clock-box {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.08);
  color: #d8e4ef;
  padding: 7px 14px;
  border-radius: 9px;
}

.status-badge {
  padding: 7px 13px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
  font-size: 12px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s;
}
.status-badge:hover { background: rgba(255, 255, 255, 0.14); }
.status-badge.online { color: #94dec7; }
.status-badge.offline { color: #ffabab; }

.nav-bar {
  background: var(--surface);
  padding: 0 24px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab-btn {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  padding: 13px 18px;
  background: transparent;
  color: var(--muted);
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--navy); background: var(--surface-alt); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--cyan); }

.workspace { flex: 1; display: none; padding: 18px 24px; overflow: hidden; gap: 20px; }
.workspace.active { display: flex; }

.win-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(16, 38, 63, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.full-panel { flex: 1; }
.pos-left { flex: 1.65; }
.pos-right { flex: 1; min-width: 360px; max-width: 430px; }

.panel-title {
  background: var(--surface);
  color: var(--navy);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-90s {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  color: var(--navy);
  transition: background 0.15s, transform 0.1s;
}
.btn-90s:hover { background: var(--surface-alt); transform: translateY(-1px); }
.btn-90s.primary { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.btn-90s.primary:hover { background: var(--cyan-hover); }
.btn-90s.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-90s.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 11px; border-radius: 7px; }
.btn-checkout { width: 100%; padding: 14px; font-size: 14px; border-radius: 12px; margin-top: 6px; }

.input-90s {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  color: var(--navy);
  background: var(--surface);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-90s:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(13, 169, 180, 0.15); }
.auto-w { width: auto; }
.hidden { display: none !important; }

.cat-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.cat-bar .btn-90s { border-radius: 20px; padding: 7px 16px; border: none; background: transparent; color: var(--muted); }
.cat-bar .btn-90s:hover { background: #eaf0f3; color: var(--navy); }
.cat-bar .btn-90s.primary { background: var(--navy); color: #fff; }

.menu-grid {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 14px;
  overflow-y: auto;
  flex: 1;
}
.menu-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.menu-card:hover { border-color: #bfdcdf; box-shadow: 0 10px 24px rgba(16, 38, 63, 0.08); transform: translateY(-3px); }
.card-media {
  position: relative;
  height: 105px;
  background: #edf2f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media svg { width: 38px; height: 38px; color: var(--navy); opacity: 0.65; }
.cat-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 9px;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.92);
  padding: 3px 8px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}
.card-body { padding: 12px; display: flex; flex-direction: column; justify-content: space-between; flex: 1; }
.item-name { font-family: var(--font-heading); font-weight: 700; font-size: 13px; line-height: 1.35; margin-bottom: 6px; color: var(--navy); }
.item-price { font-weight: 700; font-size: 13px; color: var(--cyan); }

.cart-list { flex: 1; overflow-y: auto; padding: 12px 20px; }
.cart-item { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-item-thumb { width: 46px; height: 46px; border-radius: 10px; background: #eaf0f3; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-thumb svg { width: 22px; height: 22px; color: var(--navy); opacity: 0.6; }
.cart-item-info strong { display: block; font-family: var(--font-heading); font-size: 12px; color: var(--navy); }
.cart-item-info span { font-size: 11px; color: var(--cyan); font-weight: 600; }
.qty-controls { display: flex; align-items: center; gap: 6px; }
.qty-btn { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--navy); cursor: pointer; }
.qty-btn:hover { background: var(--cyan-soft); }

.cart-summary { padding: 18px 20px; background: var(--surface-alt); border-top: 1px solid var(--line); }
.total-display { font-family: var(--font-heading); font-weight: 800; font-size: 26px; color: var(--navy); text-align: right; margin-bottom: 12px; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.pay-btn { padding: 10px; font-family: var(--font-heading); font-weight: 700; font-size: 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); cursor: pointer; }
.pay-btn.selected { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-soft); }
.quick-cash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 8px; }
.quick-cash .btn-90s { padding: 8px 3px; font-size: 11px; text-align: center; }
.change-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-weight: 700; font-size: 13px; }
.change-row span:last-child { color: var(--success); }
.bank-box { font-size: 12px; background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }

.form-toolbar, .filter-toolbar { padding: 14px 20px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--surface-alt); border-bottom: 1px solid var(--line); }
.form-toolbar .input-90s { flex: 1; min-width: 160px; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 16px 20px; }
.kpi-card { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.kpi-label { font-size: 10px; font-family: var(--font-heading); font-weight: 700; text-transform: uppercase; color: var(--muted); }
.kpi-val { font-family: var(--font-heading); font-size: 20px; font-weight: 800; color: var(--navy); margin-top: 4px; }

.table-container { flex: 1; overflow: auto; padding: 12px 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: var(--surface-alt); color: var(--navy); font-family: var(--font-heading); font-weight: 700; padding: 10px 12px; text-align: left; position: sticky; top: 0; border-bottom: 2px solid var(--line); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }

.table-thumb { width: 42px; height: 42px; border-radius: 8px; background: #edf2f5; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.table-thumb img { width: 100%; height: 100%; object-fit: cover; }
.table-thumb svg { width: 20px; height: 20px; color: var(--navy); opacity: 0.6; }

.settings-box { padding: 18px 24px; gap: 16px; overflow-y: auto; }
.setting-card { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.setting-card h3 { font-family: var(--font-heading); font-size: 15px; margin-bottom: 6px; }
.setting-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(16, 38, 63, 0.45); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.modal-window { width: 92%; max-width: 420px; border-radius: 18px; }
.modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-msg { font-size: 14px; font-weight: 600; line-height: 1.45; }
.modal-inputs { display: flex; flex-direction: column; gap: 10px; font-size: 13px; font-weight: 600; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

@media (max-width: 1024px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 340px; }
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); }
}
@media (max-width: 850px) {
  .workspace.active { flex-direction: column; overflow-y: auto; }
  .pos-left, .pos-right { flex: none; width: 100%; max-width: none; }
}
