/* BurmaMart merchant portal.
   Tokens (--green, --gold, --paper, --text …) come from storefront.css, which
   this file is always loaded after — the portal is a different surface of the
   same brand, not a different brand, and it inherits the light/dark toggle. */

*, *::before, *::after { box-sizing: border-box; }
body.mp {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
a { color: inherit; }

/* ── Shell ─────────────────────────────────────────────────────────────── */
.mp-shell { display: flex; min-height: 100vh; }

.mp-side {
  width: 232px; flex: 0 0 232px;
  background: var(--green-grad-deep);
  color: #EDF3EE;
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.mp-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 16px; margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.mp-brand img { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; background: #fff; }
.mp-brand b { font-size: 15px; letter-spacing: .2px; }
.mp-brand span { display: block; font-size: 11px; color: rgba(237,243,238,.55); font-weight: 500; }

.mp-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 11px; border-radius: 10px;
  color: rgba(237,243,238,.78);
  text-decoration: none; font-size: 14px; font-weight: 500;
}
.mp-nav:hover { background: rgba(255,255,255,.07); color: #fff; }
.mp-nav.is-on { background: var(--gold); color: #24200F; font-weight: 700; }
.mp-nav .pill {
  min-width: 20px; padding: 1px 7px; border-radius: 999px;
  background: rgba(255,255,255,.16); color: #fff;
  font-size: 11px; font-weight: 700; text-align: center;
}
.mp-nav.is-on .pill { background: rgba(0,0,0,.22); color: #fff; }
.mp-nav .pill.hot { background: var(--red); color: #fff; }

.mp-side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.10); }
.mp-shop { display: flex; align-items: center; gap: 9px; padding: 8px; font-size: 13px; }
.mp-shop img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.mp-shop b { display: block; font-size: 13px; }
.mp-shop span { font-size: 11px; color: rgba(237,243,238,.55); }

.mp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mp-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 26px; background: var(--paper);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.mp-top h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.mp-top .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mp-body { padding: 22px 26px 60px; }

/* ── Cards + grid ──────────────────────────────────────────────────────── */
.mp-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.mp-card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.mp-grid { display: grid; gap: 14px; }
.mp-grid.k4 { grid-template-columns: repeat(4, 1fr); }
.mp-grid.k3 { grid-template-columns: repeat(3, 1fr); }
.mp-grid.k2 { grid-template-columns: repeat(2, 1fr); }

.mp-kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.mp-kpi .value { font-size: 24px; font-weight: 800; margin-top: 6px; color: var(--gold-ink); letter-spacing: -.5px; }
.mp-kpi .foot { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Tables ────────────────────────────────────────────────────────────── */
.mp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mp-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--line);
}
.mp-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.mp-table tr:last-child td { border-bottom: 0; }
.mp-table tbody tr:hover { background: var(--paper-2); }
.mp-scroll { overflow-x: auto; }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
  background: var(--paper-2); color: var(--text-soft); border: 1px solid var(--line);
}
.badge.act { background: #FDF1D8; color: #7A5B08; border-color: #EBD9A8; }
.badge.go  { background: var(--green-light); color: var(--green-deep); border-color: transparent; }
.badge.bad { background: #FDE7E8; color: var(--red-deep); border-color: #F5C9CC; }
[data-theme="dark"] .badge.act { background: rgba(233,168,62,.16); color: #E9C071; border-color: transparent; }
[data-theme="dark"] .badge.bad { background: rgba(225,28,41,.16); color: #FF8A8F; border-color: transparent; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none;
  font-family: inherit; line-height: 1.2;
}
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-grad-deep); }
.btn.gold { background: var(--gold); color: #24200F; }
.btn.ghost { background: var(--paper); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--paper-2); }
.btn.danger { background: var(--red); color: #fff; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Tabs ──────────────────────────────────────────────────────────────── */
.mp-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.mp-tab {
  padding: 7px 14px; border-radius: 999px; text-decoration: none;
  font-size: 13.5px; font-weight: 600; color: var(--text-soft);
  background: var(--paper); border: 1px solid var(--line);
}
.mp-tab.is-on { background: var(--green); color: #fff; border-color: var(--green); }
.mp-tab .n { opacity: .7; font-weight: 700; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.mp-field { margin-bottom: 14px; }
.mp-field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 5px; color: var(--text-soft); }
.mp-field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.mp-in {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--input-bg); color: var(--text);
  font-size: 14px; font-family: inherit;
}
.mp-in:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: transparent; }
textarea.mp-in { min-height: 96px; resize: vertical; }
.mp-err { color: var(--err); font-size: 12.5px; margin-top: 4px; font-weight: 600; }

/* ── Flash ─────────────────────────────────────────────────────────────── */
.mp-flash {
  padding: 11px 15px; border-radius: 10px; margin-bottom: 16px;
  font-size: 14px; font-weight: 600;
  background: var(--green-light); color: var(--green-deep);
}
.mp-flash.err { background: #FDE7E8; color: var(--red-deep); }
[data-theme="dark"] .mp-flash.err { background: rgba(225,28,41,.16); color: #FF8A8F; }

.mp-empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.mp-empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 5px; }

/* ── Login ─────────────────────────────────────────────────────────────── */
.mp-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--green-grad-deep);
}
.mp-login-card {
  width: 100%; max-width: 400px; background: var(--paper);
  border-radius: 18px; padding: 30px; box-shadow: var(--shadow-lg);
}
.mp-login-card h1 { margin: 0 0 4px; font-size: 21px; font-weight: 800; }
.mp-login-card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }

/* ── Chat ──────────────────────────────────────────────────────────────── */
.mp-chat { display: grid; grid-template-columns: 280px 1fr; gap: 14px; align-items: start; }
.mp-thread { display: flex; flex-direction: column; gap: 9px; max-height: 58vh; overflow-y: auto; padding: 4px; }
.bubble { max-width: 74%; padding: 9px 13px; border-radius: 14px; font-size: 14px; }
.bubble.them { background: var(--paper-2); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.me { background: var(--green); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble .when { display: block; font-size: 10.5px; opacity: .6; margin-top: 3px; }
.mp-conv {
  display: block; padding: 10px; border-radius: 10px; text-decoration: none;
  border: 1px solid transparent;
}
.mp-conv:hover { background: var(--paper-2); }
.mp-conv.is-on { background: var(--sel-tint); border-color: var(--green); }
.mp-conv b { display: block; font-size: 13.5px; }
.mp-conv span { font-size: 12px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--paper-2); }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

@media (max-width: 900px) {
  .mp-grid.k4 { grid-template-columns: repeat(2, 1fr); }
  .mp-grid.k3, .mp-grid.k2 { grid-template-columns: 1fr; }
  .mp-chat { grid-template-columns: 1fr; }
  .mp-side { position: fixed; left: -240px; z-index: 60; transition: left .2s; }
  .mp-side.open { left: 0; }
  .mp-body { padding: 16px 14px 50px; }
  .mp-top { padding: 12px 14px; }
}
