/* ──────────────────────────────────────────────────────────────────
   manaMOBILE Portal Design System — single source of truth.
   Loaded by both partner storefront + partner dashboard.
   ────────────────────────────────────────────────────────────────── */
:root {
  --bg:           #F7F6F2;
  --surface:      #FFFFFF;
  --surface-2:    #FAF8F3;
  --border:       #E8E4DA;
  --border-soft:  #F0EDE5;
  --ink:          #1A1A1A;
  --ink-soft:     #4A4A4A;
  --muted:        #8A8A85;
  --brand:        #00838F;
  --brand-deep:   #006971;
  --brand-soft:   #4FB6BD;
  --brand-tint:   #E0F2F4;
  --accent:       #E65100;
  --accent-soft:  #FF8A4C;
  --accent-tint:  #FFF3E0;
  --success:      #2E7D32;
  --success-tint: #E8F5E9;
  --warning:      #C77700;
  --warning-tint: #FFF8E1;
  --danger:       #C62828;
  --danger-tint:  #FFEBEE;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Top bar ──────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 10px 24px; height: 56px;
}
.lockup { display: flex; align-items: center; gap: 14px; min-width: 200px; text-decoration: none; }
.lockup-logo { display: flex; flex-direction: column; line-height: 1; }
.lockup-brand { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.lockup-brand .b-mana   { color: var(--brand); }
.lockup-brand .b-mobile { color: var(--accent); }
.lockup-sub {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-top: 2px;
}
.org-name { font-size: 13px; padding-left: 16px; border-left: 1px solid var(--border); color: var(--ink-soft); }
.topbar-spacer { flex: 1; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: var(--r-md);
  background: var(--surface-2);
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.user-name { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }

/* ─── Left rail ─────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 220px 1fr; }
.leftrail {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px 12px; min-height: calc(100vh - 56px);
  position: sticky; top: 56px; height: calc(100vh - 56px);
  display: flex; flex-direction: column; gap: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-md);
  color: var(--ink-soft); font-size: 13px; font-weight: 500;
  text-decoration: none; cursor: pointer; transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--brand-tint); color: var(--brand-deep); font-weight: 600; }
.nav-item .ic { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav-section-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 12px 12px 6px; color: var(--muted);
}
.nav-section-label:first-child { padding-top: 0; }

/* ─── Main + page header ───────────────────────────────────────── */
.main { padding: 28px 32px 48px; max-width: 1200px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.page-sub { font-size: 13px; color: var(--muted); margin: 4px 0 0; }

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-md);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: all 0.12s;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-soft); color: #fff; text-decoration: none; }
.btn-brand   { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-deep); color: #fff; text-decoration: none; }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-outline:hover { border-color: var(--ink-soft); text-decoration: none; color: var(--ink); }
.btn-ghost   { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Card ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm);
}
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.card-sub   { font-size: 12px; color: var(--muted); margin: 0; }

/* ─── Stat ─────────────────────────────────────────────────────── */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stat:hover { border-color: var(--brand-soft); box-shadow: var(--shadow-md); }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.stat-sub   { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.stat-icon  {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: var(--brand-tint); color: var(--brand);
  display: flex; align-items: center; justify-content: center; margin-bottom: 4px;
}
.stat-trend { font-size: 12px; font-weight: 600; }
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ─── Status pill ──────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.pill-active  { background: var(--success-tint); color: var(--success); }
.pill-ready   { background: var(--brand-tint);   color: var(--brand-deep); }
.pill-warning { background: var(--warning-tint); color: var(--warning); }
.pill-danger  { background: var(--danger-tint);  color: var(--danger); }
.pill-muted   { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.pill-muted::before { background: var(--muted); }

/* ─── Form ─────────────────────────────────────────────────────── */
.form-field { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-soft); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: 14px; font-family: var(--font); background: var(--surface);
}
.form-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }

/* ─── Data table ────────────────────────────────────────────────── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.table-toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 10px 16px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border-soft); font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
.cell-primary  { font-weight: 600; }
.cell-secondary { color: var(--ink-soft); font-size: 12px; margin-top: 2px; }
.iccid { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }

/* ─── Usage bar ─────────────────────────────────────────────────── */
.usage { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.usage-bar { height: 6px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.usage-fill { height: 100%; background: linear-gradient(90deg, var(--brand-soft), var(--brand)); border-radius: 999px; }
.usage-fill.high { background: linear-gradient(90deg, var(--accent-soft), var(--accent)); }
.usage-label { font-size: 11px; color: var(--ink-soft); display: flex; justify-content: space-between; }

/* ─── Landing-page (storefront marketing) ──────────────────────── */
.partner-hero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  padding: 80px 24px 60px; text-align: center;
}
.partner-eyebrow {
  display: inline-block; padding: 6px 14px;
  background: var(--brand-tint); color: var(--brand-deep);
  border-radius: 999px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 20px;
}
.partner-h1 {
  font-size: 48px; font-weight: 700; line-height: 1.1;
  letter-spacing: -0.025em; margin: 0 auto 16px;
  max-width: 760px;
}
.partner-h1 em { color: var(--brand); font-style: normal; }
.partner-lead { font-size: 18px; color: var(--ink-soft); max-width: 600px; margin: 0 auto 32px; }
.partner-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.partner-section { padding: 64px 24px; max-width: 1100px; margin: 0 auto; }
.partner-section-title { font-size: 32px; font-weight: 700; text-align: center; letter-spacing: -0.02em; margin: 0 0 8px; }
.partner-section-sub { font-size: 16px; color: var(--ink-soft); text-align: center; margin: 0 auto 40px; max-width: 600px; }

.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.value-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 32px 28px; }
.value-icon { width: 48px; height: 48px; border-radius: var(--r-md); background: var(--brand-tint); color: var(--brand); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; font-size: 22px; }
.value-title { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.value-desc { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin: 0; }

.tier-table { width: 100%; max-width: 900px; margin: 0 auto; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.tier-table thead th { background: var(--ink); color: #fff; padding: 14px 16px; font-size: 12px; }
.tier-table tbody td { padding: 16px; font-size: 14px; border-bottom: 1px solid var(--border-soft); }
.tier-table tbody tr:last-child td { border-bottom: none; }
.tier-name { font-weight: 600; }
.tier-name.gold   { color: #B7791F; }
.tier-name.silver { color: #6B7280; }
.tier-name.bronze { color: #92400E; }

.login-card { max-width: 420px; margin: 40px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 32px; box-shadow: var(--shadow-md); }
.login-title { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
.login-sub   { font-size: 13px; color: var(--muted); margin: 0 0 24px; }

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .leftrail { display: none; }
  .main { padding: 20px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .value-grid { grid-template-columns: 1fr; }
  .partner-h1 { font-size: 32px; }
}
