.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

.app-shell.has-sidebar {
  flex-direction: row;
  --sidebar-w: 286px;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-w, 280px);
}

.sidebar {
  width: var(--sidebar-w, 280px);
  min-height: 100vh;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background:
    radial-gradient(circle at top, rgba(0, 209, 255, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 14%),
    linear-gradient(180deg, #173957 0%, #16344d 45%, #11283c 100%);
  color: #eef4f7;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 14px 14px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04), 14px 0 34px rgba(15, 23, 42, 0.08);
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 2px 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.sidebar-logo {
  width: 216px;
  max-width: 100%;
  height: 42px;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sidebar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-title strong {
  font-size: var(--text-md);
  letter-spacing: 0.04em;
}

.sidebar-title span {
  font-size: var(--text-xs);
  color: rgba(238, 244, 247, 0.7);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.sidebar-menu::-webkit-scrollbar {
  width: 8px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.sidebar-menu::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-section-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.58);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-section-header:hover {
  color: rgba(255, 255, 255, 0.84);
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.sidebar-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.56);
}

.sidebar-section-toggle {
  font-size: 12px;
  opacity: 0.72;
  transition: transform var(--transition-fast);
}

.sidebar-section.collapsed .sidebar-section-toggle {
  transform: rotate(-90deg);
}

.sidebar-section-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-section.collapsed .sidebar-section-body {
  display: none;
}

.menu-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.02);
  background: rgba(255, 255, 255, 0.02);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  min-width: 0;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.96);
  transform: translateX(2px);
}

.menu-item.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.09));
  border-color: rgba(0, 209, 255, 0.25);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 22px rgba(0, 0, 0, 0.14);
}

.menu-item.active::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: var(--accent-500);
}

.menu-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.menu-item-icon svg {
  width: 16px;
  height: 16px;
}

.menu-item-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.menu-item-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.menu-item-hint {
  font-size: 11px;
  color: rgba(238, 244, 247, 0.58);
  line-height: 1.25;
}

.menu-item.active .menu-item-icon {
  color: #061926;
  background: linear-gradient(180deg, #61e4ff, #1fc8ef);
  border-color: transparent;
}

.menu-item.active .menu-item-hint {
  color: rgba(255, 255, 255, 0.78);
}

.menu-item.is-disabled {
  color: rgba(238, 244, 247, 0.46);
  opacity: 1;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.018);
}

.menu-item.is-disabled:hover {
  background: rgba(255, 255, 255, 0.03);
  color: rgba(238, 244, 247, 0.5);
  transform: none;
}

.menu-item.is-disabled .menu-item-icon {
  color: rgba(238, 244, 247, 0.42);
  background: rgba(255, 255, 255, 0.04);
}

.menu-item-badge {
  margin-left: auto;
  align-self: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(238, 244, 247, 0.52);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.sidebar-footer {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
}

.sidebar-footer-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.48);
}

.sidebar-footer-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.sidebar-footer-subtitle {
  font-size: 11px;
  color: rgba(238, 244, 247, 0.62);
  line-height: 1.35;
}

.sidebar-footer-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 209, 255, 0.14);
  color: rgba(164, 244, 255, 0.96);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-item:focus-visible,
.sidebar-section-header:focus-visible {
  outline: 2px solid rgba(26, 60, 94, 0.6);
  outline-offset: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.topbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88)),
    radial-gradient(circle at top left, rgba(0, 209, 255, 0.08), transparent 32%);
  border-bottom: 1px solid rgba(202, 213, 226, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

@supports not (backdrop-filter: blur(10px)) {
  .topbar {
    background: #ffffff;
  }
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--gray-500);
  white-space: nowrap;
  line-height: 1;
}

.breadcrumb a {
  color: var(--brand-700);
  font-weight: var(--font-weight-semibold);
}

.breadcrumb span {
  color: rgba(71, 85, 105, 0.68);
}

.topbar-title {
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.pl-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.pl-dialog {
  width: min(100% - 32px, 440px);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
}

.pl-dialog-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-md);
  color: var(--color-text);
}

.pl-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.pl-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: grid;
  gap: 8px;
  z-index: 1000;
}

.pl-toast {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 10px 14px;
  font-size: var(--text-sm);
}

.pl-toast-info { border-color: rgba(26, 60, 94, 0.5); }
.pl-toast-success { border-color: rgba(22, 163, 74, 0.5); }
.pl-toast-warning { border-color: rgba(245, 158, 11, 0.6); }
.pl-toast-error { border-color: rgba(220, 38, 38, 0.6); }
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px 24px 24px;
  background:
    radial-gradient(circle at top left, rgba(0, 209, 255, 0.06), transparent 22%),
    linear-gradient(180deg, #f8fbfe 0%, #f3f7fb 100%);
}

.content-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94));
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
  overflow: hidden;
  padding: 20px;
}

.card:hover {
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.08);
}

.card-header {
  padding: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
  margin-bottom: 16px;
}

.card-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.card-title {
  font-size: 20px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  letter-spacing: -0.02em;
}

.card-subtitle {
  font-size: 13px;
  color: var(--gray-500);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-4);
  border-radius: 999px;
  border: 1px solid var(--color-border);
  font-weight: var(--font-weight-semibold);
  transition: box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  background: #ffffff;
  color: var(--brand-900);
  box-shadow: 0 0 0 transparent;
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 60, 94, 0.08);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.btn:hover {
  box-shadow: var(--shadow-sm);
}

.btn.is-disabled,
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.is-disabled:hover,
.btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary {
  background: var(--brand-900);
  color: #ffffff;
  border-color: transparent;
  box-shadow: none;
}

.btn-primary:hover {
  filter: brightness(0.95);
  box-shadow: none;
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:focus-visible {
  outline: 3px solid rgba(26, 60, 94, 0.45);
  outline-offset: 2px;
}

.btn-secondary {
  background: #ffffff;
  color: var(--brand-900);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: rgba(26, 60, 94, 0.04);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.08);
  color: #b91c1c;
  border-color: rgba(248, 113, 113, 0.5);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.16);
}

.btn-ghost {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-ghost:hover {
  background: rgba(26, 60, 94, 0.06);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input,
.select {
  height: 42px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.select-sm {
  height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
}

.input:focus,
.select:focus {
  border-color: rgba(26, 60, 94, 0.65);
  box-shadow: 0 0 0 3px rgba(26, 60, 94, 0.18);
  outline: none;
}

.input::placeholder {
  color: rgba(45, 52, 54, 0.45);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  background: rgba(26, 60, 94, 0.1);
  color: var(--color-base);
  border: 1px solid rgba(26, 60, 94, 0.18);
}

.chip-active {
  background: rgba(26, 60, 94, 0.2);
  color: var(--color-base);
  border-color: rgba(26, 60, 94, 0.6);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border);
}

.table th {
  background: rgba(26, 60, 94, 0.06);
  font-weight: var(--font-weight-semibold);
  color: var(--color-base);
}

.table tr:last-child td {
  border-bottom: none;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.breadcrumb a {
  color: var(--color-base);
  font-weight: var(--font-weight-medium);
}

.breadcrumb span {
  color: rgba(45, 52, 54, 0.4);
}

.stepper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(26, 60, 94, 0.08);
  color: var(--color-base);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  border: 1px solid rgba(26, 60, 94, 0.16);
}

.step--active {
  background: rgba(26, 60, 94, 0.2);
  border-color: rgba(26, 60, 94, 0.6);
  color: var(--color-base);
}

.step--done {
  background: rgba(26, 60, 94, 0.12);
  border-color: rgba(26, 60, 94, 0.3);
  color: var(--color-base);
}

@media (max-width: 960px) {
  .app-shell.has-sidebar {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    height: auto;
    position: static;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
  }

  .content {
    padding: 14px;
  }

  .sidebar-menu {
    max-height: none;
  }
}
