:root { --sidebar-width: 300px; }

body { min-height: 100vh; background: #f6f8fb; }
.app-logo { max-width: 100%; height: auto; }

/* Shared admin-style sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1030;
  display: flex;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  padding: 1.25rem;
  overflow: auto;
  flex-direction: column;
  color: #fff;
  background: #416499;
  transition: transform .2s ease-in-out;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  padding: .35rem 2.3rem .9rem .35rem;
  position: relative;
}

.sidebar-brand .app-logo { max-height: 68px; object-fit: contain; }
.sidebar-brand .app-icon { width: 68px; height: 68px; }
.dashboard-brand-icon { object-fit: contain; }
.sidebar-close {
  position: absolute;
  top: .15rem;
  right: 0;
  width: 34px;
  height: 34px;
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 0;
  border-radius: .5rem;
}

.sidebar-menu { gap: .08rem; }
.sidebar-section-label {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: .95rem .7rem .28rem;
  color: rgba(255,255,255,.58);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .115em;
  line-height: 1;
  text-transform: uppercase;
}
.sidebar-section-label::after {
  height: 1px;
  flex: 1;
  content: '';
  background: rgba(255,255,255,.13);
}
.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 42px;
  padding: .58rem .7rem;
  color: #fff;
  cursor: pointer;
  border: 0;
  border-radius: .5rem;
  text-align: left;
}
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar .nav-link.active { color: #fff; background: rgba(255,255,255,.14); }
.sidebar .nav-link > i, .sidebar .nav-link > span > i { width: 20px; text-align: center; }
.sidebar .nav-link > span:not(.sidebar-menu-badge) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .sidebar-link-disabled { color: rgba(255,255,255,.57); cursor: default; }
.sidebar .sidebar-link-disabled:hover { color: rgba(255,255,255,.57); background: transparent; }
.sidebar-menu-badge {
  margin-left: auto;
  padding: .18rem .4rem;
  color: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-size: .56rem;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
}
.sidebar-submenu { width: 100%; }
.sidebar-submenu > summary { width: 100%; justify-content: space-between; list-style: none; }
.sidebar-submenu > summary::-webkit-details-marker { display: none; }
.sidebar-submenu > summary > span { display: flex; align-items: center; gap: .65rem; }
.sidebar .submenu {
  display: none;
  margin: .35rem 0 .35rem 1rem;
  padding-left: 1rem;
  list-style: none;
  border-left: 1px solid rgba(255,255,255,.2);
}
.sidebar .sidebar-submenu[open] > .submenu { display: block; }
.sidebar .submenu .nav-link { min-height: 34px; padding: .38rem .55rem; font-size: .92rem; }
.chevron { margin-left: auto; font-size: .75rem; transition: transform .2s ease; }
.sidebar-submenu[open] > summary .chevron { transform: rotate(180deg); }
.logout-btn { padding: .5rem 1rem; color: #fff; background: #ffbd59; border: 0; border-radius: .25rem; }
.logout-btn:hover { color: #fff; background: #f2ae48; }

/* Shared admin-style content shell */
.content-wrap { min-height: 100vh; margin-left: var(--sidebar-width); }
.dashboard-navbar { z-index: 1010; }
.topbar-account-summary { display: flex; align-items: stretch; overflow: hidden; border: 1px solid #e5e9f2; border-radius: 11px; background: #f8f9fc; }
.topbar-account-summary a { display: flex; min-width: 106px; padding: .4rem .7rem; align-items: center; gap: .5rem; color: #344054; text-decoration: none; }
.topbar-account-summary a + a { border-left: 1px solid #e5e9f2; }
.topbar-account-summary a:hover { background: #f0f2ff; color: #4d4ed2; }
.topbar-account-summary i { color: #5b5ce2; }
.topbar-account-summary span, .topbar-account-summary small, .topbar-account-summary strong { display: block; line-height: 1.1; }
.topbar-account-summary small { margin-bottom: .15rem; color: #98a2b3; font-size: .62rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.topbar-account-summary strong { max-width: 112px; overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-navbar { min-height: 65px; }
.main-content { padding: 0 1.5rem 1.5rem; }
.dashboard-user-menu { color: #344054; }
.dashboard-user-menu:hover { color: #1d2939; }
.dashboard-user-menu img { object-fit: cover; }
.sidebar-backdrop { display: none; }

/* Existing auth/public helpers */
.login-sidebar-bg { padding: 1.75rem; color: #fff; background: #416499; border-radius: .5rem 0 0 .5rem; }
.login-wrapper, .auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.brand { font-weight: 700; letter-spacing: .4px; }
.stat-card { border-radius: .75rem; }
.pw-strength { height: 8px; overflow: hidden; background: #e9ecef; border-radius: 6px; }
.pw-strength > div { width: 0; height: 100%; transition: width .2s ease-in-out; }
footer.small { color: #6c757d; }
.table .btn { padding: .25rem .5rem; font-size: .85rem; }

@media (max-width: 991.98px) {
  .topbar-account-summary a { min-width: auto; padding: .4rem .55rem; }
  .topbar-account-summary small { display: none; }
  .topbar-account-summary strong { max-width: 72px; font-size: .7rem; }
  .sidebar { transform: translateX(-110%); box-shadow: 15px 0 35px rgba(25, 39, 70, .18); }
  .sidebar.show { transform: translateX(0); }
  .content-wrap { margin-left: 0; }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1025;
    display: block;
    visibility: hidden;
    padding: 0;
    background: rgba(18, 29, 51, .42);
    border: 0;
    opacity: 0;
    transition: opacity .2s ease, visibility .2s ease;
  }
  .sidebar-backdrop.show { visibility: visible; opacity: 1; }
  body.sidebar-open { overflow: hidden; }
}

@media (max-width: 575.98px) {
  :root { --sidebar-width: min(300px, 88vw); }
  .main-content { padding-right: .9rem; padding-left: .9rem; }
  .dashboard-navbar { min-height: 60px; }
}
