  /* ============================
       Flux-ish Bootstrap tweaks
       ============================ */
    :root{
      --bs-font-sans-serif: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
      --bs-body-font-family: var(--bs-font-sans-serif);

      /* slightly smaller + tighter than default Bootstrap */
      --bs-body-font-size: .9375rem; /* 15px */
      --bs-body-line-height: 1.45;

      /* rounder corners */
      --bs-border-radius: .5rem;
      --bs-border-radius-sm: .375rem;
      --bs-border-radius-lg: .5rem;

      /* subtle UI palette (feel free to align to your brand) */
      --app-bg: #ffffff;
      --app-muted: rgba(17, 24, 39, .55);
      --app-border: rgba(17, 24, 39, .10);
      --app-surface: #f8f9fb; /* light sidebar bg */
      --app-hover: rgba(17, 24, 39, .04);

      --sidebar-w: 16rem;  /* 256px */
      --sidebar-w-collapsed: 3.5rem; /* 56px */
      --header-h: 3.5rem;  /* 56px */
    }

    body {
      background: var(--app-bg);
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{
      font-weight: 600;
      letter-spacing: -0.01em;
    }

    .text-muted-soft { color: var(--app-muted) !important; }

    /* ============================
       App layout
       ============================ */
    .app {
      min-height: 100vh;
      display: grid;
      grid-template-columns: var(--sidebar-w) 1fr;
      grid-template-rows: 1fr;
    }

    aside.app-sidebar {
      position: sticky;
      top: 0;
      height: 100vh;
      border-right: 1px solid var(--app-border);
      background: var(--app-surface);
      overflow: hidden;
    }

    main.app-main {
      min-width: 0;
      background: var(--app-bg);
    }

    /* Sidebar inner */
    .sidebar-inner {
      height: 100%;
      display: flex;
      flex-direction: column;
      padding: 1rem;
      gap: .75rem;
      overflow: auto;
      overscroll-behavior: contain;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: .5rem;
      min-height: 2.5rem;
    }
    .brand .logo {
      width: 1.5rem;
      height: 1.5rem;
      border-radius: .25rem;
      display: grid;
      place-items: center;
      font-weight: 600;
      background: #111827;
      color: #fff;
      font-size: .75rem;
      flex: 0 0 auto;
    }
    .brand .name {
      font-weight: 500;
      font-size: .875rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* ============================
       Sidebar Search (REAL INPUT)
       ============================ */
    .sidebar-search-wrap {
      display: flex;
      align-items: center;
      gap: .5rem;
      height: 2.5rem; /* Flux-like h-10 */
      border-radius: .5rem;
      padding: 0 .75rem;
      background: rgba(17, 24, 39, .04);
      border: 1px solid transparent;
    }
    .sidebar-search-wrap:hover {
      background: rgba(17, 24, 39, .06);
    }
    .sidebar-search-wrap:focus-within {
      background: rgba(17, 24, 39, .06);
      border-color: rgba(59, 130, 246, .35);
      box-shadow: 0 0 0 .2rem rgba(59, 130, 246, .10);
    }
    .sidebar-search-wrap svg {
      width: 1.125rem;
      height: 1.125rem;
      opacity: .55;
      flex: 0 0 auto;
    }
    .sidebar-search-input {
      width: 100%;
      border: 0;
      outline: 0;
      background: transparent;
      color: rgba(17, 24, 39, .90);
      font-size: .875rem;
      font-weight: 500;
      padding: 0;
    }
    .sidebar-search-input::placeholder {
      color: rgba(17, 24, 39, .55);
    }
    .sidebar-search-clear {
      border: 0;
      background: transparent;
      width: 1.5rem;
      height: 1.5rem;
      border-radius: .375rem;
      display: grid;
      place-items: center;
      color: rgba(17, 24, 39, .55);
      opacity: 0;
      pointer-events: none;
      transition: opacity .12s ease;
      flex: 0 0 auto;
    }
    .sidebar-search-wrap.has-value .sidebar-search-clear {
      opacity: 1;
      pointer-events: auto;
    }

    /* Nav items */
    .nav-section { display: flex; flex-direction: column; gap: .125rem; }
    .nav-item-link {
      display: flex;
      align-items: center;
      gap: .65rem;
      height: 2.5rem;
      padding: 0 .75rem;
      border-radius: .5rem;
      color: rgba(17, 24, 39, .65);
      text-decoration: none;
      border: 1px solid transparent;
      font-size: .875rem;
      font-weight: 500;
    }
    .nav-item-link:hover {
      background: var(--app-hover);
      color: rgba(17, 24, 39, .9);
    }
    .nav-item-link.active {
      background: #fff;
      border-color: var(--app-border);
      color: rgba(17, 24, 39, .95);
    }
    .nav-item-link svg { width: 1.1rem; height: 1.1rem; opacity: .7; }

    .nav-badge {
      margin-left: auto;
      font-size: .75rem;
      font-weight: 600;
      padding: .15rem .35rem;
      border-radius: .25rem;
      background: rgba(17,24,39,.08);
      color: rgba(17,24,39,.75);
    }

    /* Favorites accordion */
    .fav-toggle {
      background: transparent;
      border: 0;
      height: 2.5rem;
      padding: 0 .75rem;
      border-radius: .5rem;
      color: rgba(17, 24, 39, .65);
      font-size: .875rem;
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: .65rem;
      width: 100%;
    }
    .fav-toggle:hover { background: var(--app-hover); color: rgba(17,24,39,.9); }
    .fav-toggle .chev { width: .9rem; height: .9rem; opacity: .65; transition: transform .15s ease; }
    .fav-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

    .fav-list {
      margin-left: .75rem;
      padding-left: .75rem;
      border-left: 1px solid rgba(17,24,39,.14);
      display: flex;
      flex-direction: column;
      gap: .125rem;
    }
    .fav-list a {
      height: 2.25rem;
      display: flex;
      align-items: center;
      padding: 0 .75rem;
      border-radius: .5rem;
      text-decoration: none;
      color: rgba(17,24,39,.6);
      font-size: .875rem;
      font-weight: 500;
    }
    .fav-list a:hover { background: var(--app-hover); color: rgba(17,24,39,.9); }

    /* Bottom profile */
    .sidebar-footer {
      margin-top: auto;
      padding-top: .5rem;
    }
    .profile-btn {
      width: 100%;
      border: 0;
      background: rgba(17, 24, 39, .03);
      border-radius: .75rem;
      padding: .5rem .5rem;
      display: flex;
      align-items: center;
      gap: .65rem;
      cursor: pointer;
    }
    .profile-btn:hover { background: rgba(17, 24, 39, .06); }
    .avatar {
      width: 2rem;
      height: 2rem;
      border-radius: .5rem;
      overflow: hidden;
      background: rgba(17,24,39,.12);
      flex: 0 0 auto;
      display: grid;
      place-items: center;
      font-weight: 600;
      font-size: .8rem;
      color: rgba(17,24,39,.8);
    }
    .profile-name {
      font-size: .875rem;
      font-weight: 600;
      color: rgba(17,24,39,.75);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1 1 auto;
    }
    .profile-btn svg { width: 1rem; height: 1rem; opacity: .6; }

    /* ============================
       Mobile header (Flux-like)
       ============================ */
    .mobile-header {
      height: var(--header-h);
      display: none; /* shown on < lg */
      align-items: center;
      gap: .5rem;
      padding: 0 1rem;
      border-bottom: 1px solid rgba(17, 24, 39, .06);
      background: var(--app-bg);
      position: sticky;
      top: 0;
      z-index: 1030;
    }

    .icon-btn {
      width: 2.5rem;
      height: 2.5rem;
      border-radius: .5rem;
      border: 0;
      background: transparent;
      display: grid;
      place-items: center;
      color: rgba(17,24,39,.65);
    }
    .icon-btn:hover { background: rgba(17,24,39,.05); color: rgba(17,24,39,.9); }
    .icon-btn svg { width: 1.2rem; height: 1.2rem; }

    .mobile-header .spacer { flex: 1; }

    /* Sidebar offcanvas behavior (we implement our own simple version) */
    .sidebar-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.12);
      z-index: 1040;
    }

    @media (max-width: 991.98px) { /* < lg */
      .app {
        grid-template-columns: 1fr;
      }

      aside.app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1050;
        width: var(--sidebar-w);
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 10px 30px rgba(0,0,0,.08);
      }

      body.sidebar-open aside.app-sidebar {
        transform: translateX(0);
      }

      body.sidebar-open .sidebar-backdrop {
        display: block;
      }

      .mobile-header {
        display: flex;
      }
    }

    /* ============================
       Content styling (Flux-ish spacing + control sizing)
       ============================ */
    .page-wrap {
      max-width: 48rem;
      margin: 0 auto;
      padding: 1.5rem;
    }
    @media (min-width: 992px) {
      .page-wrap { padding: 2rem; }
    }

    .section-divider {
      height: 1px;
      background: rgba(17,24,39,.06);
      margin: 2rem 0;
    }

    .section-title {
      font-size: 1.75rem;
      margin: 0 0 .5rem;
    }

    .subhead {
      font-size: 1rem;
      font-weight: 600;
      margin: 0;
    }

    .help-text {
      font-size: .875rem;
      margin-top: .5rem;
      color: var(--app-muted);
    }

    /* Make Bootstrap forms feel closer to Flux */
    .form-label { font-size: .875rem; font-weight: 600; margin-bottom: .5rem; }
    .form-text { font-size: .875rem; color: var(--app-muted); }

    .form-control,
    .form-select {
      min-height: 2.5rem;
      padding: .5rem .75rem;
      font-size: .875rem;
      border-color: rgba(17,24,39,.14);
      box-shadow: 0 1px 0 rgba(17,24,39,.03);
    }

    .form-control:focus,
    .form-select:focus {
      border-color: rgba(59, 130, 246, .45);
      box-shadow: 0 0 0 .2rem rgba(59, 130, 246, .12);
    }

    textarea.form-control { min-height: 7rem; resize: vertical; }

    .btn-primary {
      border-radius: .5rem;
      font-weight: 600;
      font-size: .875rem;
      padding: .55rem 1rem;
    }

    /* Small utilities */
    .muted-line { height: 1px; background: rgba(17,24,39,.04); }

    /* Hide native "x" clear button on type="search" (Chrome/Safari/Edge) */
.sidebar-search-input[type="search"]::-webkit-search-cancel-button,
.sidebar-search-input[type="search"]::-webkit-search-decoration,
.sidebar-search-input[type="search"]::-webkit-search-results-button,
.sidebar-search-input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

/* Hide native clear button on old Edge/IE */
.sidebar-search-input::-ms-clear,
.sidebar-search-input::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

/* ============================
   Auth (Login) page
   ============================ */

.auth-body {
  background: var(--app-bg);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-wrap {
  width: 100%;
  max-width: 26rem;
}

.auth-card {
  background: #fff;
  border: 1px solid rgba(17,24,39,.08);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.05);
  padding: 1.25rem;
}

@media (min-width: 992px) {
  .auth-card { padding: 1.5rem; }
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}

.auth-brand .logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .75rem;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: #111827;
  color: #fff;
  font-size: .9rem;
  flex: 0 0 auto;
}

.auth-title {
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.25rem;
  line-height: 1.2;
}

.auth-subtitle {
  font-size: .875rem;
  margin-top: .1rem;
}

.auth-link {
  font-size: .875rem;
  font-weight: 600;
  color: rgba(17,24,39,.75);
  text-decoration: none;
}
.auth-link:hover {
  text-decoration: underline;
  color: rgba(17,24,39,.95);
}

.auth-footer {
  font-size: .875rem;
}
