/* Premium minimal drawer â€” sidebar only */

:root {
  --drawer-bg: #F8FAFC;
  --drawer-card: #ffffff;
  --drawer-border: rgba(15, 23, 42, 0.08);
  --drawer-muted: #64748B;
  --drawer-ico-bg: rgba(200, 169, 107, 0.12);
  --drawer-ico-color: #C8A96B;
  --drawer-accent: #C8A96B;
  --drawer-panel: rgba(15, 23, 42, 0.03);
  --drawer-navy: #0F172A;
}

.sidebar {
  background: var(--drawer-bg);
  border-inline-end: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sidebar:has(.drawer-inner) {
  overflow: hidden !important;
  overscroll-behavior: contain;
}

.drawer-top {
  flex-shrink: 0;
  position: relative;
  z-index: 4;
  background: var(--drawer-bg);
}

.drawer-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 16px 14px calc(12px + env(safe-area-inset-bottom, 0));
  gap: 0;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

.drawer-close {
  display: none;
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  z-index: 5;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--drawer-border);
  border-radius: 10px;
  background: var(--drawer-card);
  color: var(--drawer-muted);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.drawer-close:hover {
  background: rgba(200, 169, 107, 0.1);
  color: var(--text);
  border-color: rgba(200, 169, 107, 0.3);
}

.drawer-close .icon,
.drawer-close svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ---------- Header ---------- */
.drawer-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-shrink: 0;
}

.drawer-header__logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 12px;
  background: var(--drawer-navy);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.drawer-header__logo .icon,
.drawer-header__logo svg {
  width: 22px;
  height: 22px;
  display: block;
}

.drawer-header__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.drawer-header__rule {
  width: 100%;
  height: 1px;
  margin-top: 12px;
  margin-bottom: 0;
  background: var(--drawer-border);
}

/* ---------- Profile (flat, aligned with menu cards) ---------- */
.drawer-profile {
  margin-top: 10px;
  padding: 0;
  flex-shrink: 0;
}

.drawer-profile__card {
  border-radius: 14px;
  border: 1px solid var(--drawer-border);
  background: var(--drawer-card);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.drawer-profile .brand__user--flat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 12px;
  margin: 0;
  background: none;
  border: none;
  box-shadow: none;
  min-width: 0;
  box-sizing: border-box;
}

.drawer-profile .brand__user-ico {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 50%;
  background: var(--drawer-navy);
  color: var(--drawer-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(200, 169, 107, 0.25);
}

.drawer-profile .brand__user-svg {
  width: 16px !important;
  height: 16px !important;
  display: block;
  stroke: var(--drawer-accent) !important;
  color: var(--drawer-accent);
}

.drawer-profile .brand__user-initial {
  font-size: 13px;
  font-weight: 700;
  color: var(--drawer-accent);
  line-height: 1;
}

.drawer-profile .brand__user-line {
  min-width: 0;
  flex: 1;
  font-size: 13px;
  line-height: 1.35;
}

.drawer-profile .brand__user-role {
  font-size: 13px;
  font-weight: 600;
  color: var(--drawer-accent);
}

.drawer-profile .brand__user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ---------- Role / panel switch (dual-role accounts) ---------- */
.drawer-role {
  margin-top: 10px;
  flex-shrink: 0;
}

.drawer-role.is-hidden {
  display: none;
}

.drawer-role__card {
  border-radius: 14px;
  border: 1px solid var(--drawer-border);
  background: var(--drawer-card);
  padding: 10px 11px 11px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.drawer-role__label {
  margin: 0 0 8px;
  padding-inline: 2px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--drawer-muted);
}

.drawer-role .rs-panels {
  gap: 6px;
}

.drawer-role .rs-panels.is-switching {
  opacity: 0.72;
  pointer-events: none;
}

.drawer-role .rs-panel {
  padding: 9px 10px;
  border-radius: 11px;
  gap: 9px;
  border-width: 1px;
  background: rgba(255, 255, 255, 0.72);
}

.drawer-role .rs-panel__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.drawer-role .rs-panel__icon .icon,
.drawer-role .rs-panel__icon svg {
  width: 17px !important;
  height: 17px !important;
}

.drawer-role .rs-panel__title {
  font-size: 12px;
}

.drawer-role .rs-panel__desc {
  font-size: 10px;
  line-height: 1.35;
}

.drawer-role .rs-panel__status {
  font-size: 10px;
  white-space: nowrap;
}


/* ---------- Scroll area ---------- */
.drawer-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin-top: 10px;
  padding-bottom: 4px;
  position: relative;
  z-index: 1;
}

.drawer-scroll::-webkit-scrollbar {
  width: 4px;
}

.drawer-scroll::-webkit-scrollbar-thumb {
  background: rgba(200, 169, 107, 0.35);
  border-radius: 4px;
}

/* ---------- Sections ---------- */
.drawer-nav.nav {
  padding: 0;
  flex: none;
  overflow: hidden;
  gap: 0;
}

.drawer-section {
  margin-top: 16px;
}

.drawer-section:first-child {
  margin-top: 0;
}

.drawer-section--account {
  margin-top: 20px;
  padding-bottom: 4px;
}

.drawer-section__label {
  margin: 0 0 8px;
  padding-inline: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--drawer-muted);
}

.drawer-divider {
  height: 1px;
  background: var(--drawer-border);
  margin-bottom: 16px;
}

.drawer-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Menu cards (compact, uniform) ---------- */
.drawer-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 11px;
  border-radius: 12px;
  background: var(--drawer-card);
  border: 1px solid var(--drawer-border);
  box-shadow: none;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  list-style: none;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 0;
  flex-shrink: 0;
}

.drawer-card--link:hover,
.drawer-card--group > summary:hover {
  background: rgba(200, 169, 107, 0.07);
  border-color: rgba(200, 169, 107, 0.28);
}

.drawer-card--link.is-active {
  background: var(--drawer-ico-bg);
  border-color: rgba(200, 169, 107, 0.38);
}

.drawer-card--link.is-active .drawer-card__title {
  color: #7A6238;
  font-weight: 700;
}

.drawer-card--link.is-active .drawer-card__ico {
  background: rgba(200, 169, 107, 0.22);
  color: #7A6238;
}

.drawer-card__ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--drawer-ico-bg);
  color: var(--drawer-ico-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-card__ico .icon,
.drawer-card__ico svg {
  width: 16px;
  height: 16px;
  display: block;
}

.drawer-card__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-card__title {
  flex: none;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-card__subtitle {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--drawer-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-card__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  flex-shrink: 0;
  opacity: 0.85;
}

.drawer-card--link.is-active .drawer-card__arrow {
  color: #7A6238;
}

.drawer-card__arrow .icon,
.drawer-card__arrow svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* Expand chevron â€” accordion groups only */
.drawer-card__expand {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(200, 169, 107, 0.1);
  color: var(--drawer-ico-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-inline-start: auto;
  transition: transform 0.22s ease, background 0.2s ease, color 0.2s ease;
}

.drawer-card__expand .icon,
.drawer-card__expand svg {
  width: 14px;
  height: 14px;
  display: block;
}

.drawer-card--group[open] > summary .drawer-card__expand,
.drawer-card--group.is-open > summary .drawer-card__expand {
  transform: rotate(180deg);
  background: rgba(200, 169, 107, 0.2);
  color: #7A6238;
}

/* ---------- Accordion groups ---------- */
.drawer-card--group {
  display: block;
  padding: 0;
  overflow: hidden;
}

.drawer-card--group > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 11px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.drawer-card--group > summary::-webkit-details-marker { display: none; }
.drawer-card--group > summary::marker { content: ""; display: none; }

.drawer-card--group[open],
.drawer-card--group.is-open {
  border-color: rgba(200, 169, 107, 0.32);
  background: var(--drawer-card);
}

.drawer-card--group[open] > summary,
.drawer-card--group.is-open > summary {
  border-bottom: 1px solid var(--drawer-border);
  background: rgba(200, 169, 107, 0.04);
}

.drawer-card--group[open] > summary .drawer-card__title,
.drawer-card--group.is-open > summary .drawer-card__title {
  color: #7A6238;
}

/* Override legacy nav-group styles inside drawer */
.drawer-nav .nav-group {
  margin-bottom: 0;
  border: 1px solid var(--drawer-border);
  border-radius: 12px;
  background: var(--drawer-card);
  overflow: hidden;
}

.drawer-nav .nav-group__head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 11px !important;
  box-sizing: border-box;
  font-size: inherit;
  font-weight: inherit;
}

.drawer-nav .nav-group__head:hover {
  background: transparent;
}

.drawer-nav .nav-group[open] > .nav-group__head,
.drawer-nav .nav-group.is-open > .nav-group__head {
  background: transparent;
  border-bottom: none;
}

.drawer-nav .nav-group__ico,
.drawer-nav .drawer-card__ico.nav-group__ico {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px;
  min-height: 30px;
  border-radius: 9px;
  background: var(--drawer-ico-bg);
  color: var(--drawer-ico-color);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
}

.drawer-nav .nav-group__ico .icon,
.drawer-nav .nav-group__ico svg,
.drawer-nav .drawer-card__ico svg {
  width: 16px !important;
  height: 16px !important;
  display: block;
}

.drawer-nav .nav-group[open] > .nav-group__head .nav-group__ico,
.drawer-nav .nav-group.is-open > .nav-group__head .nav-group__ico {
  background: rgba(200, 169, 107, 0.22);
  color: #7A6238;
}

.drawer-nav .nav-group__label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}

.drawer-nav .nav-group__chev {
  display: none;
}

/* Sub-items panel */
.drawer-card__panel,
.drawer-nav .nav-group__items {
  padding: 6px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: none;
  background: var(--drawer-panel);
  border-radius: 0 0 11px 11px;
}

.drawer-sub,
.drawer-nav .nav-group__items a,
.drawer-nav .drawer-card__panel a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px !important;
  margin: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  border-inline-start: none !important;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
  background: rgba(255, 255, 255, 0.55) !important;
}

.drawer-sub__ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
  color: var(--drawer-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-sub__ico .icon,
.drawer-sub__ico svg {
  width: 15px !important;
  height: 15px !important;
  display: block;
}

.drawer-sub__label {
  flex: 1;
  min-width: 0;
  text-align: start;
}

.drawer-sub__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.drawer-sub:hover .drawer-sub__arrow,
.drawer-sub.active .drawer-sub__arrow {
  opacity: 1;
}

.drawer-sub:hover,
.drawer-nav .nav-group__items a:hover,
.drawer-nav .drawer-card__panel a:hover {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(200, 169, 107, 0.22) !important;
}

.drawer-sub:hover .drawer-sub__ico {
  color: #7A6238;
  background: rgba(200, 169, 107, 0.12);
}

.drawer-sub.active,
.drawer-nav .nav-group__items a.active,
.drawer-nav .drawer-card__panel a.active {
  background: #fff !important;
  color: #7A6238 !important;
  font-weight: 700;
  border-color: rgba(200, 169, 107, 0.32) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
}

.drawer-sub.active .drawer-sub__ico,
.drawer-nav .nav-group__items a.active .drawer-sub__ico {
  background: var(--drawer-ico-bg);
  color: #7A6238;
}

.drawer-nav a.drawer-card--link {
  margin-bottom: 0;
}

.drawer-nav a.drawer-card--link:hover {
  background: rgba(200, 169, 107, 0.07);
}

.drawer-nav a.drawer-card--link.is-active {
  background: var(--drawer-ico-bg);
  color: var(--text);
}

/* ---------- Footer / logout (in nav below settings) ---------- */
.drawer-cards .drawer-logout {
  margin-top: 6px;
  text-align: start;
  border-color: rgba(220, 38, 38, 0.28);
  color: #dc2626;
}

.drawer-logout {
  width: 100%;
  min-height: 48px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: var(--drawer-card);
  color: #dc2626;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
}

.drawer-logout:hover {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.45);
}

.drawer-logout__ico-wrap {
  background: rgba(220, 38, 38, 0.08) !important;
  color: #dc2626 !important;
}

.drawer-logout .drawer-card__title {
  color: #dc2626;
  font-weight: 600;
}

.drawer-logout__ico {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: block;
}












/* ---------- Mobile drawer ---------- */
@media (max-width: 720px) {
  .sidebar {
    width: 88%;
    max-width: 320px;
    height: 100dvh;
    max-height: 100dvh;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.08);
    border-start-start-radius: 22px;
    border-end-start-radius: 22px;
    transition: transform 300ms ease;
  }

  .sidebar.open {
    z-index: 110;
  }

  .drawer-inner {
    height: 100%;
    max-height: 100dvh;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
  }

  .drawer-scroll {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  }

  .drawer-close {
    display: inline-flex;
  }
}

@media (min-width: 721px) {
  .sidebar {
    width: 272px;
    box-shadow: inset -1px 0 0 var(--drawer-border);
  }

  .drawer-header__title {
    font-size: 16px;
  }
}
