/* MTech-Elbert Admin Console — shared styles */

:root {
  /* Type */
  --font-sans: "Geist", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Warm neutrals */
  --bg:          oklch(98.5% 0.004 80);
  --bg-elev:     #ffffff;
  --bg-sunken:   oklch(96.5% 0.005 80);
  --line:        oklch(91% 0.005 80);
  --line-soft:   oklch(94% 0.004 80);

  /* Ink */
  --ink:         oklch(22% 0.01 80);
  --ink-2:       oklch(40% 0.008 80);
  --ink-3:       oklch(56% 0.006 80);
  --ink-4:       oklch(68% 0.005 80);

  /* Accent — muted slate blue */
  --accent:      oklch(48% 0.08 245);
  --accent-soft: oklch(95% 0.02 245);
  --accent-ink:  oklch(35% 0.09 245);

  /* Status tones */
  --amber:       oklch(68% 0.13 70);
  --amber-soft:  oklch(96% 0.04 80);
  --green:       oklch(58% 0.11 150);
  --green-soft:  oklch(96% 0.03 150);
  --violet:      oklch(58% 0.10 280);
  --violet-soft: oklch(96% 0.03 280);
  --gray:        oklch(60% 0.005 80);
  --gray-soft:   oklch(95% 0.004 80);
  --red:         oklch(56% 0.17 22);
  --red-soft:    oklch(97% 0.03 22);

  /* Card */
  --card-bg:     #ffffff;
  --card-border: var(--line);
  --card-shadow: 0 1px 0 oklch(91% 0.005 80 / 0.6), 0 1px 2px oklch(20% 0.01 80 / 0.04);

  --radius:    10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

/* ====================== Layout ====================== */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

/* ====================== Sidebar ====================== */
.sidebar {
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  padding: 22px 16px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px 22px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 14px;
}
.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
}
.brand-name {
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 14.5px;
}
.brand-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 1px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13.5px;
  position: relative;
  transition: background 120ms, color 120ms;
}
.nav-item:hover {
  background: var(--bg-sunken);
  color: var(--ink);
}
.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 500;
}
.nav-icon { display: inline-flex; opacity: 0.85; }
.nav-item.is-active .nav-icon { opacity: 1; }
.nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-badge {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(70% 0.07 60), oklch(55% 0.09 30));
  color: white;
  display: grid; place-items: center;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.user-name { font-size: 13px; font-weight: 500; }
.user-sub  { font-size: 11.5px; color: var(--ink-3); }
.signout-btn {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 6px 10px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: left;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.signout-btn:hover { background: var(--bg-sunken); color: var(--ink); }

/* ====================== Main ====================== */
.main {
  padding: 28px 40px 60px;
  max-width: 1400px;
  width: 100%;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.crumbs {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  text-transform: uppercase;
  font-weight: 500;
}
.page-title {
  font-size: 28px;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink);
  text-wrap: pretty;
}
.page-sub {
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
  max-width: 640px;
  text-wrap: pretty;
}
.page-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ====================== Buttons ====================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  transition: all 120ms;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.btn-primary:hover:not(:disabled) { background: oklch(13% 0.01 80); }
.btn-ghost {
  background: var(--bg-elev);
  border-color: var(--line);
  color: var(--ink-2);
}
.btn-ghost:hover { background: var(--bg-sunken); color: var(--ink); border-color: oklch(82% 0.006 80); }

/* ====================== Toast ====================== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: white;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 24px oklch(20% 0.01 80 / 0.18);
  animation: toastIn 180ms ease;
  z-index: 100;
}
.toast svg { color: oklch(70% 0.12 150); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ====================== Icon button ====================== */
.icon-btn {
  background: transparent;
  border: 0;
  width: 26px; height: 26px;
  border-radius: 5px;
  display: grid; place-items: center;
  color: var(--ink-3);
}
.icon-btn:hover { background: var(--bg-sunken); color: var(--ink); }

/* ====================== Mobile (≤768px) — issue #924 ====================== */
/* styles.css is linked ONLY by Ask Elbert. The shared off-canvas nav drawer +
   hamburger are injected by sidebar.babel.js; this rule just offsets Ask
   Elbert's chat header so the fixed hamburger doesn't overlap the brand. It is
   scoped to the OWNER layout (.ae-shell inside the .app grid, i.e. a sidebar is
   present) so the non-owner chat — which renders no sidebar/hamburger — is
   untouched. Higher specificity than Ask Elbert's own ≤700px .ae-header rule,
   so it wins regardless of source order. */
@media (max-width: 768px) {
  .app .ae-header { padding-left: 62px; }
}
