/* Vendored verbatim from the design repo: ui/assets/meridian.css (Meridian design system, shared with foundation-core).
   Update by re-copying the source file; do not edit here. */
/* =========================================================
   BerriesCloud — Meridian Design System
   Shared stylesheet for all Account & Settings screens.

   Direction: warm dark sidebar (#1F1C1B), warm-gray neutrals,
   Lora serif for page titles, Inter for everything else.
   Interactive color = Atlassian blue (#0052CC).
   Brand red (#C01E2A) = logo mark only.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Lora:wght@500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Neutrals — warm gray */
  --bg:        #FAFAF8;
  --surface:   #FFFFFF;
  --surface-2: #FDFCFB;
  --border:    #E8E5E2;
  --border-hv: #D4CFC9;
  --text-1:    #1A1917;
  --text-2:    #6B6560;
  --text-3:    #9E9891;

  /* Brand — logo only */
  --brand:     #C01E2A;

  /* Interactive — Atlassian blue */
  --accent:    #0052CC;
  --accent-lt: #DEEBFF;
  --accent-bd: #4C9AFF;
  --accent-hv: #0747A6;
  --accent-ed: #E8F2FF;
  --accent-edbd:#B3D4FF;

  /* Semantic */
  --ok:        #166534;
  --ok-lt:     #DCFCE7;
  --warn:      #92400E;
  --warn-lt:   #FEF3C7;
  --err:       #B91C1C;
  --err-lt:    #FEE2E2;
  --err-bd:    #FCA5A5;

  /* Sidebar */
  --sb-bg:     #1F1C1B;
  --sb-bd:     #2C2927;
  --sb-text:   #C9C3BC;
  --sb-muted:  #6B6560;
  --sb-hv:     #2A2523;

  /* Super-admin sidebar variant — cooler, signals "internal" */
  --sa-bg:     #1C2128;
  --sa-bd:     #2D333B;
  --sa-text:   #ADBAC7;
  --sa-muted:  #636E7B;
  --sa-hv:     #2D333B;
  --sa-accent: #8957E5;   /* violet — distinguishes internal tooling */
  --sa-accent-lt:#F3EEFC;
  --sa-accent-bd:#C9AFF0;

  --r-card:    6px;
  --r-btn:     4px;
  --r-pill:    20px;

  --font:      'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif:     'Lora', Georgia, serif;
  --mono:      'JetBrains Mono', 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- Shell ---------- */
.shell { display: flex; height: 100vh; overflow: hidden; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 224px; flex-shrink: 0; background: var(--sb-bg);
  display: flex; flex-direction: column; overflow-y: auto;
}
.sb-logo {
  padding: 18px 16px 16px; border-bottom: 1px solid var(--sb-bd);
  display: flex; align-items: center; gap: 10px;
}
.sb-mark {
  width: 30px; height: 30px; background: var(--brand); border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 17px; color: #fff; flex-shrink: 0;
}
.sb-name { font-size: 13px; font-weight: 600; color: #F5F1ED; letter-spacing: -0.01em; }
.sb-env  { font-size: 10px; color: var(--sb-muted); margin-top: 1px; }

.sb-nav { flex: 1; padding-bottom: 8px; }
.nav-grp { padding: 16px 0 2px; }
.nav-cap {
  padding: 0 16px 6px; font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--sb-muted);
}
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 16px;
  font-size: 12.5px; color: var(--sb-text); border-left: 3px solid transparent; cursor: pointer;
}
.nav-item:hover { background: var(--sb-hv); color: #F0EDE9; }
.nav-item.active { background: var(--sb-hv); color: #fff; border-left-color: var(--accent); font-weight: 500; }
.nav-ic { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.65; }
.nav-item.active .nav-ic { opacity: 1; }
.nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 600; color: var(--sb-muted);
  background: rgba(255,255,255,0.06); padding: 1px 7px; border-radius: 10px;
}

.sb-footer {
  margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--sb-bd);
  display: flex; align-items: center; gap: 9px;
}
.av {
  border-radius: 50%; background: var(--accent); color: #fff;
  font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.av-26 { width: 26px; height: 26px; font-size: 10px; }
.av-32 { width: 32px; height: 32px; font-size: 11.5px; }
.av-56 { width: 56px; height: 56px; font-size: 18px; }
.av-name { font-size: 12px; color: var(--sb-text); font-weight: 500; }
.av-role { font-size: 10px; color: var(--sb-muted); }

/* ---------- Super-admin sidebar overrides ---------- */
.sidebar.sa { background: var(--sa-bg); }
.sidebar.sa .sb-logo { border-bottom-color: var(--sa-bd); }
.sidebar.sa .sb-mark { background: var(--sa-accent); font-family: var(--font); font-weight: 700; font-style: normal; }
.sidebar.sa .nav-cap { color: var(--sa-muted); }
.sidebar.sa .nav-item { color: var(--sa-text); }
.sidebar.sa .nav-item:hover { background: var(--sa-hv); color: #E6EDF3; }
.sidebar.sa .nav-item.active { background: var(--sa-hv); color: #fff; border-left-color: var(--sa-accent); }
.sidebar.sa .sb-footer { border-top-color: var(--sa-bd); }
.sidebar.sa .av { background: var(--sa-accent); }
.sidebar.sa .av-name { color: var(--sa-text); }
.sidebar.sa .av-role { color: var(--sa-muted); }
.sa-banner {
  background: var(--sa-accent); color: #fff; font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; text-align: center; padding: 4px 8px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.sa-banner svg { width: 12px; height: 12px; }

/* ---------- Main column ---------- */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 46px; flex-shrink: 0; background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 30px;
}
.bc { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.bc b { color: var(--text-1); font-weight: 500; }
.bc-sep { color: var(--border-hv); }
.tb-right { display: flex; align-items: center; gap: 10px; }

/* Company switcher */
.company-switch {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-1);
  background: var(--bg); border: 1px solid var(--border); padding: 4px 10px;
  border-radius: var(--r-btn); cursor: pointer; font-family: inherit; font-weight: 500;
}
.company-switch:hover { border-color: var(--border-hv); }
.company-switch .cs-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.company-switch svg { width: 12px; height: 12px; color: var(--text-3); }
.company-switch.static { cursor: default; }
.company-switch.static svg { display: none; }

.content { flex: 1; overflow-y: auto; padding: 30px 32px; }
.content-narrow { max-width: 760px; }

/* ---------- Page header ---------- */
.ph { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 26px; }
.ph-title { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--text-1); letter-spacing: -0.02em; line-height: 1.2; }
.ph-sub { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 3px; white-space: nowrap; }
.chip-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.chip-ok    { background: var(--ok-lt);   color: var(--ok); }
.chip-ok .chip-dot { background: var(--ok); }
.chip-warn  { background: var(--warn-lt); color: var(--warn); }
.chip-warn .chip-dot { background: var(--warn); }
.chip-err   { background: var(--err-lt);  color: var(--err); }
.chip-err .chip-dot { background: var(--err); }
.chip-edit  { background: var(--accent-lt); color: var(--accent); border: 1px solid var(--accent-bd); }
.chip-neutral { background: #F1EFEC; color: var(--text-2); }

/* ---------- Section cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); margin-bottom: 14px; }
.card.editing { border-color: var(--accent-edbd); }
.card-hd {
  padding: 10px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2); border-radius: var(--r-card) var(--r-card) 0 0;
}
.card.editing .card-hd { background: var(--accent-ed); border-bottom-color: var(--accent-edbd); }
.card-cap { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-3); }
.card.editing .card-cap { color: var(--accent); }
.card-bd { padding: 18px; }
.card-bd.flush { padding: 0 18px; }

/* ---------- Read-mode fields ---------- */
.fgrid { display: grid; grid-template-columns: 1fr 1fr; }
.fro { padding: 10px 0; border-bottom: 1px solid var(--border); }
.fro:nth-child(odd) { padding-right: 28px; }
.fro:nth-last-child(-n+2) { border-bottom: none; }
.fro.full { grid-column: 1 / -1; padding-right: 0; }
.fro-lbl { font-size: 11px; font-weight: 500; color: var(--text-3); margin-bottom: 3px; }
.fro-val { font-size: 13.5px; color: var(--text-1); font-weight: 500; }
.fro-val.muted { color: var(--text-3); font-weight: 400; }
.fro-hint { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }

/* ---------- Edit-mode fields ---------- */
.fform { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fg { display: flex; flex-direction: column; gap: 4px; }
.fg.full { grid-column: 1 / -1; }
.flbl { font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.flbl .req { color: var(--brand); margin-left: 2px; }
.finp, .fsel {
  padding: 7px 10px; border: 1px solid var(--border-hv); border-radius: var(--r-btn);
  font-size: 13px; color: var(--text-1); font-family: inherit; background: var(--surface);
  outline: none; width: 100%;
}
.finp:focus, .fsel:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-lt); }
.finp:disabled { background: var(--bg); color: var(--text-3); cursor: not-allowed; }
.fhelp { font-size: 10.5px; color: var(--text-3); }

/* ---------- Buttons ---------- */
.btn {
  padding: 7px 15px; font-size: 12.5px; font-weight: 500; border-radius: var(--r-btn);
  border: 1px solid transparent; cursor: pointer; font-family: inherit; line-height: 1;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn svg { width: 13px; height: 13px; }
.btn-p { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-p:hover { background: var(--accent-hv); }
.btn-s { background: var(--surface); color: var(--text-2); border-color: var(--border-hv); }
.btn-s:hover { background: var(--bg); }
.btn-g { background: transparent; color: var(--text-2); padding-left: 8px; padding-right: 8px; }
.btn-g:hover { background: var(--bg); border-color: var(--border); color: var(--text-1); }
.btn-d { background: var(--surface); color: var(--err); border-color: var(--err-bd); }
.btn-d:hover { background: var(--err-lt); }
.btn-sm { padding: 5px 11px; font-size: 11.5px; }
.btn-sm svg { width: 12px; height: 12px; }

.btn-row { display: flex; align-items: center; gap: 8px; padding-top: 18px; border-top: 1px solid var(--border); margin-top: 18px; }

/* ---------- Avatar editor (profile) ---------- */
.avatar-edit { display: flex; align-items: center; gap: 18px; }
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 26px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar-actions { display: flex; flex-direction: column; gap: 6px; }
.avatar-hint { font-size: 11px; color: var(--text-3); }

/* ---------- Toggle ---------- */
.toggle { position: relative; width: 34px; height: 20px; border-radius: 12px; background: var(--border-hv); cursor: pointer; flex-shrink: 0; transition: background 0.15s; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.toggle.on { background: var(--accent); }
.toggle.on::after { left: 16px; }

/* ---------- Generic rows (sessions, notif toggles) ---------- */
.list-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row-l { display: flex; align-items: center; gap: 12px; }
.list-row-title { font-size: 13px; font-weight: 500; color: var(--text-1); }
.list-row-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.list-row-r { display: flex; align-items: center; gap: 10px; }

/* ---------- Theme tag (mockup marker) ---------- */
.theme-tag { position: fixed; bottom: 12px; right: 16px; font-size: 10px; color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
