/* ============================================
   FITCALC HUB — Main CSS Design System
   Responsive: Mobile-first → Desktop Sidebar Layout
   ============================================ */

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

[hidden] {
  display: none !important;
}

[data-theme-icon],
.sidebar-theme-btn,
#theme-toggle-btn,
#toggle-theme-btn,
#theme-toggle {
  display: none !important;
}

/* ============ CSS CUSTOM PROPERTIES ============ */
:root {
  /* Dark Mode (FitnessPro Style) */
  --bg-primary: #111c22;
  --bg-secondary: #18232a;
  --bg-card: #1c2830;
  --bg-card-hover: #23313a;
  --bg-input: #111c22;
  --accent: #5aaee0; /* Keep the nice blue */
  --accent-light: #82c4e8;
  --accent-dark: #3a8dbd;
  --accent-subtle: rgba(90, 174, 224, 0.12);
  --text-primary: #FFFFFF;
  --text-secondary: #90a4ae;
  --text-muted: #546e7a;
  --border: rgba(255,255,255,0.06);
  --border-accent: rgba(90, 174, 224, 0.3);
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.25);
  --shadow-accent: 0 4px 16px rgba(90, 174, 224, 0.25);
  --success: #37A277;
  --warning: #FBBF24;
  --danger: #ED6A40;
  --info: #5aaee0;

  /* Calculator semantic tokens */
  --surface-panel: linear-gradient(180deg, rgba(28, 41, 52, 0.98), rgba(22, 33, 42, 0.98));
  --surface-panel-strong: linear-gradient(145deg, rgba(18, 28, 55, 0.98), rgba(30, 51, 83, 0.95));
  --surface-input-strong: rgba(16, 27, 39, 0.96);
  --surface-input: rgba(17, 28, 40, 0.95);
  --surface-list-item: rgba(18, 29, 41, 0.82);
  --surface-overlay-soft: rgba(255, 255, 255, 0.05);
  --surface-overlay-medium: rgba(255, 255, 255, 0.06);
  --surface-overlay-strong: rgba(255, 255, 255, 0.08);

  --text-strong: #f6fbff;
  --text-heading-soft: #eef8ff;
  --text-body: #c5d4e6;
  --text-body-soft: #a5b8cc;
  --text-muted-strong: #92a7bc;
  --text-muted: #546e7a;
  --text-subtle: #7f93a8;
  --text-on-accent: #07131d;

  --accent-primary: #63b7e8;
  --accent-primary-strong: #5a95d8;
  --accent-primary-soft: #69c2f0;
  --accent-secondary: #8b78ff;
  --accent-secondary-strong: #5d88ff;
  --accent-pink: #ff8cb7;
  --accent-pink-strong: #ff6f91;
  --accent-cyan: #71d0ff;
  --accent-cyan-strong: #4d9df0;
  --accent-violet: #7f9cff;
  --accent-violet-strong: #5877ff;
  --accent-mint: #5fe0d2;
  --accent-mint-strong: #7cd7ff;
  --accent-amber: #ffae62;
  --accent-amber-strong: #ffb45d;
  --accent-rose: #ff7f9f;
  --accent-rose-strong: #ff88a7;

  --border-soft: rgba(255, 255, 255, 0.05);
  --border-strong: rgba(255, 255, 255, 0.08);
  --border-accent-soft: rgba(92, 170, 226, 0.12);
  --border-accent-strong: rgba(97, 183, 233, 0.6);
  --border-danger-strong: rgba(236, 98, 98, 0.8);

  --shadow-panel: 0 24px 54px rgba(0, 0, 0, 0.22);
  --shadow-panel-strong: 0 28px 54px rgba(8, 18, 42, 0.35);
  --shadow-accent-lg: 0 18px 36px rgba(79, 148, 242, 0.22);

  /* Additional accent colors for diverse icons and tags */
  --color-orange: #d15814;
  --color-orange-subtle: rgba(237, 106, 64, 0.12);
  --color-purple: #815BEA;
  --color-purple-subtle: rgba(129, 91, 234, 0.12);
  --color-green: #37A277;
  --color-green-subtle: rgba(55, 162, 119, 0.12);
  --color-pink: #EC4899;
  --color-pink-subtle: rgba(236, 72, 153, 0.12);
  --color-yellow: #FBBF24;
  --color-yellow-subtle: rgba(251, 191, 36, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 18px;
  --radius-3xl: 22px;
  --radius-4xl: 28px;

  --space-2xs: 6px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-2xl: 28px;
  --space-3xl: 32px;

  --transition: 0.2s ease-out;
  --nav-height: 80px;
  --sidebar-width: 250px;
  --font-heading: 'Roboto', sans-serif;
  --font-body: 'Roboto', sans-serif;
}

[data-theme="light"] {
  --bg-primary: #F4F7F9; /* Softer light background */
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8F9FA;
  --bg-input: #F4F7F9;
  --accent: #5aaee0;
  --accent-light: #82c4e8;
  --accent-dark: #3a8dbd;
  --accent-subtle: rgba(90, 174, 224, 0.08);
  --text-primary: #1A1A1A;
  --text-secondary: #555555;
  --text-muted: #999999;
  --border: rgba(0,0,0,0.06);
  --border-accent: rgba(90, 174, 224, 0.25);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.04);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.06);
  --shadow-accent: 0 4px 20px rgba(90, 174, 224, 0.2);

  --surface-panel: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 249, 0.96));
  --surface-panel-strong: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(234, 242, 249, 0.95));
  --surface-input-strong: rgba(240, 245, 248, 0.96);
  --surface-input: rgba(244, 247, 249, 0.98);
  --surface-list-item: rgba(248, 250, 252, 0.95);
  --surface-overlay-soft: rgba(26, 26, 26, 0.03);
  --surface-overlay-medium: rgba(26, 26, 26, 0.05);
  --surface-overlay-strong: rgba(26, 26, 26, 0.08);

  --text-strong: #15222c;
  --text-heading-soft: #213342;
  --text-body: #425564;
  --text-body-soft: #5f7383;
  --text-subtle: #7b8d9c;
  --text-on-accent: #07131d;

  --border-soft: rgba(16, 24, 32, 0.08);
  --border-strong: rgba(16, 24, 32, 0.12);
  --border-accent-soft: rgba(90, 174, 224, 0.18);
  --border-accent-strong: rgba(90, 174, 224, 0.42);
  --border-danger-strong: rgba(236, 98, 98, 0.55);

  --shadow-panel: 0 18px 40px rgba(17, 28, 34, 0.08);
  --shadow-panel-strong: 0 22px 48px rgba(17, 28, 34, 0.12);
  --shadow-accent-lg: 0 18px 36px rgba(90, 174, 224, 0.16);

  --color-orange-subtle: rgba(255, 142, 79, 0.08);
  --color-purple-subtle: rgba(157, 125, 249, 0.08);
  --color-green-subtle: rgba(74, 222, 128, 0.08);
  --color-pink-subtle: rgba(236, 72, 153, 0.08);
  --color-yellow-subtle: rgba(251, 191, 36, 0.08);
}

/* ============ RESET & BASE ============ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Mobile: pad bottom for bottom-nav */
  padding-bottom: var(--nav-height);
}

/* Desktop: no bottom padding, use sidebar instead */
@media (min-width: 1180px) {
  body {
    padding-bottom: 0;
    display: flex;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: var(--font-body);
}

select, input {
  font-family: var(--font-body);
  outline: none;
}

/* ============ PAGE ANIMATION ============ */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Page enters: body ONLY fades opacity — no transform on body level.
   transform on body creates a stacking context that traps position:fixed children (sidebar).
   Children get the slide animation via :not() to exclude the injected sidebar. */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.page-enter {
  animation: fadeIn 0.3s ease-out both;
}

/* Slide inner content — exclude sidebar/overlay/bottom-nav so they never get transform */
.page-enter > *:not(#app-sidebar):not(.sidebar):not(.sidebar-overlay):not(.bottom-nav):not(.app-bottom-nav) {
  animation: fadeSlideIn 0.35s ease-out both;
}

/* Sidebar must never receive page-enter transform animation — it manages its own transform */
#app-sidebar,
.sidebar {
  animation: none !important;
}

/* ============ DESKTOP LAYOUT WRAPPER ============ */
/* Wraps sidebar + main content on desktop */
.app-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ============ MAIN CONTENT AREA ============ */
.main-content {
  flex: 1;
  min-width: 0;
  width: 100%;
}

@media (min-width: 1180px) {
  .main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: none;
    min-height: 100vh;
    padding: 0;
  }
}

/* Inner content container with max width for readability */
.content-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

@media (max-width: 1179px) {
  .content-inner {
    padding: 0 0 0;
  }
}

/* ============ LAYOUT UTILITIES ============ */
.container {
  padding: 0 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (min-width: 1024px) {
  .grid-2 {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1200px) {
  .grid-2 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; }

@media (min-width: 1024px) {
  h1 { font-size: 36px; }
  h2 { font-size: 26px; }
  h3 { font-size: 20px; }
}

.text-accent   { color: var(--accent); }
.text-secondary{ color: var(--text-secondary); }
.text-muted    { color: var(--text-muted); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-center   { text-align: center; }
.text-sm       { font-size: 13px; }
.text-xs       { font-size: 11px; }
.font-600      { font-weight: 600; }
.font-700      { font-weight: 700; }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 999px;
}

/* ============ PAGE HEADER (Mobile top bar / Desktop top bar inside content) ============ */
.page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

@media (min-width: 1180px) {
  .page-header {
    padding: 20px 32px;
    background: transparent;
    border-bottom: none;
    position: relative;
  }
}

.page-header .header-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  border: 1px solid var(--border);
  transition: background var(--transition), transform var(--transition);
}

.back-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.back-btn:active {
  transform: scale(0.94);
  background: var(--bg-card-hover);
}

/* Icon button (theme toggle, notification) */
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 18px;
  transition: all var(--transition);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* ============ SHARED APP TOP BAR ============ */
.top-bar {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.app-top-bar {
  position: sticky;
  top: 0;
  z-index: 110;
  background: color-mix(in srgb, var(--bg-primary) 84%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.app-top-context {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1;
}

.app-top-menu {
  display: none !important;
  flex: 0 0 auto;
}

.app-top-back {
  flex: 0 0 auto;
}

.app-top-title-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-top-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.app-top-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-top-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.tool-intro-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin: 0 auto 24px;
  padding: 16px 20px 10px;
  max-width: 1400px;
}

.tool-intro-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.tool-intro-hero__eyebrow {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tool-intro-hero__title {
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.tool-intro-hero__subtitle {
  margin: 0;
  max-width: 760px;
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1.5;
}

.tool-intro-hero__pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(93, 184, 228, 0.28);
  background: rgba(14, 25, 35, 0.72);
  color: #9cd8ff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 1179px) {
  .tool-intro-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 10px 14px 6px;
    margin-bottom: 18px;
  }

  .tool-intro-hero__eyebrow {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .tool-intro-hero__title {
    font-size: clamp(28px, 9vw, 40px);
    margin-bottom: 10px;
  }

  .tool-intro-hero__subtitle {
    font-size: 16px;
    line-height: 1.55;
  }

  .tool-intro-hero__pill {
    align-self: flex-start;
    min-height: 40px;
    padding: 10px 14px;
    font-size: 11px;
  }
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.action-icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition);
}

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

.profile-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 16px;
  margin-left: 4px;
  border-left: 1px solid var(--border);
}

.profile-text {
  text-align: right;
}

.profile-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
}

.profile-name.is-placeholder {
  color: var(--text-secondary);
}

.profile-status {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.2;
}

.profile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(90, 174, 224, 0.14);
  border: 1px solid rgba(90, 174, 224, 0.26);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: all var(--transition);
}

.profile-cta:hover {
  background: rgba(90, 174, 224, 0.22);
  border-color: rgba(90, 174, 224, 0.36);
}

.profile-cta[hidden] {
  display: none !important;
}

.profile-avatar-btn {
  padding: 0;
  background: transparent;
  border: none;
  flex: 0 0 auto;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 1180px) {
  .top-bar {
    padding: 20px 32px;
  }
}

@media (max-width: 1179px) {
  .top-bar {
    gap: 12px;
    padding: 14px 14px 12px;
  }

  .app-top-menu {
    display: inline-flex !important;
  }

  .app-top-back {
    display: none;
  }

  .app-top-context {
    gap: 12px;
  }

  .app-top-title {
    font-size: 24px;
  }

  .app-top-subtitle {
    font-size: 12px;
  }

  .top-actions {
    gap: 8px;
  }

  .top-bar > .app-top-menu {
    display: inline-flex !important;
    order: -1;
    flex: 0 0 auto;
  }

  .top-bar > .search-bar {
    flex: 1;
    min-width: 0;
  }

  .profile-text {
    display: none;
  }

  .profile-info {
    padding-left: 10px;
    gap: 10px;
  }

  .action-icon-btn,
  .profile-avatar,
  .icon-btn {
    width: 42px;
    height: 42px;
  }

  .profile-cta {
    display: none;
  }
}


/* ============ SECTION HEADING ============ */
.section-heading {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
  padding: 0 20px;
}

@media (min-width: 1024px) {
  .section-heading {
    font-size: 24px;
    padding: 0;
  }
}

/* ============ LOADING SKELETON ============ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  color: var(--border);
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.6;
}

/* ============ SHARED PROFILE MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

.modal-box .input-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 50px;
  border-radius: 10px;
  margin-top: 8px;
}

.modal-box .input-wrapper i {
  color: var(--text-muted);
  width: 20px;
}

.modal-box .input-wrapper input {
  background: none;
  border: none;
  color: var(--text-primary);
  width: 100%;
  outline: none;
  padding-left: 10px;
}

.avatar-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
  cursor: pointer;
}

.avatar-preview-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  overflow: hidden;
  position: relative;
}

.avatar-preview-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-preview-lg i {
  font-size: 24px;
  color: var(--text-muted);
}

@media (max-width: 1179px) {
  .modal-box {
    padding: 24px 18px;
  }
}

/* ============================================
   NEW UNIFIED APP HEADER  (logo centered)
   ============================================ */
.app-top-bar {
  position: sticky !important;
  top: 0;
  z-index: 200;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: 56px;
  min-height: 56px;
  background: rgba(17, 28, 34, 0.96) !important;
  border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-sizing: border-box;
  width: 100%;
}
[data-theme="light"] .app-top-bar {
  background: rgba(248, 250, 252, 0.96) !important;
  border-bottom-color: rgba(0,0,0,.08);
}

.app-top-left,
.app-top-right {
  display: flex;
  align-items: center;
  width: 48px;
  flex-shrink: 0;
}
.app-top-right { justify-content: flex-end; }

.app-top-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-top-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.app-top-logo {
  height: 34px;
  max-width: 160px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* hamburger & back icon buttons */
.app-top-bar .action-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  color: #c5d8ea;
  font-size: 17px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
}
[data-theme="light"] .app-top-bar .action-icon-btn {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.08);
  color: #3a5060;
}
.app-top-bar .action-icon-btn:hover {
  background: rgba(90,174,224,.15);
  color: #5aaee0;
}

/* ============================================
   SIDEBAR PROFILE BLOCK (bottom of sidebar)
   ============================================ */
.sidebar-profile-wrap {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: auto;
}
.sidebar-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: background .15s;
}
.sidebar-profile-btn:hover { background: rgba(90,174,224,.1); }
.sidebar-profile-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.sidebar-profile-text { flex: 1; min-width: 0; }
.sidebar-profile-name {
  font-size: 13px; font-weight: 700;
  color: #d8edf9;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-profile-status {
  font-size: 11px; color: #7a9ab8; margin-top: 2px;
}

/* ============================================
   GLOBAL BOTTOM NAV  (injected by sidebar.js)
   ============================================ */
.app-bottom-nav {
  display: none; /* hidden on desktop */
}
@media (max-width: 1179px) {
  .app-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 300;
    height: 64px;
    background: rgba(14,22,30,.97);
    border-top: 1px solid rgba(255,255,255,.07);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    align-items: center;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  [data-theme="light"] .app-bottom-nav {
    background: rgba(246,250,253,.97);
    border-top-color: rgba(0,0,0,.08);
  }

  .app-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    color: #8aa2b8;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 0;
    transition: color .15s;
  }
  [data-theme="light"] .app-bottom-nav__item { color: #6a7e8e; }
  .app-bottom-nav__item i { font-size: 20px; }
  .app-bottom-nav__item.active,
  .app-bottom-nav__item:hover { color: #5aaee0; }

  /* FAB (center button) */
  .app-bottom-nav__fab {
    flex-shrink: 0;
    width: 52px; height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #5aaee0, #3a8dbd);
    color: #fff;
    font-size: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(90,174,224,.35);
    margin: 0 8px;
    transition: transform .15s, box-shadow .15s;
  }
  .app-bottom-nav__fab:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 24px rgba(90,174,224,.5);
  }

  /* Push page content above bottom nav */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0)); }
}

