:root {
  --dsln-brand: #2563eb;
}

body {
  background: #f6f8fb;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--dsln-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.cp-sidebar-card {
  border-radius: 14px;
}

.cp-navbar-title {
  font-weight: 700;
}

.cp-auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.cp-auth-card {
  width: 100%;
  max-width: 460px;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.cp-page-subtitle {
  max-width: 900px;
}

.cp-kpi-card .h1,
.cp-kpi-card .h2 {
  margin-bottom: 0;
}

.cp-table-actions {
  white-space: nowrap;
}

.cp-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.cp-section-card {
  border-radius: 16px;
}

.cp-badge-role-owner {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.cp-badge-role-admin {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
}

.cp-badge-role-editor {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
}

.cp-badge-role-viewer {
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
}

.cp-grid-cards {
  display: grid;
  gap: 1rem;
}

@media (min-width: 992px) {
  .cp-grid-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================
   APP LAYOUT
   ========================= */

:root {
  --cp-sidebar-width: 310px;
  --cp-sidebar-width-collapsed: 96px;
}

/* Layout */
.cp-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.cp-sidebar {
  width: var(--cp-sidebar-width);
  min-width: var(--cp-sidebar-width);
  max-width: var(--cp-sidebar-width);
  background: #13233b;
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: width 0.22s ease, min-width 0.22s ease, max-width 0.22s ease;
  overflow: visible;
  position: relative;
  z-index: 20;
}

.cp-main {
  flex: 1 1 auto;
  min-width: 0;
}

.cp-topbar {
  border-bottom: 1px solid #d9dee5;
  background: #fff;
}

.cp-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1rem 0.85rem;
}

.cp-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.cp-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 42px;
  text-decoration: none;
  flex: 1 1 auto;
}

.cp-sidebar-brand-logo {
  max-height: 42px;
  max-width: 150px;
  object-fit: contain;
}

.cp-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cp-sidebar-section-label {
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  padding: 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.cp-nav-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  width: 100%;
  padding: 0.8rem 0.7rem;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  border-radius: 0.85rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.cp-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.cp-nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.cp-nav-icon {
  width: 1.5rem;
  min-width: 1.5rem;
  text-align: center;
  font-size: 1rem;
}

.cp-nav-text {
  flex: 1 1 auto;
  text-align: left;
  white-space: nowrap;
}

.cp-nav-caret {
  font-size: 0.8rem;
  opacity: 0.85;
}

.cp-subnav {
  margin-left: 0.6rem;
  padding-left: 0.8rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 0.25rem;
}

.cp-subnav .cp-nav-link {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.cp-sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
}

.cp-sidebar-card {
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Popover submenu */
.cp-subnav-popover {
  display: none;
}

/* Collapsed */
html.cp-sidebar-collapsed .cp-sidebar {
  width: var(--cp-sidebar-width-collapsed);
  min-width: var(--cp-sidebar-width-collapsed);
  max-width: var(--cp-sidebar-width-collapsed);
}

html.cp-sidebar-collapsed .cp-sidebar-inner {
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

html.cp-sidebar-collapsed .cp-sidebar-brand {
  display: none;
}

html.cp-sidebar-collapsed .cp-sidebar-header {
  justify-content: center;
}

html.cp-sidebar-collapsed .cp-sidebar-section-label,
html.cp-sidebar-collapsed .cp-nav-text,
html.cp-sidebar-collapsed .cp-nav-caret,
html.cp-sidebar-collapsed .cp-sidebar-footer,
html.cp-sidebar-collapsed .cp-subnav,
html.cp-sidebar-collapsed .collapse {
  display: none !important;
}

html.cp-sidebar-collapsed .cp-nav-link {
  justify-content: center;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

html.cp-sidebar-collapsed .cp-nav-icon {
  margin: 0;
}

html.cp-sidebar-collapsed .cp-nav-group {
  position: relative;
}

html.cp-sidebar-collapsed .cp-nav-group.is-popover-open .cp-subnav-popover {
  display: block;
  position: absolute;
  left: calc(var(--cp-sidebar-width-collapsed) + 8px);
  top: 0;
  width: 260px;
  background: #13233b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.95rem;
  padding: 0.5rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  z-index: 100;
}

html.cp-sidebar-collapsed .cp-nav-group.is-popover-open .cp-subnav-popover .cp-nav-text {
  display: inline !important;
}

html.cp-sidebar-collapsed .cp-nav-group.is-popover-open .cp-subnav-popover .cp-nav-link {
  justify-content: flex-start;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* Responsive */
@media (max-width: 991.98px) {
  .cp-sidebar {
    width: var(--cp-sidebar-width);
    min-width: var(--cp-sidebar-width);
    max-width: var(--cp-sidebar-width);
  }

  html.cp-sidebar-collapsed .cp-sidebar {
    width: 0;
    min-width: 0;
    max-width: 0;
    border-right: 0;
  }
}
