/* =====================
   APP LAYOUT
===================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* =====================
   SIDEBAR
===================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  background: var(--orange);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.5px;
}

/* Mode switcher (tenant / host) */
.mode-switcher {
  margin: 10px 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 4px;
  display: flex;
  gap: 3px;
}

.mode-btn {
  flex: 1;
  padding: 7px 6px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.45);
  transition: all 0.15s;
  text-align: center;
}

.mode-btn.active {
  background: var(--orange);
  color: white;
}

/* Host badge */
.host-badge {
  margin: 2px 12px 10px;
  background: linear-gradient(135deg, rgba(242,101,34,0.2), rgba(46,196,182,0.1));
  border: 1px solid rgba(242,101,34,0.3);
  border-radius: 10px;
  padding: 10px 12px;
}

.host-badge-name {
  font-size: 13px;
  font-weight: 700;
  color: white;
}

.host-badge-plan {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  background: rgba(255,255,255,0.1);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
}

/* Nav */
.sidebar-nav {
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
}

.nav-section { padding: 0 10px; margin-bottom: 2px; }

.nav-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--gray-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 10px 4px;
  display: block;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 9px;
  color: rgba(255,255,255,0.55);
  transition: all 0.15s;
  font-size: 13px;
  margin-bottom: 1px;
  border: none;
  background: none;
  width: 100%;
  text-align: right;
}

.nav-item:hover  { background: rgba(255,255,255,0.06); color: white; }
.nav-item.active { background: rgba(242,101,34,0.18);  color: var(--orange); }

.nav-icon { width: 16px; height: 16px; flex-shrink: 0; }

.nav-badge {
  margin-right: auto;
  background: var(--orange);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
}

.nav-badge-green {
  margin-right: auto;
  background: var(--green);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
}

/* User row */
.sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 12px;
  flex-shrink: 0;
}

.user-name { font-size: 12px; font-weight: 600; color: white; }
.user-type { font-size: 10px; color: var(--gray-3); }

.logout-btn {
  margin-right: auto;
  background: none;
  border: none;
  color: var(--gray-3);
  font-size: 16px;
  transition: color 0.15s;
}
.logout-btn:hover { color: var(--red); }

/* =====================
   MAIN AREA
===================== */
.main {
  margin-right: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =====================
   TOPBAR
===================== */
.topbar {
  background: white;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-2);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-info {}
.topbar-title { font-size: 16px; font-weight: 700; }
.topbar-sub   { font-size: 11px; color: var(--gray-3); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.notif-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--gray-2);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  position: relative;
}

.notif-dot {
  position: absolute;
  top: 6px; left: 6px;
  width: 7px; height: 7px;
  background: var(--orange);
  border-radius: 50%;
  border: 2px solid white;
}

/* =====================
   CONTENT
===================== */
.content { padding: 20px 24px; flex: 1; }

/* =====================
   GRIDS
===================== */
.grid-2   { display: grid; grid-template-columns: 1fr 1fr;   gap: 16px; margin-bottom: 16px; }
.grid-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3-1 { display: grid; grid-template-columns: 2fr 1fr;   gap: 16px; margin-bottom: 16px; }

.kpi-grid { display: grid; gap: 14px; margin-bottom: 20px; }
.kpi-4    { grid-template-columns: repeat(4, 1fr); }
.kpi-3    { grid-template-columns: repeat(3, 1fr); }
