/* پنل مدیریت — چیدمان و منو */

.panel-wrap {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  max-width: 1320px;
  margin: 0 auto;
  background: #FAF8F5;
  position: relative;
}

.panel-sidebar {
  width: 272px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #FFFFFF 0%, #FBF9F6 100%);
  border-left: 1px solid #E8E4DE;
  box-shadow: -4px 0 24px rgba(28, 27, 26, .04);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 30;
}

.panel-top-actions {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 45;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.panel-top-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #57544F;
  text-decoration: none;
  background: #F5F2ED;
  border: 1px solid #ECE8E2;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.panel-top-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.panel-top-link:hover {
  background: #FFFFFF;
  color: #1C1B1A;
  border-color: #D8D4CE;
}

.panel-top-link.is-logout {
  color: #B84A3A;
  background: rgba(184, 74, 58, .06);
  border-color: rgba(184, 74, 58, .18);
}

.panel-top-link.is-logout:hover {
  background: rgba(184, 74, 58, .12);
  color: #9A3224;
}

.sb-header {
  flex-shrink: 0;
  padding: 14px 16px 18px;
  border-bottom: 1px solid #ECE8E2;
  background: linear-gradient(135deg, rgba(200, 16, 46, .06) 0%, transparent 55%);
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sb-avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #C8102E, #A50D24);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(200, 16, 46, .28);
}

.sb-brand-text {
  min-width: 0;
}

.sb-brand-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #1C1B1A;
  line-height: 1.3;
}

.sb-brand-sub {
  font-size: 11px;
  color: #8A857E;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(200, 16, 46, .08);
  border: 1px solid rgba(200, 16, 46, .14);
  font-size: 10.5px;
  font-weight: 600;
  color: #C8102E;
}

.panel-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 16px;
  scrollbar-width: thin;
  scrollbar-color: #D8D4CE transparent;
}

.panel-nav-section {
  padding: 16px 12px 7px;
  font-size: 10px;
  font-weight: 800;
  color: #A8A39C;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-nav-link,
.panel-accordion-toggle {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 2px 0;
  padding: 10px 12px;
  color: #57544F;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
  background: none;
  width: 100%;
  text-align: right;
  font-family: inherit;
  cursor: pointer;
  box-sizing: border-box;
}

.panel-nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F5F2ED;
  border: 1px solid #ECE8E2;
  color: #6B6762;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.panel-nav-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel-nav-label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.panel-nav-link:hover,
.panel-accordion-toggle:hover {
  background: rgba(255, 255, 255, .85);
  border-color: #ECE8E2;
  color: #1C1B1A;
}

.panel-nav-link:hover .panel-nav-icon,
.panel-accordion-toggle:hover .panel-nav-icon {
  background: #FFFFFF;
  border-color: #E0DCD6;
  color: #C8102E;
}

.panel-nav-link.active,
.panel-accordion-toggle.active {
  background: linear-gradient(90deg, rgba(200, 16, 46, .14) 0%, rgba(200, 16, 46, .06) 100%);
  border-color: rgba(200, 16, 46, .22);
  color: #A50D24;
  box-shadow: 0 2px 10px rgba(200, 16, 46, .08);
}

.panel-nav-link.active .panel-nav-icon,
.panel-accordion-toggle.active .panel-nav-icon {
  background: linear-gradient(145deg, #C8102E, #A50D24);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(200, 16, 46, .3);
}

.panel-nav-link.sub {
  padding: 8px 12px 8px 28px;
  font-size: 12.5px;
  font-weight: 600;
}

.panel-nav-link.sub .panel-nav-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D8D4CE;
  border: none;
}

.panel-nav-link.sub .panel-nav-icon svg {
  display: none;
}

.panel-nav-link.sub.active .panel-nav-icon {
  background: #C8102E;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, .18);
}

.panel-accordion {
  margin: 2px 0;
}

.panel-accordion-toggle {
  justify-content: flex-start;
}

.panel-accordion-toggle .panel-nav-label {
  flex: 1;
}

.panel-accordion-chevron {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #8A857E;
  background: #F5F2ED;
  border: 1px solid #ECE8E2;
  transition: transform .22s ease, background .18s ease;
  flex-shrink: 0;
}

.panel-accordion.is-open .panel-accordion-chevron {
  transform: rotate(180deg);
  background: rgba(200, 16, 46, .1);
  color: #C8102E;
  border-color: rgba(200, 16, 46, .18);
}

.panel-accordion-content {
  display: none;
  margin: 4px 0 6px;
  padding: 4px 0 4px 8px;
  border-right: 2px solid #ECE8E2;
  margin-right: 22px;
}

.panel-accordion.is-open .panel-accordion-content {
  display: block;
}

.panel-main {
  flex: 1;
  min-width: 0;
  padding: 52px 30px 44px;
}

.hamburger {
  display: none;
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 60;
  width: 44px;
  height: 44px;
  background: #FFFFFF;
  border: 1px solid #ECE8E2;
  border-radius: 12px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  box-shadow: 0 6px 20px rgba(28, 27, 26, .1);
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #57544F;
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28, 27, 26, .45);
  z-index: 40;
  backdrop-filter: blur(3px);
}

.sidebar-overlay.show {
  display: block;
}

@media (max-width: 900px) {
  .hamburger {
    display: flex;
  }

  .panel-wrap {
    display: block;
  }

  .panel-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: min(292px, 90vw);
    height: 100vh;
    transform: translateX(110%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    box-shadow: -12px 0 40px rgba(28, 27, 26, .14);
  }

  .panel-sidebar.open {
    transform: translateX(0);
  }

  .panel-top-actions {
    top: 14px;
    inset-inline-end: 12px;
  }

  .panel-main {
    padding: 72px 16px 28px;
  }

  .panel-page-title {
    padding-right: 52px;
  }
}

@media (max-width: 480px) {
  .dashboard-section {
    display: block;
  }

  .dashboard-section > * {
    margin-bottom: 16px;
  }

  .panel-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
