:root {
  --bg: #dfe3ea;
  --surface: #f7f9fc;
  --panel: #ffffff;
  --ink: #15171c;
  --muted: #6d7480;
  --line: #e5e9f0;
  --dark: #14131b;
  --green: #107a5b;
  --green-soft: #e7f5ef;
  --yellow: #f6c65b;
  --red: #d95040;
  --shadow: 0 24px 70px rgba(54, 62, 78, 0.18);
  --small-shadow: 0 10px 28px rgba(37, 44, 58, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(1440px, calc(100vw - 44px));
  min-height: calc(100vh - 44px);
  margin: 22px auto;
  display: grid;
  grid-template-columns: 96px 1fr;
  overflow: hidden;
  border-radius: 36px;
  background: rgba(247, 249, 252, 0.72);
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  background: #edf1f7;
  border-right: 1px solid var(--line);
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  border-radius: 16px;
  color: #fff;
  background: var(--dark);
  font-weight: 800;
}

.nav-btn {
  min-height: 52px;
  border-radius: 18px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.nav-btn.active {
  color: #fff;
  background: var(--green);
  box-shadow: var(--small-shadow);
}

.nav-btn.locked span::after {
  content: " *";
  color: var(--red);
}

.workspace {
  padding: 32px;
  background: var(--surface);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.quick-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search {
  width: min(290px, 32vw);
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.primary-action,
.checkout-btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  color: #fff;
  background: var(--dark);
  font-weight: 800;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--small-shadow);
}

.metric-card {
  min-height: 148px;
  padding: 22px;
}

.metric-card p,
.metric-card span {
  color: var(--muted);
}

.metric-card p {
  margin-bottom: 12px;
  font-weight: 750;
}

.metric-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 36px;
}

.dark-card {
  color: #fff;
  background:
    radial-gradient(circle at 20% 20%, rgba(246, 198, 91, 0.5), transparent 28%),
    linear-gradient(145deg, #16151d, #262433);
}

.dark-card p,
.dark-card span {
  color: rgba(255, 255, 255, 0.72);
}

.dashboard-layout,
.pos-layout,
.phone-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 18px;
}

.panel {
  padding: 24px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.status-pill {
  white-space: nowrap;
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.warning {
  color: #855500;
  background: #fff4d5;
}

.ghost-btn {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 13px;
  color: var(--dark);
  background: #f0f3f8;
  font-weight: 800;
}

.order-list,
.inventory-list,
.cart-items {
  display: grid;
  gap: 10px;
}

.order-row,
.inventory-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.icon-box {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #f1f4f8;
  font-weight: 900;
}

.row-title {
  margin-bottom: 3px;
  font-weight: 850;
}

.row-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.amount {
  font-weight: 900;
}

.chart-card {
  padding: 18px;
  border-radius: 22px;
  background: #f2f5fa;
}

.line-chart {
  height: 168px;
  display: flex;
  align-items: end;
  gap: 13px;
  padding-top: 18px;
}

.line-chart span {
  flex: 1;
  min-width: 18px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, var(--green), #89d5b6);
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ai-box {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  color: #fff;
  background: var(--dark);
}

.ai-box .eyebrow {
  color: var(--yellow);
}

.ai-box p:last-child {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.74);
}

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

.menu-btn {
  min-height: 120px;
  display: grid;
  align-content: space-between;
  justify-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  text-align: left;
}

.menu-btn:hover,
.menu-btn:focus-visible {
  outline: 3px solid rgba(16, 122, 91, 0.18);
}

.menu-btn strong {
  font-size: 22px;
}

.menu-btn span {
  color: var(--muted);
  font-weight: 750;
}

.cart-panel {
  align-self: start;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.empty {
  min-height: 96px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed #cfd6e2;
  border-radius: 18px;
}

.option-group {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.option-group label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.option-group select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  background: #fff;
}

.checkbox-row {
  grid-template-columns: 22px 1fr;
  align-items: center;
}

.checkbox-row input,
.consent-box input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin: 22px 0;
  font-size: 18px;
}

.cart-total strong {
  font-size: 30px;
}

.checkout-btn {
  width: 100%;
  min-height: 58px;
}

.phone-frame {
  max-width: 430px;
  min-height: 620px;
  padding: 18px;
  border: 10px solid var(--dark);
  border-radius: 38px;
  background: #f4fbf7;
  box-shadow: var(--small-shadow);
}

.line-header {
  margin: -2px -2px 18px;
  padding: 14px 16px;
  border-radius: 22px;
  color: #fff;
  background: #06c755;
  font-weight: 900;
}

.chat-bubble {
  max-width: 78%;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.45;
}

.chat-bubble.shop {
  background: #fff;
  box-shadow: var(--small-shadow);
}

.rich-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 22px 0;
}

.rich-menu button {
  min-height: 70px;
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(23, 35, 44, 0.08);
}

.line-preview {
  min-height: 158px;
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

.line-preview p:last-child {
  margin-bottom: 0;
}

.line-price {
  color: var(--green);
  font-size: 30px;
  font-weight: 900;
}

.success-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--green);
  background: var(--green-soft);
  font-weight: 850;
}

.flow-steps {
  display: grid;
  gap: 12px;
}

.flow-steps article {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfe;
}

.flow-steps strong,
.promo-card strong {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--green);
}

.customer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 14px;
}

.customer-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
}

.points-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf3;
}

.points-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.inventory-row {
  grid-template-columns: 56px 1fr minmax(150px, 220px);
}

.supply-note {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #f4dfaa;
  border-radius: 18px;
  color: #735112;
  background: #fff8e6;
  font-weight: 750;
}

.admin-note {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #f4dfaa;
  border-radius: 18px;
  color: #735112;
  background: #fff8e6;
  font-weight: 750;
}

.supply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.supply-toggle {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--muted);
  background: #f0f3f8;
  font-size: 13px;
  font-weight: 850;
}

.supply-toggle.active.ok {
  color: #fff;
  background: var(--green);
}

.supply-toggle.active.low {
  color: #654300;
  background: var(--yellow);
}

.supply-toggle.active.out {
  color: #fff;
  background: var(--red);
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

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

.tab-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 13px;
  color: var(--muted);
  background: #f0f3f8;
  font-weight: 850;
}

.tab-btn.active {
  color: #fff;
  background: var(--green);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: #fff;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #f5f7fb;
  font-size: 12px;
  text-transform: uppercase;
}

.promo-list {
  display: grid;
  gap: 12px;
}

.promo-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfe;
}

.masked-data,
pre,
.api-status {
  padding: 16px;
  border-radius: 18px;
  background: #f1f4f8;
}

.masked-data p:last-child {
  margin-bottom: 0;
}

pre {
  overflow-x: auto;
  color: #fff;
  background: var(--dark);
  font-size: 12px;
  line-height: 1.6;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.settings-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.settings-grid input,
.settings-grid select {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  background: #fff;
}

.api-status {
  margin-top: 14px;
  color: var(--muted);
  font-weight: 800;
}

.lock-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 19, 26, 0.52);
}

.lock-modal.hidden {
  display: none;
}

.lock-card {
  width: min(420px, 100%);
  padding: 24px;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.lock-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.lock-card input {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
}

.lock-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.lock-error {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--red);
  font-weight: 800;
}

.security-grid article,
.consent-box {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fbfcfe;
}

.security-grid article p,
.consent-box {
  color: var(--muted);
}

.security-grid .wide {
  grid-column: 1 / -1;
  color: #fff;
  background: var(--dark);
}

.security-grid .wide p {
  color: rgba(255, 255, 255, 0.76);
}

.consent-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .app-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    grid-template-columns: 1fr;
    border-radius: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-direction: row;
    overflow-x: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-mark {
    flex: 0 0 48px;
    margin: 0 8px 0 0;
  }

  .nav-btn {
    min-width: 82px;
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .quick-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }

  .metrics-grid,
  .dashboard-layout,
  .pos-layout,
  .phone-layout,
  .customer-grid,
  .security-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .phone-frame {
    max-width: none;
  }

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

  .inventory-row,
  .order-row {
    grid-template-columns: 48px 1fr;
  }

  .amount,
  .supply-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}
