* {
  box-sizing: border-box;
}

:root {
  --portal-sidebar-expanded: 15.75rem;
  --portal-sidebar-collapsed: 4.5rem;
  --portal-sidebar-bg: #fcfdff;
  --portal-sidebar-border: #e6ebf3;
  --portal-sidebar-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  --portal-sidebar-text: #4b5565;
  --portal-sidebar-text-strong: #111827;
  --portal-sidebar-icon: #64748b;
  --portal-sidebar-hover-bg: #f2f5fa;
  --portal-sidebar-active-bg: #eaf0f9;
  --portal-sidebar-active-border: #dfe6f2;
}

body {
  font-family: "Inter", sans-serif;
}

body.portal-layout .portal-sidebar {
  width: var(--portal-sidebar-expanded);
  background: var(--portal-sidebar-bg);
  border-right: 1px solid var(--portal-sidebar-border);
  box-shadow: var(--portal-sidebar-shadow);
  transition: width 0.22s ease;
  overflow: visible;
}

body.portal-layout .portal-content {
  margin-left: var(--portal-sidebar-expanded);
  transition: margin-left 0.22s ease;
  min-width: 0;
}

body.portal-layout .portal-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-left: 1rem;
  padding-right: 0.9rem;
  border-bottom: 1px solid var(--portal-sidebar-border) !important;
  position: relative;
}

body.portal-layout .portal-sidebar-toggle {
  width: 1.95rem;
  height: 1.95rem;
  border-radius: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--portal-sidebar-icon);
  background: #ffffff;
  border: 1px solid #d5deec;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

body.portal-layout .portal-sidebar-toggle:hover {
  color: var(--portal-sidebar-text-strong);
  background: #f4f7fb;
  border-color: #cfd9e8;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

body.portal-layout .portal-sidebar-toggle:focus-visible {
  outline: 2px solid rgba(59, 91, 219, 0.28);
  outline-offset: 2px;
}

body.portal-layout .portal-sidebar-toggle .material-symbols-outlined {
  font-size: 1.2rem;
  line-height: 1;
}

body.portal-layout .portal-brand-link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  color: var(--portal-sidebar-text-strong) !important;
  text-decoration: none;
  line-height: 1.15;
}

body.portal-layout .portal-brand-text {
  display: inline;
  color: inherit !important;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

body.portal-layout .portal-brand-link .text-muted {
  color: #64748b !important;
}

body.portal-layout .portal-brand-short {
  display: none;
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  border: 1px solid var(--portal-sidebar-border);
  background: #ffffff;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--portal-sidebar-text-strong);
}

body.portal-layout .portal-sidebar .portal-sidebar-divider {
  margin: 0.55rem 0.25rem !important;
  border-top: 1px solid #e8edf5 !important;
}

body.portal-layout .portal-sidebar .portal-sidebar-item,
body.portal-layout .portal-sidebar .sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.72rem;
  width: 100%;
  padding: 0.62rem 0.78rem;
  border-radius: 0.72rem;
  border: 1px solid transparent;
  color: var(--portal-sidebar-text) !important;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

body.portal-layout .portal-sidebar .portal-sidebar-item:hover,
body.portal-layout .portal-sidebar .sidebar-item:hover {
  background: var(--portal-sidebar-hover-bg);
  border-color: #e3e9f4;
  color: var(--portal-sidebar-text-strong) !important;
}

body.portal-layout .portal-sidebar .portal-sidebar-item.is-active,
body.portal-layout .portal-sidebar .sidebar-item.is-active,
body.portal-layout .portal-sidebar .portal-sidebar-item[aria-current="page"],
body.portal-layout .portal-sidebar .sidebar-item[aria-current="page"] {
  background: var(--portal-sidebar-active-bg);
  border-color: var(--portal-sidebar-active-border);
  color: var(--portal-sidebar-text-strong) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.portal-layout .portal-sidebar .sidebar-item .material-symbols-outlined {
  margin: 0 !important;
  color: var(--portal-sidebar-icon) !important;
  font-size: 1.12rem;
  flex-shrink: 0;
}

body.portal-layout .portal-sidebar .sidebar-item.is-active .material-symbols-outlined,
body.portal-layout .portal-sidebar .sidebar-item[aria-current="page"] .material-symbols-outlined {
  color: #334155 !important;
}

body.portal-layout .portal-sidebar .sidebar-item .sidebar-label {
  display: inline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 1024px) {
  body.portal-layout.sidebar-collapsed .portal-sidebar {
    width: var(--portal-sidebar-collapsed);
  }

  body.portal-layout.sidebar-collapsed .portal-content {
    margin-left: var(--portal-sidebar-collapsed);
  }

  body.portal-layout.sidebar-collapsed .portal-sidebar-header {
    justify-content: center;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  body.portal-layout.sidebar-collapsed .portal-sidebar .portal-brand-link {
    display: none;
  }

  body.portal-layout.sidebar-collapsed .portal-sidebar .portal-brand-short {
    display: inline-flex;
  }

  body.portal-layout.sidebar-collapsed .portal-sidebar .portal-sidebar-toggle {
    position: absolute;
    right: -0.65rem;
    top: 1.15rem;
    width: 1.48rem;
    height: 1.48rem;
    border-radius: 999px;
    z-index: 6;
    padding: 0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
  }

  body.portal-layout.sidebar-collapsed .portal-sidebar .portal-sidebar-toggle .material-symbols-outlined {
    font-size: 1rem;
  }

  body.portal-layout.sidebar-collapsed .portal-sidebar nav {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  body.portal-layout.sidebar-collapsed .portal-sidebar .sidebar-item {
    justify-content: center;
    gap: 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    min-height: 2.6rem;
  }

  body.portal-layout.sidebar-collapsed .portal-sidebar .sidebar-item .sidebar-label {
    display: none;
  }

}

@media (max-width: 1023px) {
  body.portal-layout .portal-sidebar-toggle {
    display: none;
  }
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 20;
}

.portal-main {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.portal-pagination-anchor {
  scroll-margin-top: 5.5rem;
}

.portal-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.25rem;
  border: 1px solid #e4e7ef;
  border-radius: 0.9rem;
  background: #ffffff;
}

.portal-pagination[hidden] {
  display: none !important;
}

.portal-pagination__summary {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
  text-align: center;
}

.portal-pagination__nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.portal-pagination__pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.portal-pagination__button {
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.85rem;
  border: 1px solid #d8dfeb;
  border-radius: 0.65rem;
  background: #ffffff;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.portal-pagination__button:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1f2937;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.portal-pagination__button:focus-visible {
  outline: 2px solid rgba(59, 91, 219, 0.28);
  outline-offset: 2px;
}

.portal-pagination__button[disabled] {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.portal-pagination__button.is-active {
  border-color: #c7d2fe;
  background: #e8edff;
  color: #1d4ed8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.portal-pagination__button--control {
  min-width: 6.5rem;
}

.portal-pagination__ellipsis {
  min-width: 2rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
  user-select: none;
}

.portal-pagination__mobile-label {
  display: none;
  margin: 0;
  min-width: 6.5rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
}

@media (max-width: 640px) {
  .portal-pagination {
    padding: 0.875rem 1rem;
  }

  .portal-pagination__nav {
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: nowrap;
  }

  .portal-pagination__pages {
    display: none;
  }

  .portal-pagination__button {
    min-width: 0;
    padding: 0 0.95rem;
    font-size: 0.8125rem;
  }

  .portal-pagination__button--control {
    min-width: 0;
  }

  .portal-pagination__mobile-label {
    display: block;
  }
}

.ui-disabled-action {
  color: #9aa3b2;
  cursor: not-allowed;
}

.portal-profile-trigger {
  cursor: pointer;
  user-select: none;
  border-radius: 0.4rem;
  padding: 0.15rem 0.3rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.portal-profile-trigger:hover {
  background: #f3f5fb;
  color: #1f2937;
}

.portal-profile-trigger:focus-visible {
  outline: 2px solid rgba(59, 91, 219, 0.35);
  outline-offset: 2px;
}

.portal-account-menu {
  position: fixed;
  min-width: 11rem;
  background: #fff;
  border: 1px solid #e4e7ef;
  border-radius: 0.65rem;
  padding: 0.35rem;
  box-shadow: 0 14px 28px rgba(15, 17, 23, 0.12);
  z-index: 80;
}

.portal-account-menu__action {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 500;
  color: #b42318;
  border-radius: 0.5rem;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.portal-account-menu__action:hover {
  background: #fef2f2;
}
