/* ============================================
   BizCore - Business Management Platform
   Navbar & Layout Styles
   ============================================ */

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

/* ---- CSS Variables ---- */
:root {
  --sidebar-width: 270px;
  --sidebar-collapsed: 72px;
  --topbar-height: 68px;

  --bg-dark: #0d0f14;
  --bg-sidebar: #111318;
  --bg-card: #1a1d24;
  --bg-hover: #1e2130;
  --bg-active: rgba(99, 102, 241, 0.12);

  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-2: #22d3ee;

  --text-primary: #f0f2f8;
  --text-secondary: #8b8fa8;
  --text-muted: #50546a;

  --border: rgba(255, 255, 255, 0.06);
  --border-active: rgba(99, 102, 241, 0.4);

  --success: #10b981;
  --danger: #f43f5e;
  --warning: #f59e0b;
  --info: #3b82f6;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input { font-family: inherit; }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width var(--transition);
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

/* ---- Brand ---- */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
  min-height: 76px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.brand-text {
  overflow: hidden;
  transition: opacity var(--transition), width var(--transition);
  white-space: nowrap;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.brand-tagline {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-toggle {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition);
}

.sidebar-toggle:hover {
  background: var(--accent);
  color: #fff;
}

.sidebar.collapsed .sidebar-toggle {
  transform: rotate(180deg);
}

/* Collapsed brand text */
.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-toggle {
  opacity: 0;
  width: 0;
  pointer-events: none;
}

/* ---- Search ---- */
.sidebar-search {
  margin: 14px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  overflow: hidden;
}

.sidebar-search:focus-within {
  border-color: var(--accent);
  background: var(--bg-active);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

.sidebar-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.sidebar-search input::placeholder { color: var(--text-muted); }

.search-shortcut {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-dark);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-search input,
.sidebar.collapsed .search-shortcut {
  opacity: 0;
  width: 0;
  padding: 0;
}

/* ---- Navigation ---- */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 99px; }

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 10px 20px 6px;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.sidebar.collapsed .nav-section-title { opacity: 0; }

.nav-list { padding: 0 10px; }

.nav-item { position: relative; }

/* ---- Nav Link ---- */
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
  cursor: pointer;
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active > .nav-link {
  background: var(--bg-active);
  color: var(--accent-light);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 15px;
  flex-shrink: 0;
  position: relative;
  background: transparent;
  transition: background var(--transition-fast);
}

.nav-item.active > .nav-link .nav-icon {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-light);
}

.nav-link:hover .nav-icon { background: var(--bg-dark); }

.active-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-sidebar);
  opacity: 0;
  transition: opacity var(--transition);
}

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

.nav-label {
  flex: 1;
  transition: opacity var(--transition), width var(--transition);
  overflow: hidden;
}

.sidebar.collapsed .nav-label { opacity: 0; width: 0; }

/* ---- Badges ---- */
.nav-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  transition: opacity var(--transition);
}

.sidebar.collapsed .nav-badge { opacity: 0; }

.badge-new {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pro {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
}

/* ---- Arrow ---- */
.nav-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition), opacity var(--transition);
  flex-shrink: 0;
}

.sidebar.collapsed .nav-arrow { opacity: 0; }

.nav-item.open > .nav-link .nav-arrow { transform: rotate(90deg); }

/* ---- Submenu ---- */
.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0 0 0 16px;
  padding-left: 28px;
  border-left: 2px solid var(--border);
  margin-left: 30px;
}

.nav-item.open > .submenu { max-height: 300px; }

.submenu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  margin: 2px 0;
  transition: all var(--transition-fast);
}

.submenu li a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  padding-left: 16px;
}

.submenu li a i {
  font-size: 12px;
  width: 16px;
  text-align: center;
  color: var(--accent-light);
}

/* Collapsed: hide submenu */
.sidebar.collapsed .submenu { display: none; }

/* ---- Tooltip (collapsed mode) ---- */
.nav-link::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(var(--sidebar-collapsed) + 8px);
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: var(--shadow-md);
  z-index: 999;
}

.sidebar.collapsed .nav-link:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ---- Sidebar Footer ---- */
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-sidebar);
  position: relative;
  overflow: hidden;
}

.user-avatar-ring {
  position: relative;
  flex-shrink: 0;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.user-avatar.small {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.status-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
}

.status-dot.online { background: var(--success); }

.user-info {
  flex: 1;
  overflow: hidden;
  transition: opacity var(--transition), width var(--transition);
  white-space: nowrap;
}

.sidebar.collapsed .user-info {
  opacity: 0;
  width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.logout-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.logout-btn:hover {
  background: rgba(244, 63, 94, 0.12);
  color: var(--danger);
}

.sidebar.collapsed .logout-btn {
  opacity: 0;
  pointer-events: none;
}

/* ============================================
   MOBILE TOP BAR
   ============================================ */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 200;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.mobile-brand i {
  color: var(--accent);
  font-size: 18px;
}

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

/* ---- Overlay ---- */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left var(--transition);
  display: flex;
  flex-direction: column;
}

.main-content.shifted {
  margin-left: var(--sidebar-collapsed);
}

/* ---- Topbar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: var(--topbar-height);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb-root { font-size: 12px; }
.breadcrumb-sep { color: var(--text-muted); }
.breadcrumb-current { color: var(--text-primary); font-weight: 600; }

/* Topbar Search */
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  transition: border-color var(--transition-fast);
}

.topbar-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.topbar-search i { color: var(--text-muted); font-size: 13px; }

.topbar-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 200px;
}

.topbar-search input::placeholder { color: var(--text-muted); }

/* Icon Buttons */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 15px;
  position: relative;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.notif-count {
  position: absolute;
  top: 4px; right: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-sidebar);
}

/* Topbar Avatar */
.topbar-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  color: var(--text-secondary);
  font-size: 12px;
}

.topbar-avatar:hover { background: var(--bg-hover); }

.topbar-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.t-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.t-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- Page Content ---- */
.page-content {
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Welcome Card */
.welcome-card {
  background: linear-gradient(135deg, #1e2130 0%, #1a1d2e 50%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.welcome-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: var(--accent-glow);
  filter: blur(60px);
  pointer-events: none;
}

.welcome-text h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.welcome-text p {
  font-size: 13px;
  color: var(--text-secondary);
}

.welcome-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-hover);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: default;
}

.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.icon-blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.icon-green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.icon-red { background: rgba(244, 63, 94, 0.15); color: #f43f5e; }
.icon-purple { background: rgba(99, 102, 241, 0.15); color: var(--accent-light); }

.stat-info { flex: 1; }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.stat-change {
  font-size: 11.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-change.neutral { color: var(--text-muted); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .mobile-topbar { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    top: 0;
    z-index: 150;
    transition: transform 0.3s ease, width var(--transition);
  }

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

  .main-content {
    margin-left: 0;
    padding-top: 60px;
  }

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

  .topbar { display: none; }

  .page-content { padding: 16px; }

  .topbar-search { display: none; }

  .welcome-card { flex-direction: column; gap: 16px; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
}

.stat-card { animation: fadeInUp 0.4s ease both; }
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }
.stat-card:nth-child(6) { animation-delay: 0.3s; }
.stat-card:nth-child(7) { animation-delay: 0.35s; }
.stat-card:nth-child(8) { animation-delay: 0.4s; }

.welcome-card { animation: fadeInUp 0.35s ease both; }

.brand-logo { animation: pulse 3s infinite; }

/* ============================================
   VIEW SECTIONS (SPA ROUTING)
   ============================================ */
.view-section {
  display: none;
  animation: fadeInUp 0.3s ease both;
}

.view-section.active {
  display: block;
}

/* ============================================
   SHARED COMPONENTS
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-header.center {
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 6px;
  margin-bottom: 20px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Base Buttons */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--text-secondary);
  background: var(--bg-hover);
}

.w-100 { width: 100%; justify-content: center; }

.btn-icon-circular {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.btn-icon-circular:hover {
  background: var(--bg-card);
  transform: translateY(-1px);
}

/* Colors */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.bg-primary { background: var(--accent); border-color: var(--accent); }
.text-white { color: #fff; }

/* Forms */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ============================================
   VIEW: ACCOUNTS & BANKING
   ============================================ */
.banking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.banking-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.banking-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.banking-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; width: 120px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.02));
  transform: skewX(-15deg) translateX(20px);
}

.bank-primary {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.bank-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.bank-logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
}

.bank-status {
  font-size: 10px;
  background: var(--accent-glow);
  color: var(--accent-light);
  padding: 4px 8px;
  border-radius: 99px;
  font-weight: 600;
  text-transform: uppercase;
}

.bank-mid .b-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.bank-mid .b-amount {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 24px;
}

.bank-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.b-acct {
  font-family: monospace;
  font-size: 14px;
  color: var(--text-muted);
}

.bank-actions {
  display: flex;
  gap: 8px;
}

/* ============================================
   VIEW: TRANSACTIONS & DATA TABLES
   ============================================ */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
}

.search-box i { color: var(--text-muted); font-size: 13px; }
.search-box input {
  background: none; border: none; color: var(--text-primary);
  outline: none; font-size: 13px; width: 180px;
}

.data-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th, .data-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  background: rgba(0,0,0,0.2);
}

.data-table tr:hover td { background: var(--bg-hover); }

.tag {
  font-size: 11px; font-weight: 600;
  padding: 4px 8px; border-radius: 4px;
}
.tag-expense { background: rgba(244, 63, 94, 0.15); color: var(--danger); }
.tag-income { background: rgba(16, 185, 129, 0.15); color: var(--success); }

.status-badge {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 99px;
}
.status-badge.success { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.status-badge.pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }

/* ============================================
   VIEW: INVOICE / ADD ITEM
   ============================================ */
.invoice-items-builder {
  margin-top: 30px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.builder-title {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.item-entry-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 24px;
}

.item-name { flex: 2; }
.item-qty, .item-price { flex: 1; }
.btn-add-item { margin-bottom: 2px; }

.added-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.added-item {
  display: flex;
  align-items: center;
  background: var(--bg-hover);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.added-item .i-name { flex: 2; font-weight: 500; }
.added-item .i-qty { flex: 1; color: var(--text-secondary); text-align: center;}
.added-item .i-price { flex: 1; color: var(--text-secondary); text-align: right;}
.added-item .i-total { flex: 1; font-weight: 700; text-align: right; margin-right: 16px;}

.invoice-totals {
  width: 300px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--bg-hover);
}

.tot-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.grand-total {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ============================================
   VIEW: SUBSCRIPTION
   ============================================ */
.plan-toggle {
  display: inline-flex;
  background: var(--bg-hover);
  border-radius: 99px;
  padding: 4px;
  border: 1px solid var(--border);
  margin-bottom: 40px;
}

.t-btn {
  padding: 8px 24px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  position: relative;
}

.t-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.badge-save {
  position: absolute;
  top: -10px; right: -10px;
  background: var(--success);
  color: #fff;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  position: relative;
  transition: transform var(--transition);
}

.price-card:hover { border-color: var(--text-secondary); }

.price-card.popular {
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
  transform: scale(1.02);
}

.popular-badge {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 99px;
  text-transform: uppercase;
}

.p-header h3 {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.p-price {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 24px;
}

.p-price span {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.p-features {
  margin-bottom: 32px;
}

.p-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.p-features li.unavailable {
  color: var(--text-muted);
  text-decoration: line-through;
}
.p-features li.unavailable i { color: var(--text-muted); }

/* ============================================
   VIEW: BUSINESS PROFILE
   ============================================ */
.profile-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.profile-sidebar {
  width: 200px;
  flex-shrink: 0;
}

.profile-logo-upload {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.p-logo-preview {
  width: 100%;
  aspect-ratio: 1;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--text-muted);
}

.profile-form-area {
  flex: 1;
}

.mb-4 { margin-bottom: 20px; }

/* Responsive Adjustments for new views */
@media (max-width: 768px) {
  .profile-layout { flex-direction: column; }
  .profile-sidebar { width: 100%; }
  .item-entry-row { flex-wrap: wrap; }
  .item-name { flex-basis: 100%; }
  .invoice-totals { width: 100%; }
  .form-row-2 { grid-template-columns: 1fr; }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.biz-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.biz-toast.active {
  transform: translateY(0);
  opacity: 1;
}

.biz-toast.success { border-left: 4px solid var(--success); }
.biz-toast.error { border-left: 4px solid var(--danger); }
.biz-toast.warning { border-left: 4px solid var(--warning); }

/* ============================================
   AUTHENTICATION & LOGIN STYLES
   ============================================ */
body.is-guest .sidebar,
body.is-guest .mobile-topbar,
body.is-guest .topbar,
body.is-guest .view-section:not(#view-login) {
  display: none !important;
}

body.is-guest .main-content {
  margin-left: 0 !important;
}

body.is-authenticated #view-login {
  display: none !important;
}

/* Hide admin section for non-admins */
body:not(.is-admin) .admin-only {
  display: none !important;
}

/* ---- Login Wrapper ---- */
#view-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #1e1b4b 0%, var(--bg-dark) 50%, #0f172a 100%);
  padding: 20px;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
  animation: fadeIn 0.6s ease;
}

.login-card {
  background: rgba(26, 29, 36, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  font-size: 32px;
  color: var(--accent);
  margin-bottom: 16px;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.login-header h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #fff;
}

.login-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.input-with-icon input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 12px 12px 42px;
  color: #fff;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.input-with-icon input:focus {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 0 4px var(--accent-glow);
  outline: none;
}

.login-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-secondary);
}

.forgot-pass {
  color: var(--accent-light);
  font-weight: 500;
}

.btn-login {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-loader {
  display: none;
}

.btn-login.loading .btn-text { display: none; }
.btn-login.loading .btn-loader { display: block; }

.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.login-footer a {
  color: var(--accent-light);
  font-weight: 600;
}

.login-hint {
  margin-top: 32px;
  padding: 16px;
  background: rgba(99, 102, 241, 0.05);
  border: 1px dashed var(--accent-glow);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

.login-hint p { margin-bottom: 4px; }

/* ============================================
   ADMIN PANEL STYLES
   ============================================ */
.u-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.u-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
}

.u-mail {
  font-size: 11px;
  color: var(--text-muted);
}

.mt-5 { margin-top: 40px; }

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}
.btn-success:hover {
  background: #059669; /* slightly darker green */
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.4);
}
.btn-danger:hover {
  background: #e11d48; /* slightly darker red */
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.6);
  transform: translateY(-1px);
}
