/* ============================================
   Mockup styles — hi-fi product UI
   ============================================ */

/* Browser chrome */
.mk-browser {
  background: var(--surface);
  border-radius: var(--r-4);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  font-family: var(--font-sans);
}
.mk-browser__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.mk-browser__dots { display: flex; gap: 6px; }
.mk-browser__dots span {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--ink-200);
}
[data-theme="dark"] .mk-browser__dots span { background: rgba(255,255,255,0.1); }
.mk-browser__url {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface);
  height: 24px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  max-width: 360px;
}
.mk-browser__actions { color: var(--text-muted); }
.mk-browser__body { background: var(--bg-elev); height: calc(100% - 38px); overflow: hidden; }

/* App shell */
.mk-app {
  display: grid;
  grid-template-columns: 200px 1fr;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-size: 12.5px;
}

.mk-side {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mk-side__brand {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.mk-side__brand strong { font-size: 13.5px; letter-spacing: -0.02em; }
.mk-side__brand .logo-mark { width: 22px; height: 22px; }

.mk-side__company {
  display: flex; align-items: center; gap: 8px;
  padding: 6px;
  border-radius: 8px;
  background: var(--surface-2);
}
.mk-side__avatar {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.mk-side__name { font-size: 12px; font-weight: 600; letter-spacing: -0.01em; }
.mk-side__plan { font-size: 10px; color: var(--text-muted); }

.mk-side__group { display: flex; flex-direction: column; gap: 2px; }
.mk-side__lbl {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  padding: 6px 8px 4px;
}
.mk-side__item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-soft);
  cursor: default;
}
.mk-side__item.active {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 600;
}
[data-theme="dark"] .mk-side__item.active {
  background: rgba(10, 122, 191, 0.15);
  color: #fff;
}

/* Topbar */
.mk-main { display: flex; flex-direction: column; min-width: 0; }
.mk-topbar {
  height: 50px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.mk-search {
  flex: 1;
  max-width: 380px;
  display: flex; align-items: center; gap: 8px;
  height: 30px;
  padding: 0 10px;
  background: var(--surface-2);
  border-radius: 7px;
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
}
.mk-search kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 2px 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-faint);
}
.mk-search--inline { background: var(--surface); }
.mk-topbar__right {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
}
.mk-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: var(--r-full);
  font-size: 10.5px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.mk-pill--green {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(22,168,106,0.2);
}
.mk-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(22,168,106,0.15); }
.mk-bell, .mk-avatar {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
}
.mk-avatar { background: linear-gradient(135deg, #324560, #0B1B30); color: #fff; }

/* Content */
.mk-content {
  padding: 22px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}
.mk-h1-row { display: flex; align-items: center; justify-content: space-between; }
.mk-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.mk-h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 0; }
.mk-h1-cta { display: flex; gap: 8px; }

.mk-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
  font-family: var(--font-sans);
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.mk-btn--primary { background: var(--text); color: var(--bg); }
.mk-btn--brand { background: var(--brand-500); color: #fff; }
.mk-btn--ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text-soft); }

/* KPIs */
.mk-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.mk-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.mk-kpi__lbl { font-size: 10.5px; color: var(--text-muted); }
.mk-kpi__val { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0; }
.mk-kpi__delta { font-size: 10.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.mk-kpi__delta--up { color: var(--green); }
.mk-kpi__delta--down { color: var(--red); }
.mk-kpi__delta--warn { color: var(--amber); }

/* Rows */
.mk-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; min-height: 0; }
.mk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.mk-card__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.mk-card__title { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.mk-card__sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.mk-link { font-size: 11px; color: var(--brand-500); font-weight: 500; }
.mk-tabs { display: inline-flex; padding: 2px; background: var(--surface-2); border-radius: 6px; gap: 0; }
.mk-tabs button {
  height: 22px; padding: 0 8px; border-radius: 4px;
  font-size: 10.5px; font-weight: 500; color: var(--text-muted);
}
.mk-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* chart */
.mk-chart { width: 100%; height: 130px; display: block; }
.mk-chart-legend { display: flex; gap: 14px; font-size: 10.5px; color: var(--text-muted); margin-top: 6px; }
.mk-chart-legend i {
  display: inline-block; width: 8px; height: 8px; border-radius: 2px;
  margin-right: 5px;
}
.dot-brand { background: var(--brand-500); }
.dot-muted { background: var(--ink-400); }

/* activity rows */
.mk-row-item {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.mk-row-item:first-of-type { border-top: 0; }
.mk-row-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 11.5px; font-weight: 600;
  background: var(--surface-2);
  color: var(--text-soft);
}
.mk-row-icon--a { background: rgba(10,122,191,0.14); color: var(--brand-600); }
.mk-row-icon--b { background: rgba(217,142,31,0.14); color: var(--amber); }
.mk-row-icon--p { background: rgba(22,168,106,0.14); color: var(--green); }
.mk-row-icon--r { background: rgba(99,121,160,0.14); color: var(--ink-600); }
[data-theme="dark"] .mk-row-icon--r { color: var(--ink-300); }

.mk-row-label { font-size: 12px; font-weight: 600; letter-spacing: -0.01em; }
.mk-row-sub { font-size: 10.5px; color: var(--text-muted); }
.mk-row-amount { font-size: 12px; font-weight: 600; }

.mk-tag {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.mk-tag--green { background: var(--green-soft); color: var(--green); }
.mk-tag--amber { background: var(--amber-soft); color: var(--amber); }
.mk-tag--red { background: var(--red-soft); color: var(--red); }

/* Invoice */
.mk-invoice {
  display: flex; flex-direction: column;
  height: 100%;
  font-size: 12.5px;
}
.mk-invoice__hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.mk-invoice__back { font-size: 11px; color: var(--text-muted); }
.mk-invoice__title { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; }
.mk-invoice__hd-actions { display: flex; align-items: center; gap: 8px; }

.mk-invoice__body {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
  padding: 18px 22px;
  overflow: auto;
}
.mk-invoice__main, .mk-invoice__side {
  display: flex; flex-direction: column; gap: 14px;
}

.mk-field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mk-field label {
  display: block;
  font-size: 10.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.mk-select {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  background: var(--bg);
  color: var(--text);
}
.mk-select--client { padding: 8px; }
.mk-select svg { margin-left: auto; }

.mk-items__head, .mk-items__row {
  display: grid;
  grid-template-columns: 1.6fr 50px 90px 50px 100px;
  gap: 8px;
  align-items: center;
}
.mk-items__head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.mk-items__row {
  padding: 8px 4px;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
}
.mk-items__row:last-of-type { border-bottom: 0; }
.mk-items__add {
  margin-top: 8px;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--brand-500);
  font-weight: 500;
}

.mk-sum { display: flex; justify-content: space-between; font-size: 12px; padding: 6px 0; color: var(--text-soft); }
.mk-sum strong { color: var(--text); }
.mk-sum--total { font-size: 14px; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--border); }
.mk-sum--total strong { font-size: 18px; letter-spacing: -0.02em; }

.mk-cae {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(22,168,106,0.25);
  border-radius: 10px;
  background: var(--green-soft);
}
.mk-cae__lbl { font-size: 10px; font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); font-weight: 600; }
.mk-cae__val { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--green); margin-top: 2px; font-family: var(--font-mono); }
.mk-cae__sub { font-size: 10.5px; color: var(--text-soft); margin-top: 2px; }

.mk-channel {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}
.mk-channel--on { border-color: rgba(22,168,106,0.35); background: var(--green-soft); }
.mk-channel__ico {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-soft);
}
.mk-channel__ico--wa { background: #25D366; color: #fff; }
.mk-toggle {
  width: 32px; height: 18px;
  border-radius: var(--r-full);
  background: var(--ink-300);
  position: relative;
  flex-shrink: 0;
}
.mk-toggle i {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: #fff; border-radius: 50%;
  transition: transform 0.15s ease;
}
.mk-toggle.on { background: var(--green); }
.mk-toggle.on i { transform: translateX(14px); }

/* Stock */
.mk-stock {
  padding: 16px 18px;
  background: var(--bg);
  height: 100%;
  overflow: auto;
  font-size: 12.5px;
}
.mk-stock__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mk-stock__title { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; }
.mk-stock__actions { display: flex; gap: 6px; }

.mk-stock__filters { display: flex; gap: 6px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.mk-chip {
  display: inline-flex; align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-soft);
  background: var(--bg);
}
.mk-chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.mk-chip--warn { color: var(--amber); border-color: rgba(217,142,31,0.3); background: var(--amber-soft); }
.mk-stock__filters .mk-search--inline { max-width: 240px; height: 26px; }

.mk-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.mk-table__head, .mk-table__row {
  display: grid;
  grid-template-columns: 2.2fr 90px 90px 130px 100px 70px 24px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
}
.mk-table__head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.mk-table__row { border-bottom: 1px solid var(--border); font-size: 12px; }
.mk-table__row:last-of-type { border-bottom: 0; }
.mk-table__main { display: flex; align-items: center; gap: 10px; }
.mk-thumb {
  width: 32px; height: 32px; border-radius: 6px;
  background: linear-gradient(135deg, var(--ink-100), var(--ink-200));
  border: 1px solid var(--border);
}
[data-theme="dark"] .mk-thumb { background: linear-gradient(135deg, var(--surface-2), var(--surface)); }

.mk-stockcell { display: flex; align-items: center; gap: 8px; }
.mk-bar { flex: 1; height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; max-width: 60px; }
.mk-bar i { display: block; height: 100%; background: var(--green); border-radius: 2px; }
.mk-stockcell--low .mk-bar i { background: var(--amber); }
.mk-stockcell--critical .mk-bar i { background: var(--red); }
.mk-stockcell--low strong { color: var(--amber); }
.mk-stockcell--critical strong { color: var(--red); }

/* Phone */
.mk-phone {
  width: 270px;
  height: 540px;
  background: linear-gradient(180deg, #1c2a40, #0B1B30);
  border-radius: 38px;
  padding: 10px;
  position: relative;
  box-shadow: var(--shadow-lg), inset 0 0 0 2px rgba(255,255,255,0.04);
}
.mk-phone__notch {
  position: absolute;
  top: 14px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 22px;
  background: #050a14;
  border-radius: 14px;
  z-index: 2;
}
.mk-phone__screen {
  background: var(--bg);
  border-radius: 30px;
  height: 100%;
  padding: 36px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.mk-phone__sb {
  position: absolute; top: 12px; left: 24px; right: 24px;
  display: flex; justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}
.mk-phone__hello { margin-top: 2px; }
.mk-phone__kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}
.mk-phone__kpi .mk-chart { height: 60px; margin-top: 4px; }
.mk-phone__list { display: flex; flex-direction: column; gap: 8px; }
.mk-phone__item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
}
.mk-phone__fab {
  position: absolute;
  bottom: 20px; right: 20px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--brand-500);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-brand);
}
