/* ============================================================
   SuiteManager — Main CSS (Landlord Shell)
   Aesthetic: Dark editorial / finance-grade precision
   Fonts: Figtree (body) + Sora (display) + IBM Plex Mono (mono)
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700;800&family=Sora:wght@300;400;600;700;800&family=IBM+Plex+Mono:wght@400;600&display=swap');

:root {
  /* Core palette */
  --ink:         #0d1117;
  --ink-soft:    #1c2333;
  --ink-muted:   #2d3748;
  --surface:     #ffffff;
  --surface-2:   #f7f8fa;
  --surface-3:   #eef0f4;
  --border:      #e4e7ec;
  --border-soft: #f0f2f5;

  /* Accent */
  --blue:        #2557d6;
  --blue-light:  #e8effe;
  --blue-dark:   #1a3fa3;

  /* Semantic */
  --green:       #0f7b4c;
  --green-light: #dcf5eb;
  --amber:       #92500a;
  --amber-light: #fef3dc;
  --red:         #c0170f;
  --red-light:   #fde8e7;

  /* Sidebar */
  --sidebar-bg:    #0d1117;
  --sidebar-w:     248px;
  --sidebar-item:  #8b95a1;
  --sidebar-hover: rgba(255,255,255,0.06);
  --sidebar-active-bg: rgba(37,87,214,0.18);
  --sidebar-active: #7aa7ff;

  /* Typography */
  --font-body:    'Figtree', sans-serif;
  --font-display: 'Sora', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(13,17,23,0.06);
  --shadow-sm:  0 2px 8px rgba(13,17,23,0.08);
  --shadow-md:  0 4px 16px rgba(13,17,23,0.10);
}

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

body {
  font-family: var(--font-body);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── App Shell ─────────────────────────────────────────────── */
.app-container {
  display: block;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  background: var(--sidebar-bg);
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.logo-section {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
}

.logo-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.logo-section h2 span {
  color: var(--blue);
}

.sidebar-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  padding: 16px 20px 6px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-item);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
  font-weight: 600;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.3);
  font-size: 0.8rem;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-footer a:hover {
  background: var(--sidebar-hover);
  color: rgba(255,255,255,0.65);
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Top Bar ───────────────────────────────────────────────── */
.top-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-breadcrumb {
  font-size: 0.8rem;
  color: #8b95a1;
}

.page-breadcrumb strong {
  color: var(--ink);
  font-weight: 600;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--ink);
  padding: 4px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── Content Body ──────────────────────────────────────────── */
.content-body {
  padding: 28px;
  flex: 1;
}

/* ── Stats Grid ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
  border-radius: 10px 10px 0 0;
}

.stat-card.stat-income::before  { background: var(--green); }
.stat-card.stat-danger::before  { background: var(--red); }
.stat-card.stat-primary::before { background: var(--blue); }
.stat-card.stat-amber::before   { background: #e8820c; }

.stat-card h3 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8b95a1;
  margin-bottom: 10px;
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
}

.stat-card .stat-sub {
  font-size: 0.75rem;
  color: #8b95a1;
  margin-top: 4px;
}

/* Colour helpers */
.text-success { color: var(--green); }
.text-danger  { color: var(--red); }
.text-primary { color: var(--blue); }
.text-amber   { color: var(--amber); }

/* ── Flash Banners ─────────────────────────────────────────── */
.flash-banner {
  padding: 11px 20px;
  border-radius: 8px;
  margin: 0 28px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flash-success {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid #9ae6c7;
}

.flash-error {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #f5b8b5;
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  .mobile-toggle { display: block; }

  .content-body { padding: 16px; }

  .top-bar { padding: 0 16px; }
}
