/* Life OS Left Sidebar & Navigation Styles */
/* =========================================================================
   0. LEFT COLUMN: NAVIGATION SIDEBAR & TABS
   ========================================================================= */
.left-sidebar {
  width: 158px;
  min-width: 158px;
  max-width: 158px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 18px rgba(80, 70, 50, 0.05);
  padding: 10px 5px;
  height: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  user-select: none;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20;
}

.left-sidebar.collapsed {
  width: 58px !important;
  min-width: 58px !important;
  max-width: 58px !important;
  padding: 8px 4px !important;
  align-items: center !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

.left-sidebar.collapsed .sidebar-header {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 0 0 6px 0 !important;
  width: 100% !important;
}

.left-sidebar.collapsed .sidebar-header-actions {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
}

.left-sidebar.collapsed #btn-brand-fullscreen,
.left-sidebar.collapsed .btn-fullscreen-toggle {
  display: none !important;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1px 6px 1px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 5px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.sidebar-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(47, 158, 119, 0.22);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: visible;
  justify-content: center;
  gap: 2px;
}

.sidebar-title-row {
  display: inline-flex;
  align-items: center;
  line-height: 1.1;
}

.sidebar-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

/* Sidebar Top-Left Permanent Battery Indicator (Option A) */
.sidebar-battery-wrap {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  border-radius: 3px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  width: fit-content;
  line-height: 1;
}

.sidebar-battery-wrap:hover {
  background: var(--bg-card-hover, rgba(0, 0, 0, 0.05));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.sidebar-battery-wrap:active {
  transform: scale(0.96);
}

.sidebar-battery-wrap .battery-5seg-wrap {
  display: inline-flex;
  align-items: center;
}

.sidebar-battery-wrap .battery-5seg-frame {
  width: 30px;
  height: 11px;
  padding: 1px;
  gap: 1px;
  border-radius: 2.5px;
}

.sidebar-battery-wrap .battery-5seg-terminal {
  width: 2px;
  height: 5.5px;
  margin-left: -0.5px;
}

.sidebar-battery-wrap .battery-5seg-label {
  display: none !important;
}

/* Collapsed mode battery indicator (centered beneath icon) */
.sidebar-battery-collapsed {
  display: none !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 2px 3px;
  border-radius: 4px;
  transition: transform 0.15s ease, background 0.15s ease;
  user-select: none;
}

.sidebar-battery-collapsed .battery-5seg-frame {
  width: 35px;
  height: 12px;
  padding: 1px;
  gap: 1px;
  border-radius: 3px;
}

.sidebar-battery-collapsed .battery-5seg-terminal {
  width: 2px;
  height: 5.5px;
  margin-left: -0.5px;
}

.sidebar-battery-collapsed .battery-5seg-label {
  display: none !important;
}

.sidebar-battery-collapsed:hover {
  background: var(--bg-card-hover, rgba(0, 0, 0, 0.06));
  transform: scale(1.08);
}

.sidebar-battery-collapsed:active {
  transform: scale(0.95);
}

.left-sidebar.collapsed .sidebar-battery-collapsed {
  display: inline-flex !important;
  margin: 4px 0 2px 0;
}

.left-sidebar.collapsed .sidebar-battery-wrap {
  display: none !important;
}

.left-sidebar.collapsed .sidebar-brand-icon-box,
.left-sidebar.collapsed .sidebar-brand-icon {
  width: 38px;
  height: 38px;
}

.btn-brand-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  background: var(--bg-card-elevated);
  border: 1.5px solid var(--border-medium);
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-brand-icon:hover,
.btn-brand-icon:active {
  color: var(--accent-emerald);
  background: var(--bg-card-hover);
  border-color: var(--accent-emerald);
  transform: scale(1.05);
}

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.sidebar-brand-icon-box {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-brand-icon-box .sidebar-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(47, 158, 119, 0.22);
}

.sidebar-brand-icon-box .backup-status-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg-card);
  box-shadow: 0 0 0 1.5px var(--bg-card), 0 2px 4px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  border: none;
  z-index: 5;
  transition: transform 0.15s ease;
}

.sidebar-brand-icon-box .backup-status-btn:hover {
  transform: scale(1.3);
}

.sidebar-brand-icon-box .backup-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  transition: background 0.2s, box-shadow 0.2s;
}

.backup-status-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease;
}

.backup-status-btn:hover {
  transform: scale(1.25);
}

.backup-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  transition: background 0.2s, box-shadow 0.2s;
}

.backup-status-dot.status-green {
  background: #10b981;
  box-shadow: 0 0 7px rgba(16, 185, 129, 0.85);
}

.backup-status-dot.status-yellow {
  background: #f59e0b;
  box-shadow: 0 0 7px rgba(245, 158, 11, 0.9);
  animation: pulse-backup-yellow 1.4s infinite ease-in-out;
}

.backup-status-dot.status-red {
  background: #ef4444;
  box-shadow: 0 0 9px rgba(239, 68, 68, 0.95);
  animation: pulse-backup-red 1s infinite alternate;
}

.backup-status-dot.status-blue {
  background: #3b82f6;
  box-shadow: 0 0 7px rgba(59, 130, 246, 0.85);
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}
.badge-pill.pill-success {
  background: #dcfce7;
  color: #15803d;
}
.badge-pill.pill-warning {
  background: #fef3c7;
  color: #b45309;
}
.badge-pill.pill-muted {
  background: #f1f5f9;
  color: #64748b;
}

@keyframes pulse-backup-yellow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

@keyframes pulse-backup-red {
  0% { transform: scale(1); }
  100% { transform: scale(1.2); }
}

.sidebar-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.btn-sidebar-collapse {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.btn-sidebar-collapse:hover {
  background: var(--bg-card-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-sidebar-collapse svg {
  display: block;
  pointer-events: none;
}

/* Expanded state button sizing - optical center alignment with Life OS brand */
.left-sidebar:not(.collapsed) .btn-sidebar-collapse {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.left-sidebar:not(.collapsed) .btn-sidebar-collapse svg {
  width: 15px;
  height: 15px;
}

/* Scrollable Sidebar Body */
.sidebar-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 0;
  scrollbar-width: thin;
}

.sidebar-body::-webkit-scrollbar {
  width: 4px;
}

.sidebar-body::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

/* Sidebar Navigation Tabs */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

