/* ============================================================
   EHOST — Shared Panel Layout (Sidebar + Topbar)
   ============================================================ */

/* ─── APP SHELL ───────────────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width var(--transition-slow);
  position: relative;
  z-index: 50;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

/* Sidebar — Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-5);
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-logo-mark {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 900; color: #fff;
  flex-shrink: 0;
  box-shadow: var(--brand-glow-sm);
}
.sidebar-logo-text {
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-logo-text .brand-name {
  font-size: 15px; font-weight: 800; color: var(--text-primary);
  white-space: nowrap;
}
.sidebar-logo-text .brand-sub {
  font-size: 10px; font-weight: 500; color: var(--brand-primary);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.sidebar.collapsed .sidebar-logo-text { display: none; }

/* Sidebar — Panel badge */
.sidebar-panel-badge {
  margin: var(--space-4) var(--space-3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  flex-shrink: 0;
}
.badge-admin { background: rgba(99,102,241,0.15); color: #818CF8; border: 1px solid rgba(99,102,241,0.2); }
.badge-client { background: rgba(16,185,129,0.12); color: #34D399; border: 1px solid rgba(16,185,129,0.2); }
.sidebar.collapsed .sidebar-panel-badge { padding: 6px; font-size: 9px; margin: var(--space-4) var(--space-2); }

/* Sidebar — Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: var(--space-2) 0; }
.sidebar-section { margin-bottom: var(--space-2); }
.sidebar-section-label {
  padding: var(--space-2) var(--space-5);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.sidebar.collapsed .sidebar-section-label { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-5);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0;
  font-size: var(--font-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}
.nav-item.active {
  background: rgba(74,125,255,0.10);
  color: var(--brand-primary);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-primary);
}
.nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.nav-text { white-space: nowrap; }
.sidebar.collapsed .nav-text { display: none; }
.sidebar.collapsed .nav-item { padding: 9px; justify-content: center; gap: 0; }
.sidebar.collapsed .nav-item::before { top: 8px; bottom: 8px; }
.nav-badge {
  margin-left: auto;
  background: rgba(239,68,68,0.2);
  color: var(--color-danger);
  font-size: 10px; font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}
.sidebar.collapsed .nav-badge { display: none; }

/* Sidebar — Footer */
.sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.sidebar-user-avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-full);
  background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; flex: 1; }
.sidebar-user-name { font-size: var(--font-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: var(--font-xs); color: var(--text-muted); }
.sidebar.collapsed .sidebar-user-info { display: none; }

/* Sidebar toggle */
.sidebar-toggle {
  position: absolute;
  right: -14px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}
.sidebar-toggle:hover { background: var(--bg-card-hover); color: var(--text-primary); }

/* ─── MAIN AREA ───────────────────────────────────────────── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-base);
}

/* ─── TOPBAR ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(13,15,20,0.8);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-6);
  flex-shrink: 0;
  position: relative;
  z-index: 40;
}
.topbar-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--font-sm); color: var(--text-secondary);
}
.topbar-breadcrumb .sep { color: var(--text-muted); }
.topbar-breadcrumb .current { color: var(--text-primary); font-weight: 600; }
.topbar-search {
  flex: 1; max-width: 400px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-sm);
  padding: 7px 12px 7px 36px;
  outline: none;
  transition: all var(--transition-fast);
}
.topbar-search input:focus {
  border-color: var(--border-focus);
  background: rgba(255,255,255,0.06);
}
.topbar-search .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px;
}
.topbar-actions {
  display: flex; align-items: center; gap: var(--space-2);
  margin-left: auto;
}
.topbar-icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}
.topbar-icon-btn:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); border-color: var(--border-default); }
.topbar-icon-btn .notif-dot {
  position: absolute; top: 4px; right: 4px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-danger);
  border: 1px solid var(--bg-surface);
}

/* ─── PAGE CONTENT ────────────────────────────────────────── */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-8);
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
}
.page-header-left { flex: 1; }
.page-title {
  font-size: var(--font-2xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.2;
}
.page-subtitle { font-size: var(--font-sm); color: var(--text-secondary); }
.page-actions { display: flex; align-items: center; gap: var(--space-3); }

/* ─── SECTION DIVIDER ─────────────────────────────────────── */
.section-title {
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-4);
}

/* ─── RESOURCE USAGE BAR ─────────────────────────────────── */
.resource-item { margin-bottom: var(--space-4); }
.resource-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-2);
}
.resource-label { font-size: var(--font-sm); font-weight: 500; color: var(--text-secondary); }
.resource-value { font-size: var(--font-sm); font-weight: 600; color: var(--text-primary); }

/* ─── QUICK ACTIONS ───────────────────────────────────────── */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-3);
}
.quick-action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none; color: var(--text-secondary);
  font-size: var(--font-xs); font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
}
.quick-action-btn .qa-icon {
  font-size: 24px;
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-1);
  transition: all var(--transition-base);
}
.quick-action-btn:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--brand-glow-sm);
}
.quick-action-btn:hover .qa-icon { transform: scale(1.1); }

/* ─── ACTIVITY FEED ───────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.activity-body { flex: 1; }
.activity-text { font-size: var(--font-sm); color: var(--text-primary); margin-bottom: 2px; }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: var(--font-xs); color: var(--text-muted); }

/* ─── BREADCRUMB PAGE ─────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--font-sm); margin-bottom: var(--space-6);
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand-primary); }
.breadcrumb .sep { color: var(--text-muted); }
.breadcrumb .current { color: var(--text-secondary); }

/* ─── TABS ────────────────────────────────────────────────── */
.tabs {
  display: flex; border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-6);
}
.tab-item {
  padding: 10px 16px;
  font-size: var(--font-sm); font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
  background: none; border-top: none; border-left: none; border-right: none;
}
.tab-item:hover { color: var(--text-secondary); }
.tab-item.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  font-weight: 600;
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }

/* ─── FILTER BAR ──────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.filter-bar .form-control { width: auto; min-width: 160px; }

/* ─── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
}
.empty-state-icon { font-size: 48px; margin-bottom: var(--space-4); opacity: 0.3; }
.empty-state-title { font-size: var(--font-lg); font-weight: 700; margin-bottom: var(--space-2); }
.empty-state-text { color: var(--text-secondary); font-size: var(--font-sm); margin-bottom: var(--space-6); }

/* ─── TOGGLE SWITCH ───────────────────────────────────────── */
.toggle-switch { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  width: 40px; height: 22px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--transition-fast);
  border: 1px solid var(--border-default);
}
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all var(--transition-fast);
}
.toggle-switch input:checked ~ .toggle-track { background: rgba(74,125,255,0.3); border-color: var(--brand-primary); }
.toggle-switch input:checked ~ .toggle-track .toggle-thumb { left: 21px; background: var(--brand-primary); }
.toggle-label { font-size: var(--font-sm); color: var(--text-secondary); }

/* ─── PAGINATION ─────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: var(--space-1);
  margin-top: var(--space-6);
}
.page-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: var(--font-sm); font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
}
.page-btn:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.page-btn.active { background: var(--brand-gradient); color: #fff; border-color: transparent; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
