/**
 * Thirumurugan Metals ERP - Shell & Navigation Architecture
 */

#app-root {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-page);
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #070d1d 0%, #0b1329 100%);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 13, 29, 0.6);
  backdrop-filter: blur(8px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.brand-icon-wrapper {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #070d1d;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.brand-name {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.6px;
}

.brand-location {
  font-size: 9px;
  font-weight: 700;
  color: var(--gold-400);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #475569;
  padding: 12px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.04) 100%);
  color: var(--gold-400);
  font-weight: 700;
  border-left: 3px solid var(--gold-400);
}

.nav-item.active i, .nav-item.active svg {
  color: var(--gold-400);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 13, 29, 0.5);
}

.store-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  color: #34d399;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* COLLAPSED SIDEBAR */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}
.sidebar.collapsed .brand-text-block,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .store-status-pill span {
  display: none;
}
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

/* MAIN CONTENT WRAPPER */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar.collapsed ~ .main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
}

/* TOPBAR */
.topbar {
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.breadcrumbs strong {
  color: var(--text-primary);
  font-weight: 700;
}

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

.live-clock-badge {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background-color: #f1f5f9;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid var(--border-light);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-subtle);
  transition: all 0.15s ease;
}

.user-profile-badge:hover {
  border-color: var(--gold-400);
  background-color: #fefce8;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-400);
  font-weight: 800;
  font-size: 12px;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* MAIN BODY */
.content-body {
  flex: 1;
  padding: 24px;
}

#mobile-menu-btn {
  display: none;
}

@media (max-width: 840px) {
  #mobile-menu-btn {
    display: inline-flex;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0 !important;
  }
  .content-body {
    padding: 16px;
  }
}
