:root {
  --bg-ink: #101723;
  --bg-ink-soft: #182437;
  --bg-paper: #f4efe6;
  --bg-paper-soft: #fbf8f1;
  --panel: rgba(251, 248, 241, 0.86);
  --panel-strong: #fffdf8;
  --panel-dark: rgba(17, 24, 37, 0.9);
  --border: rgba(42, 54, 75, 0.12);
  --border-strong: rgba(42, 54, 75, 0.2);
  --text: #182233;
  --muted: #66748a;
  --accent: #946c2d;
  --accent-strong: #bf8a3e;
  --accent-soft: rgba(191, 138, 62, 0.12);
  --online: #1f7a4d;
  --pending: #a06510;
  --danger: #b04432;
  --shadow-soft: 0 16px 44px rgba(16, 23, 35, 0.08);
  --shadow-strong: 0 22px 80px rgba(16, 23, 35, 0.16);
  --radius-xl: 28px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-body: "IBM Plex Sans", "Microsoft YaHei", sans-serif;
  --font-display: "Fraunces", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg-paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(191, 138, 62, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(24, 36, 55, 0.12), transparent 30%),
    linear-gradient(180deg, #f2ebdf 0%, #e2d7c7 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 88px,
      rgba(24, 36, 55, 0.04) 88px,
      rgba(24, 36, 55, 0.04) 89px
    );
  opacity: 0.78;
}

.ambient-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(16, 23, 35, 0.05) 0.5px, transparent 0.5px),
    radial-gradient(rgba(16, 23, 35, 0.03) 0.5px, transparent 0.5px);
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
  opacity: 0.34;
}

button,
input,
select,
textarea,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

code {
  font-family: Consolas, "Courier New", monospace;
}

.portal-body,
.console-body {
  position: relative;
}

.nav-shell,
.admin-main {
  position: relative;
  z-index: 1;
}

.nav-shell {
  max-width: 1420px;
  margin: 0 auto;
  padding: 28px;
}

.nav-shell.auth-mode {
  max-width: 760px;
  padding-top: 72px;
}

.nav-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar,
.category-card,
.page-header {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.brand-mark::after,
.toolbar::after,
.category-card::after,
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand-mark {
  position: relative;
  overflow: visible;
  z-index: 6;
  display: grid;
  grid-template-columns: minmax(230px, auto) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 18px;
  flex: 1 1 100%;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.brand-mark::before {
  display: none;
}

.brand-mark::after,
.toolbar::after {
  display: none;
}

.brand-copy {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  flex: 0 1 auto;
  justify-self: start;
}

.space-control-row {
  display: inline-flex;
  align-items: end;
  gap: 14px;
  min-width: 0;
  flex-wrap: wrap;
}

.micro-label,
.section-kicker,
.overline {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-mark .micro-label {
  color: rgba(98, 110, 129, 0.68);
}

.brand-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.workspace-meta-cluster {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-width: 0;
}

.brand-actions .ghost-button,
.brand-actions .soft-chip {
  min-height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: rgba(69, 80, 100, 0.88);
}

.brand-actions .ghost-button:hover,
.brand-actions .soft-chip:hover {
  background: rgba(16, 23, 35, 0.05);
  color: var(--text);
}

.brand-actions .compact-button {
  min-width: 0;
}

.space-switcher {
  position: relative;
  width: auto;
  min-width: 0;
  max-width: 320px;
  z-index: 7;
}

.department-switcher {
  display: inline-grid;
  gap: 6px;
  min-width: 180px;
}

.department-switcher.hidden {
  display: none;
}

.department-select {
  min-width: 180px;
}

.workspace-stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

.workspace-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  text-align: left;
}

.workspace-stat-label {
  color: rgba(98, 110, 129, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workspace-stat strong {
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
}

.space-toggle,
.search-input,
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  border: 1px solid var(--border);
  outline: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.space-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: 0;
  min-height: 34px;
  padding: 0 18px 4px 0;
  border: none;
  border-bottom: 1px solid rgba(42, 54, 75, 0.14);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.space-toggle:hover:not(:disabled) {
  transform: none;
  border-bottom-color: rgba(148, 108, 45, 0.34);
  background: transparent;
}

.space-toggle:focus {
  border-bottom-color: rgba(148, 108, 45, 0.46);
  box-shadow: none;
}

.space-toggle:disabled {
  color: rgba(70, 82, 102, 0.56);
}

.space-toggle-copy,
.space-toggle-trailing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.space-toggle-trailing {
  justify-content: flex-end;
}

.space-current-name {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.space-current-hint {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(98, 110, 129, 0.74);
  font-size: 0.78rem;
}

.space-toggle-icon {
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(98, 110, 129, 0.76);
  border-bottom: 2px solid rgba(98, 110, 129, 0.76);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.space-switcher.open .space-toggle-icon {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.space-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 280px;
  max-width: 360px;
  z-index: 12;
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 252, 246, 0.96);
  border: 1px solid rgba(42, 54, 75, 0.1);
  box-shadow: 0 20px 44px rgba(16, 23, 35, 0.12);
  backdrop-filter: blur(14px);
}

.space-option {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.space-option:hover {
  background: rgba(16, 23, 35, 0.04);
  border-color: rgba(42, 54, 75, 0.08);
}

.space-option.active {
  background: linear-gradient(180deg, rgba(191, 138, 62, 0.14), rgba(191, 138, 62, 0.06));
  border-color: rgba(191, 138, 62, 0.24);
}

.space-option-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.space-option-copy strong,
.space-option-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.space-option-copy strong {
  font-size: 0.92rem;
  font-weight: 600;
}

.space-option-copy span,
.space-menu-empty {
  color: rgba(98, 110, 129, 0.86);
  font-size: 0.78rem;
}

.space-menu-empty {
  padding: 12px 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 0 1 auto;
  padding: 0;
  flex-wrap: nowrap;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  justify-self: center;
  min-width: min(100%, 420px);
}

.search-input-shell {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(98, 110, 129, 0.5);
  pointer-events: none;
  transition: opacity 200ms ease;
}

.search-input-shell:focus-within .search-icon {
  opacity: 0;
}

.search-input {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  padding: 0 0 4px 24px;
  border: none;
  border-bottom: 1px solid rgba(42, 54, 75, 0.14);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.toolbar-select {
  min-width: 132px;
  min-height: 34px;
  padding: 0 20px 4px 0;
  border: none;
  border-bottom: 1px solid rgba(42, 54, 75, 0.14);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.search-input:focus,
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: rgba(148, 108, 45, 0.5);
  box-shadow: none;
  transform: none;
}

.account-menu-shell {
  position: relative;
}

.account-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 0 4px;
  border: none;
  border-bottom: 1px solid rgba(42, 54, 75, 0.14);
  background: transparent;
  color: var(--text);
}

.account-menu-name {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 12;
  width: 250px;
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 252, 246, 0.98);
  border: 1px solid rgba(42, 54, 75, 0.1);
  box-shadow: 0 20px 44px rgba(16, 23, 35, 0.12);
  backdrop-filter: blur(14px);
}

.account-menu-link,
.account-menu-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.account-menu-link:hover,
.account-menu-action:hover {
  background: rgba(16, 23, 35, 0.04);
  border-color: rgba(42, 54, 75, 0.08);
}

.account-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.danger-action {
  color: var(--danger);
}

.mini-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mini-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mini-switch-text {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(98, 110, 129, 0.9);
}

.mini-switch-track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(16, 23, 35, 0.12);
  border: 1px solid rgba(42, 54, 75, 0.1);
  transition: background 160ms ease, border-color 160ms ease;
}

.mini-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(16, 23, 35, 0.18);
  transition: transform 160ms ease;
}

.mini-switch input:checked + .mini-switch-track {
  background: rgba(148, 108, 45, 0.22);
  border-color: rgba(148, 108, 45, 0.22);
}

.mini-switch input:checked + .mini-switch-track::after {
  transform: translateX(18px);
}

.password-field-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field-shell input {
  padding-right: 42px;
}

.password-visibility-button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(98, 110, 129, 0.92);
}

.password-visibility-button:hover {
  background: rgba(16, 23, 35, 0.06);
  color: var(--text);
}

.password-visibility-button .eye-icon {
  pointer-events: none;
}

.portal-main,
.portal-panel,
.main-stage,
.console-content {
  display: grid;
  gap: 18px;
}

.summary-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.summary-tile {
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.94), rgba(244, 239, 230, 0.82));
  border: 1px solid rgba(42, 54, 75, 0.08);
  box-shadow: var(--shadow-soft);
}

.summary-tile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent-strong), rgba(191, 138, 62, 0.18));
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-tile strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  font-weight: 600;
  color: var(--bg-ink);
}

.sections-grid {
  display: grid;
  gap: 12px;
}

.category-card {
  padding: 12px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 246, 238, 0.94));
  border: 1px solid rgba(42, 54, 75, 0.08);
  box-shadow:
    0 10px 26px rgba(16, 23, 35, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.category-card::before {
  display: none;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.category-heading {
  display: grid;
  gap: 2px;
}

.category-title,
.panel-heading h3,
.page-header h2,
.console-brand h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.category-title {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0;
}

.category-count,
.helper-text {
  color: var(--muted);
}

.category-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(16, 23, 35, 0.05);
  border: 1px solid rgba(42, 54, 75, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.app-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 12px;
}

.app-card-link {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px;
  min-height: 188px;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(249, 244, 236, 0.88));
  border: 1px solid rgba(42, 54, 75, 0.08);
  box-shadow: 0 14px 36px rgba(16, 23, 35, 0.06);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.app-card-media {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-md) - 6px);
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, rgba(255, 214, 153, 0.34), rgba(177, 197, 255, 0.35));
  border: 1px solid rgba(42, 54, 75, 0.08);
}

.app-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-card-body {
  display: grid;
  gap: 8px;
}

.app-card-link:hover {
  transform: translateY(-4px);
  border-color: rgba(148, 108, 45, 0.24);
  box-shadow: 0 20px 46px rgba(16, 23, 35, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(250, 245, 236, 0.96));
}

.app-card-link[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 252, 246, 0.92);
  border: 1px solid rgba(42, 54, 75, 0.08);
  box-shadow: 0 18px 34px rgba(16, 23, 35, 0.12);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.5;
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.app-card-link[data-tooltip]:hover::after,
.app-card-link[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.catalog-card[data-tooltip] {
  position: relative;
}

.catalog-card[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 78px;
  z-index: 2;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 252, 246, 0.92);
  border: 1px solid rgba(42, 54, 75, 0.08);
  box-shadow: 0 18px 34px rgba(16, 23, 35, 0.12);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.5;
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.catalog-card[data-tooltip]:hover::after,
.catalog-card[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.app-card-top,
.catalog-card-top,
.catalog-footer,
.page-header,
.panel-heading-split {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.app-card-top {
  align-items: flex-start;
}

.app-sop-btn {
  margin-left: auto;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  background: rgba(148, 108, 45, 0.08);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(148, 108, 45, 0.15);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  user-select: none;
}

.app-sop-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(148, 108, 45, 0.25);
}

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

.app-sequence {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(16, 23, 35, 0.06);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.app-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.app-desc,
.catalog-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.portal-subsection {
  position: relative;
  display: grid;
  gap: 16px;
  margin-bottom: 28px;
  padding: 18px 20px 20px;
  border-radius: calc(var(--radius-lg) + 2px);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: 0 18px 44px rgba(16, 23, 35, 0.05);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.portal-subsection::before {
  display: none;
}

.portal-subsection-featured {
  background:
    radial-gradient(circle at top right, rgba(191, 138, 62, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(255, 248, 236, 0.98), rgba(244, 231, 209, 0.94));
  border-color: rgba(191, 138, 62, 0.2);
  box-shadow:
    0 18px 42px rgba(120, 85, 26, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.portal-subsection-personal {
  background:
    radial-gradient(circle at top right, rgba(83, 127, 255, 0.15), transparent 34%),
    linear-gradient(180deg, rgba(244, 248, 255, 0.98), rgba(228, 238, 255, 0.94));
  border-color: rgba(83, 127, 255, 0.16);
  box-shadow:
    0 18px 42px rgba(56, 87, 162, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.portal-subsection-directory {
  background:
    radial-gradient(circle at top right, rgba(24, 36, 55, 0.07), transparent 38%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(239, 232, 220, 0.96));
  border-color: rgba(42, 54, 75, 0.14);
  box-shadow:
    0 20px 48px rgba(16, 23, 35, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.portal-subsection .section-kicker {
  padding: 0 0 6px;
  border-bottom: 1px solid rgba(42, 54, 75, 0.08);
}

.portal-subsection-featured .section-kicker {
  color: rgba(134, 95, 33, 0.92);
  border-bottom-color: rgba(191, 138, 62, 0.14);
}

.portal-subsection-personal .section-kicker {
  color: rgba(53, 87, 180, 0.92);
  border-bottom-color: rgba(83, 127, 255, 0.14);
}

.portal-subsection-directory .section-kicker {
  color: rgba(72, 83, 104, 0.9);
  border-bottom-color: rgba(42, 54, 75, 0.12);
}

.portal-subsection-featured .subsection-heading h3 {
  color: #5f4314;
}

.portal-subsection-personal .subsection-heading h3 {
  color: #304b8f;
}

.portal-subsection-directory .subsection-heading h3 {
  color: #202b3f;
}

.subsection-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 2px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.spotlight-card-link {
  min-height: 0;
}

.portal-subsection-featured .spotlight-strip {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.portal-subsection-featured .compact-spotlight-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 243, 230, 0.92));
  border-color: rgba(191, 138, 62, 0.18);
  box-shadow: 0 16px 34px rgba(120, 85, 26, 0.08);
}

.portal-subsection-featured .compact-spotlight-card .app-card-body {
  align-content: start;
}

.portal-subsection-featured .compact-spotlight-card .app-card-media {
  border-color: rgba(191, 138, 62, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.compact-empty-state {
  min-height: 72px;
  padding: 18px 20px;
}

.app-meta,
.tag-row,
.badge-row,
.toolbar-actions,
.form-actions,
.admin-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.app-badge,
.soft-chip,
.tag,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.app-badge,
.soft-chip,
.tag {
  border: 1px solid rgba(42, 54, 75, 0.1);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

.app-badge.subtle {
  background: rgba(16, 23, 35, 0.04);
}

.app-card-link .app-badge.subtle,
.spotlight-card-link .app-badge.subtle {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.74rem;
}

.owner-badge {
  background: rgba(176, 68, 50, 0.12);
  border: 1px solid rgba(176, 68, 50, 0.16);
  color: var(--danger);
  font-weight: 700;
}

.featured-pill {
  background: rgba(191, 138, 62, 0.14);
  border: 1px solid rgba(191, 138, 62, 0.2);
  color: var(--accent-ink);
  font-weight: 700;
}

.app-badge.online,
.status-badge.online {
  background: rgba(31, 122, 77, 0.12);
  color: var(--online);
  border: 1px solid rgba(31, 122, 77, 0.16);
}

.app-badge.pending,
.status-badge.pending {
  background: rgba(160, 101, 16, 0.12);
  color: var(--pending);
  border: 1px solid rgba(160, 101, 16, 0.16);
}

.status-badge {
  min-height: 32px;
}

.empty-state {
  padding: 28px 22px;
  text-align: center;
  border-radius: var(--radius-md);
  background: rgba(255, 252, 246, 0.88);
  border: 1px dashed rgba(42, 54, 75, 0.14);
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  padding: 28px;
}

.admin-main {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.console-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 20px;
}

.console-sidebar {
  position: sticky;
  top: 28px;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-xl);
  color: #f8f4ea;
  background:
    linear-gradient(180deg, rgba(16, 23, 35, 0.96), rgba(24, 36, 55, 0.92));
  box-shadow: var(--shadow-strong);
}

.console-brand-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-toggle-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.sidebar-toggle-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-toggle-button span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: #fff9ef;
}

.console-sidebar::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--radius-xl) - 10px);
  pointer-events: none;
}

.console-brand {
  display: grid;
  gap: 10px;
}

.console-brand h2 {
  font-size: 1.7rem;
  color: #fff9ef;
}

.console-brand .helper-text {
  color: rgba(248, 242, 228, 0.66);
  font-size: 0.84rem;
}

.console-menu {
  display: grid;
  gap: 8px;
}

.console-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.console-menu-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.console-menu-item.active {
  background: linear-gradient(180deg, rgba(191, 138, 62, 0.22), rgba(191, 138, 62, 0.08));
  border-color: rgba(191, 138, 62, 0.36);
}

.menu-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 242, 228, 0.74);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
}

.console-sidebar-footer {
  display: grid;
  gap: 8px;
}

.console-sidebar .soft-chip,
.console-sidebar .ghost-button {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff9ef;
}

.console-sidebar .ghost-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.console-layout.sidebar-collapsed {
  grid-template-columns: 96px minmax(0, 1fr);
}

.console-layout.sidebar-collapsed .console-sidebar {
  padding: 18px 12px;
}

.console-layout.sidebar-collapsed .console-brand-top {
  justify-content: center;
}

.console-layout.sidebar-collapsed .console-brand .micro-label,
.console-layout.sidebar-collapsed .console-brand h2,
.console-layout.sidebar-collapsed .console-brand .helper-text,
.console-layout.sidebar-collapsed .console-menu-item span:not(.menu-index),
.console-layout.sidebar-collapsed .console-sidebar .soft-chip,
.console-layout.sidebar-collapsed .console-sidebar .ghost-button:not(.compact-button):not(#languageToggle) {
  display: none;
}

.console-layout.sidebar-collapsed .console-menu-item {
  justify-content: center;
  padding: 0;
}

.console-layout.sidebar-collapsed .console-sidebar-footer {
  justify-items: center;
}

.console-layout.sidebar-collapsed .compact-button {
  min-width: 52px;
  padding: 0 10px;
}

.console-layout.sidebar-collapsed .sidebar-toggle-button {
  justify-self: center;
}

.page-header,
.panel {
  min-width: 0;
  padding: 24px;
}

.panel-heading {
  margin-bottom: 16px;
}

.page-header h2 {
  font-size: 2rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.06fr) minmax(360px, 0.94fr);
  gap: 22px;
}

[data-view-panel="users"] .content-grid {
  grid-template-columns: minmax(0, 1fr);
}

.content-grid > * {
  min-width: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.single-column {
  grid-template-columns: 1fr;
}

.form-field {
  display: grid;
  gap: 8px;
}

.field-label,
.title-with-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.form-field span {
  font-size: 0.9rem;
  font-weight: 600;
}

.info-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(42, 54, 75, 0.16);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  cursor: default;
}

.info-dot::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%) translateY(-6px);
  width: max-content;
  max-width: min(320px, 70vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(16, 23, 35, 0.94);
  color: #fff9ef;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: normal;
  white-space: normal;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  box-shadow: 0 18px 38px rgba(16, 23, 35, 0.18);
  z-index: 20;
}

.info-dot:hover::after,
.info-dot:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.form-field textarea {
  min-height: 116px;
  padding: 14px 16px;
  resize: vertical;
}

.form-field input,
.form-field select {
  min-height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
}

.form-field-wide {
  grid-column: 1 / -1;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.action-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.action-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.action-button {
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  color: #fff7eb;
  box-shadow: 0 12px 24px rgba(191, 138, 62, 0.18);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  border-color: rgba(42, 54, 75, 0.08);
}

.compact-button {
  min-height: 42px;
  padding: 0 16px;
}

.ghost-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.admin-app-list {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.catalog-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 241, 231, 0.86));
  border: 1px solid rgba(42, 54, 75, 0.08);
  box-shadow: 0 14px 34px rgba(16, 23, 35, 0.06);
  min-width: 0;
}

.catalog-card-top,
.catalog-footer {
  min-width: 0;
  align-items: flex-start;
}

.catalog-card-top > div,
.catalog-footer > div,
.catalog-footer > span {
  min-width: 0;
}

.catalog-name {
  font-weight: 700;
  line-height: 1.4;
}

.catalog-meta,
.catalog-owner {
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-owner {
  flex: 1 1 auto;
}

.danger-button {
  color: var(--danger);
}

.auth-panel {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

.auth-elevated {
  margin-top: 32px;
}

.nav-shell.auth-mode .brand-mark {
  display: none;
}

.nav-shell.auth-mode .nav-header {
  margin-bottom: 0;
}

.nav-shell.auth-mode .compact-button {
  min-width: 84px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(42, 54, 75, 0.12);
  box-shadow: 0 12px 30px rgba(16, 23, 35, 0.08);
  color: var(--text);
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.department-company-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(42, 54, 75, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.department-company-heading {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.department-company-list {
  display: grid;
  gap: 8px;
}

.department-option {
  align-items: flex-start;
}

.department-option strong {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.department-default-chip {
  min-height: 22px;
  padding-inline: 8px;
  font-size: 0.68rem;
}

.permission-toolbar,
.chip-row,
.inline-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.permission-toolbar {
  margin-bottom: 12px;
}

.permission-toolbar input,
.permission-toolbar select {
  min-width: 180px;
  flex: 1 1 180px;
}

.permission-browser {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.permission-category-nav {
  display: grid;
  gap: 10px;
  align-content: start;
  max-height: 460px;
  overflow: auto;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(42, 54, 75, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(250, 246, 239, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.permission-company-pill {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(16, 23, 35, 0.04);
  color: var(--text);
  text-align: left;
  white-space: normal;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.permission-company-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 108, 45, 0.18);
}

.permission-company-pill.active {
  background: rgba(191, 138, 62, 0.12);
  border-color: rgba(191, 138, 62, 0.28);
  color: var(--accent);
}

.permission-company-pill-name {
  min-width: 0;
  flex: 1 1 auto;
  font-weight: 600;
  line-height: 1.25;
}

.permission-company-pill-meta {
  flex: 0 0 auto;
  padding: 0 8px;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(16, 23, 35, 0.06);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 24px;
}

.permission-browser-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(42, 54, 75, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(250, 246, 239, 0.98));
}

.permission-browser-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 2px;
  background: linear-gradient(180deg, rgba(251, 248, 241, 0.98), rgba(251, 248, 241, 0.72), rgba(251, 248, 241, 0));
}

.permission-master-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(42, 54, 75, 0.1);
  background: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.permission-master-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
}

.permission-master-toggle span {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.permission-browser-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.permission-browser-title strong {
  color: var(--text);
  font-size: 0.94rem;
}

.permission-company-section {
  display: grid;
  gap: 10px;
}

.permission-company-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(244, 239, 230, 0.95);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.permission-company-list {
  display: grid;
  gap: 10px;
}

.permission-company-list-browser {
  max-height: none;
}

.chip-row {
  margin-top: 10px;
}

.taxonomy-chip {
  min-width: auto;
}

.inline-summary {
  margin-bottom: 12px;
}

.permission-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(42, 54, 75, 0.08);
  background: rgba(255, 255, 255, 0.86);
}

.permission-option input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.permission-option > span {
  min-width: 0;
}

.permission-option strong,
.permission-option span > span {
  display: block;
}

.permission-option span > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.permission-empty-company-nav,
.permission-empty-state {
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed rgba(42, 54, 75, 0.14);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.42);
}

.readonly-option {
  background: rgba(248, 250, 252, 0.9);
}

.app-management-shell {
  display: grid;
  gap: 20px;
}

.company-management-shell {
  display: grid;
  gap: 18px;
  align-items: start;
}

.company-list-workbench,
.department-list-workbench {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(42, 54, 75, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 241, 232, 0.92));
  box-shadow: 0 16px 36px rgba(16, 23, 35, 0.05);
}

.company-list-workbench {
  min-width: 0;
}

.department-list {
  display: grid;
  gap: 10px;
  max-height: 480px;
  overflow: auto;
  padding-right: 4px;
}

.department-row {
  grid-template-columns: 78px minmax(160px, 1.2fr) 92px 92px 92px 122px;
  min-width: 720px;
}

.department-row .list-row-main strong {
  font-size: 1rem;
  line-height: 1.35;
}

.department-row .list-row-description {
  font-size: 0.88rem;
}

.department-workbench {
  display: grid;
  gap: 18px;
}

.department-workbench-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(42, 54, 75, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 241, 232, 0.92));
  box-shadow: 0 16px 36px rgba(16, 23, 35, 0.05);
}

.department-workbench-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.app-management-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 242, 232, 0.9));
  border: 1px solid rgba(42, 54, 75, 0.08);
  box-shadow: 0 16px 36px rgba(16, 23, 35, 0.05);
}

.app-management-header {
  align-items: center;
}

.app-management-header .section-kicker {
  color: rgba(102, 116, 138, 0.88);
}

.app-management-header h3 {
  font-size: clamp(1.56rem, 2.4vw, 2rem);
}

.app-management-toolbar-compact .form-field {
  margin: 0;
}

.app-management-toolbar-compact .form-field span {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-management-toolbar-compact .form-field select {
  min-width: 260px;
  min-height: 54px;
  background: rgba(255, 255, 255, 0.98);
}

.app-management-inline-note {
  margin-left: auto;
  font-size: 0.92rem;
}

.app-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.app-toolbar-actions .ghost-button {
  border-color: rgba(42, 54, 75, 0.1);
  background: rgba(255, 255, 255, 0.9);
}

.app-toolbar-actions .ghost-button:hover {
  border-color: rgba(42, 54, 75, 0.16);
  background: rgba(255, 255, 255, 1);
}

.app-toolbar-actions .action-button {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #b9893a, #8b6327);
  box-shadow: 0 14px 24px rgba(148, 108, 45, 0.2);
}

.app-toolbar-actions .action-button:hover {
  background: linear-gradient(135deg, #c59646, #7f5920);
}

.app-company-filter-field {
  min-width: 220px;
  margin: 0;
}

.app-sortable-list,
.app-management-list {
  display: grid;
  gap: 22px;
}

.sortable-card {
  cursor: grab;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.sortable-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(16, 23, 35, 0.08);
}

.sortable-card.dragging {
  opacity: 0.64;
  cursor: grabbing;
}

.sortable-card.drag-over {
  border-color: rgba(191, 138, 62, 0.42);
  box-shadow: 0 0 0 2px rgba(191, 138, 62, 0.16);
}

.app-category-group {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(246, 240, 231, 0.9));
  border: 1px solid rgba(42, 54, 75, 0.08);
  box-shadow: 0 16px 40px rgba(16, 23, 35, 0.05);
}

.app-category-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.app-category-group-copy {
  display: grid;
  gap: 4px;
}

.app-category-group-kicker {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(102, 116, 138, 0.74);
}

.app-category-group-copy h4 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: rgba(24, 34, 51, 0.9);
}

.app-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 16px;
  min-height: 80px;
  padding: 2px;
  border-radius: 22px;
}

.app-category-grid.group-drag-over {
  background: rgba(191, 138, 62, 0.08);
  box-shadow: inset 0 0 0 1px rgba(191, 138, 62, 0.22);
}

.compact-app-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 244px;
  padding: 12px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 244, 236, 0.94));
  border: 1px solid rgba(42, 54, 75, 0.08);
  box-shadow: 0 16px 34px rgba(16, 23, 35, 0.06);
}

.compact-app-card::before {
  display: none;
}

.compact-app-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.compact-app-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 108, 45, 0.16);
  background: rgba(16, 23, 35, 0.04);
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
}

.compact-app-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.compact-app-thumb-shell {
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(42, 54, 75, 0.08);
  box-shadow: 0 14px 28px rgba(16, 23, 35, 0.08);
}

.compact-app-thumb-shell-tile {
  aspect-ratio: 1 / 1;
}

.compact-app-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compact-app-main-tile .catalog-name {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.38;
}

.compact-app-owner {
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.3;
}

.compact-tag-row {
  gap: 8px;
  min-height: 34px;
}

.compact-app-actions {
  justify-content: flex-end;
}

.compact-app-hoverbar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  border: none;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.compact-app-card:hover .compact-app-hoverbar,
.compact-app-card:focus-within .compact-app-hoverbar {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.compact-app-actions-text {
  width: 100%;
  justify-content: flex-end;
  gap: 16px;
}

.department-multiselect {
  min-height: 164px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(42, 54, 75, 0.12);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
}

.department-multiselect:disabled {
  color: rgba(98, 110, 129, 0.76);
  background: rgba(245, 240, 232, 0.72);
}

.text-action-button {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: none;
}

.text-action-button:hover {
  color: var(--accent);
  transform: none;
}

.danger-text-action {
  color: var(--danger);
}

.tag-selector-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.app-image-editor {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.app-image-preview-shell {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(42, 54, 75, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 240, 231, 0.92));
}

.app-image-preview {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.app-image-controls {
  display: grid;
  gap: 12px;
  align-content: start;
}

.upload-trigger-button {
  justify-content: center;
  min-height: 44px;
  border-style: dashed;
}

.compact-helper {
  margin: 0;
}

.selected-tags {
  min-height: 34px;
}

.selected-tag-chip {
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 23, 35, 0.42);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: rgba(255, 252, 246, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.48);
  box-shadow: var(--shadow-strong);
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-card .form-grid {
  gap: 16px;
}

#companyForm,
#departmentForm,
#userForm {
  padding: 24px 28px 28px;
}

.modal-inline-hint {
  margin: 0;
  padding: 14px 28px 0;
  color: #8b5e1d;
  font-size: 0.92rem;
  line-height: 1.55;
}

.modal-card-editor,
.taxonomy-modal-card {
  padding: 0;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(249, 243, 234, 0.98));
  border-color: rgba(255, 255, 255, 0.6);
}

.modal-header-editor {
  margin: 0;
  padding: 24px 28px 22px;
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(28, 38, 58, 0.92));
  color: #f8fbff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header-editor .section-kicker {
  color: rgba(214, 228, 255, 0.7);
}

.modal-header-editor h3 {
  margin: 6px 0 0;
  font-size: 1.6rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.modal-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5f8ff;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.modal-close-button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
}

.editor-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.34fr) minmax(280px, 0.86fr);
  gap: 22px;
  padding: 24px 28px 28px;
  align-items: start;
}

.editor-main,
.editor-side {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.editor-section,
.editor-side-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(28, 38, 58, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 241, 233, 0.92));
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
}

.editor-section-head,
.editor-side-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.editor-section-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.08));
  border: 1px solid rgba(59, 130, 246, 0.16);
  color: #2456b8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.editor-section-grid {
  gap: 16px;
}

.modal-card-editor .form-field {
  gap: 10px;
}

.modal-card-editor .form-field > span,
.modal-card-editor .field-label {
  color: #5f6980;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.modal-card-editor .form-field input,
.modal-card-editor .form-field select,
.modal-card-editor .form-field textarea,
.taxonomy-modal-card input {
  font-size: 0.96rem;
  border-color: rgba(120, 138, 166, 0.22);
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    0 8px 18px rgba(15, 23, 42, 0.03);
}

.modal-card-editor .form-field input:focus,
.modal-card-editor .form-field select:focus,
.modal-card-editor .form-field textarea:focus,
.taxonomy-modal-card input:focus {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.12),
    0 10px 24px rgba(37, 99, 235, 0.08);
  background: #ffffff;
}

.modal-card-editor .form-field textarea {
  min-height: 110px;
}

.editor-side .app-image-editor {
  grid-template-columns: 1fr;
  gap: 14px;
}

.editor-side .app-image-preview-shell {
  border-radius: 20px;
  border-color: rgba(37, 99, 235, 0.14);
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 246, 255, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.editor-side .app-image-controls {
  gap: 10px;
}

.upload-trigger-button {
  justify-content: center;
  min-height: 46px;
  border-style: dashed;
  border-color: rgba(37, 99, 235, 0.24);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.88), rgba(224, 242, 254, 0.72));
  color: #2456b8;
}

.upload-trigger-button:hover {
  border-color: rgba(37, 99, 235, 0.34);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(219, 234, 254, 0.84));
}

.compact-helper {
  margin: 0;
  color: #6d7890;
}

.compact-checkbox {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(28, 38, 58, 0.08);
  background: rgba(248, 250, 255, 0.86);
}

.tag-selector-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.selected-tags {
  min-height: 42px;
  padding-top: 2px;
}

.selected-tag-chip {
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.16);
  color: #214c99;
}

.editor-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 2px;
  padding-top: 18px;
  border-top: 1px solid rgba(28, 38, 58, 0.08);
}

.modal-card-editor .action-button,
.taxonomy-modal-card .action-button {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.22);
}

.modal-card-editor .action-button:hover,
.taxonomy-modal-card .action-button:hover {
  box-shadow: 0 20px 36px rgba(37, 99, 235, 0.28);
}

.modal-card-editor .ghost-button,
.taxonomy-modal-card .ghost-button {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(28, 38, 58, 0.1);
}

.department-modal-card {
  width: min(860px, calc(100vw - 32px));
}

.modal-card select[multiple] {
  min-height: 220px;
}

.taxonomy-modal-card {
  width: min(720px, calc(100vw - 32px));
}

.taxonomy-modal-shell {
  display: grid;
  gap: 18px;
  padding: 22px 28px 28px;
}

.taxonomy-tab-row {
  display: inline-flex;
  gap: 10px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(227, 234, 246, 0.72);
  width: fit-content;
}

.taxonomy-tab-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.taxonomy-tab-button.active {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(37, 99, 235, 0.16);
  color: #2456b8;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.taxonomy-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.taxonomy-list {
  display: grid;
  gap: 12px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.taxonomy-item-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(28, 38, 58, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 255, 0.88));
  box-shadow: 0 10px 26px rgba(16, 23, 35, 0.05);
}

.taxonomy-item-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.taxonomy-item-title {
  font-weight: 700;
  color: var(--text);
}

.taxonomy-item-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.taxonomy-inline-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(42, 54, 75, 0.12);
  background: rgba(255, 255, 255, 0.96);
  font: inherit;
  color: var(--text);
}

.taxonomy-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2000;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(16, 23, 35, 0.92);
  color: #fff9ef;
  box-shadow: var(--shadow-strong);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1240px) {
  .featured-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .nav-header,
  .console-layout,
  .content-grid,
  .form-grid,
  .permission-grid,
  .summary-board {
    grid-template-columns: 1fr;
  }

  .brand-mark,
  .toolbar,
  .category-header,
  .panel-heading-split,
  .compact-app-header,
  .compact-app-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-mark {
    grid-template-columns: 1fr;
  }

  .workspace-stats {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .console-sidebar {
    position: static;
  }

  .console-layout.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .space-switcher {
    width: 100%;
  }

  .featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-select,
  .app-company-filter-field {
    min-width: 100%;
  }

  .app-management-toolbar {
    align-items: stretch;
  }

  .app-management-inline-note {
    margin-left: 0;
  }

  .app-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .company-management-shell {
    grid-template-columns: 1fr;
  }

  .app-image-editor {
    grid-template-columns: 1fr;
  }

  .permission-browser {
    grid-template-columns: 1fr;
  }

  .permission-category-nav,
  .permission-browser-list {
    max-height: none;
  }

  .editor-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-shell,
  .app-shell {
    padding: 16px;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .brand-actions,
  .toolbar-actions,
  .inline-actions,
  .form-actions,
  .app-toolbar-actions {
    width: 100%;
  }

  .workspace-stats {
    width: 100%;
    justify-content: stretch;
  }

  .workspace-stat {
    flex: 1 1 0;
    min-width: 0;
  }

  .brand-actions > *,
  .toolbar-actions > *,
  .inline-actions > *,
  .form-actions > *,
  .app-toolbar-actions > * {
    width: 100%;
  }

  .brand-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .space-toggle {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .space-toggle-trailing {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-items: start;
    align-items: center;
  }

  .space-current-hint {
    max-width: 100%;
  }

  .catalog-footer {
    flex-direction: column;
  }

  .app-category-grid {
    grid-template-columns: 1fr;
  }

  .compact-app-hoverbar {
    position: static;
    margin-top: 6px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .compact-app-hoverbar,
  .compact-app-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .modal-overlay {
    padding: 14px;
  }

  .modal-header-editor,
  .editor-shell,
  .taxonomy-modal-shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  .editor-actions {
    justify-content: stretch;
  }
}
.panel {
  position: relative;
  overflow: visible;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.spotlight-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.compact-spotlight-card {
  min-height: 0;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  padding: 12px;
  gap: 12px;
}

.compact-spotlight-card .app-name {
  font-size: 1rem;
}

.compact-spotlight-card .app-card-media {
  aspect-ratio: 1 / 1;
}

.compact-spotlight-card .app-card-body {
  align-content: center;
}

.compact-spotlight-card .app-card-top {
  justify-content: flex-start;
  gap: 8px;
}

.compact-spotlight-card .app-badge {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.74rem;
  font-weight: 700;
}

.compact-spotlight-card .app-meta {
  gap: 6px;
}

.compact-spotlight-card::before {
  display: none;
}

.frequent-link-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.portal-subsection-personal .frequent-link-strip {
  gap: 8px 10px;
}

.frequent-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(42, 54, 75, 0.08);
  background: rgba(255, 255, 255, 0.82);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.portal-subsection-personal .frequent-link {
  min-height: 36px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(83, 127, 255, 0.1);
}

.frequent-link:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 108, 45, 0.22);
  box-shadow: 0 10px 24px rgba(16, 23, 35, 0.08);
}

.frequent-link-name {
  font-weight: 700;
}

.frequent-link-owner {
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 700;
}

.subsection-heading-split {
  align-items: center;
}

.portal-subsection-directory .subsection-heading-split {
  align-items: center;
}

.category-tab-row,
.admin-category-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-tab-button,
.admin-category-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(42, 54, 75, 0.09);
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-weight: 700;
  transition: border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, background 160ms ease;
}

.portal-subsection-directory .category-tab-row {
  max-width: min(100%, 760px);
  justify-content: flex-start;
}

.portal-subsection-directory .category-tab-button {
  min-height: 38px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(42, 54, 75, 0.12);
}

.portal-subsection-directory .category-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 244, 236, 0.95));
  border-color: rgba(42, 54, 75, 0.1);
  box-shadow:
    0 14px 28px rgba(16, 23, 35, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.category-tab-button strong,
.admin-category-tab strong {
  font-size: 0.84rem;
  color: rgba(36, 49, 71, 0.72);
}

.category-tab-button.active,
.admin-category-tab.active {
  color: var(--accent-ink);
  border-color: rgba(148, 108, 45, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 241, 228, 0.96));
  box-shadow: 0 12px 26px rgba(16, 23, 35, 0.06);
}

.category-tab-button:hover,
.admin-category-tab:hover {
  border-color: rgba(148, 108, 45, 0.2);
}

.admin-category-tab.drag-over,
.taxonomy-item-card.drag-over,
.list-row.drag-over {
  border-color: rgba(148, 108, 45, 0.26);
  box-shadow: 0 0 0 2px rgba(191, 138, 62, 0.12);
}

.admin-category-tab.dragging,
.list-row.dragging,
.taxonomy-item-card.dragging {
  opacity: 0.62;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 12px;
}

.directory-card-link {
  min-height: 0;
  padding: 12px;
}

.directory-card-link .app-name {
  font-size: 1rem;
}

.list-workbench {
  display: grid;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.list-workbench-head,
.list-row {
  display: grid;
  align-items: center;
  gap: 14px;
}

.list-workbench-head {
  padding: 0 18px;
  color: rgba(98, 110, 129, 0.86);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.list-workbench-body {
  display: grid;
  gap: 10px;
}

.list-row {
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(28, 38, 58, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 241, 231, 0.9));
  box-shadow: 0 10px 26px rgba(16, 23, 35, 0.05);
}

.list-row.active {
  border-color: rgba(148, 108, 45, 0.2);
  box-shadow: 0 0 0 2px rgba(191, 138, 62, 0.08);
}

.company-row {
  grid-template-columns: 84px minmax(160px, 1.15fr) 92px minmax(160px, 1.25fr) 110px;
  min-width: 680px;
  cursor: grab;
}

.company-row.dragging {
  opacity: 0.62;
  cursor: grabbing;
}

.user-row {
  grid-template-columns: minmax(150px, 1.1fr) 80px minmax(120px, 0.9fr) minmax(150px, 1fr) 88px 120px;
  min-width: 708px;
}

.usage-row {
  grid-template-columns: minmax(150px, 1.05fr) minmax(112px, 0.85fr) minmax(150px, 1fr) 72px 102px;
  min-width: 676px;
  cursor: pointer;
}

.usage-row.active {
  border-color: rgba(148, 108, 45, 0.22);
  box-shadow: 0 0 0 2px rgba(191, 138, 62, 0.1);
}

.list-workbench-head-spaces {
  grid-template-columns: 84px minmax(160px, 1.15fr) 92px minmax(160px, 1.25fr) 110px;
  min-width: 680px;
}

.list-workbench-head-departments {
  grid-template-columns: 78px minmax(160px, 1.2fr) 92px 92px 92px 122px;
  min-width: 720px;
}

.list-workbench-head-users {
  grid-template-columns: minmax(150px, 1.1fr) 80px minmax(120px, 0.9fr) minmax(150px, 1fr) 88px 120px;
  min-width: 708px;
}

.list-workbench-head-usage {
  grid-template-columns: minmax(150px, 1.05fr) minmax(112px, 0.85fr) minmax(150px, 1fr) 72px 102px;
  min-width: 676px;
}

.list-row-index,
.list-row-status,
.list-row-actions,
.list-row-metric,
.list-row-date,
.list-row-role {
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-row-main,
.list-row-user,
.list-row-description,
.list-row-companies,
.list-row-usage {
  min-width: 0;
}

.list-row-user {
  display: grid;
  gap: 4px;
}

.list-row-user span,
.list-row-description,
.list-row-companies,
.list-row-usage,
.list-row-date {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.drag-handle,
.taxonomy-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(128, 110, 73, 0.9);
  letter-spacing: 0.12em;
}

.drag-handle {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(16, 23, 35, 0.04);
}

.list-row-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 12px;
}

.modal-card-compact {
  width: min(640px, calc(100vw - 32px));
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.toggle-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 28px;
  border-radius: 999px;
  background: rgba(42, 54, 75, 0.14);
  transition: background 160ms ease;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 12px rgba(16, 23, 35, 0.18);
  transition: transform 160ms ease;
}

.toggle-field input:checked + .toggle-switch {
  background: rgba(31, 122, 77, 0.28);
}

.toggle-field input:checked + .toggle-switch::after {
  transform: translateX(22px);
}

.toggle-copy {
  font-weight: 700;
}

.usage-shell {
  display: grid;
  gap: 14px;
}

.usage-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.usage-search-field {
  min-width: 260px;
  margin: 0;
}

.usage-workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.usage-summary-table {
  gap: 10px;
}

.usage-summary-table .list-workbench-body {
  gap: 8px;
}

.usage-summary-table .list-row {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

.usage-history-panel {
  display: grid;
  gap: 0;
  padding: 0;
  border-radius: 24px;
  background: rgba(255, 252, 246, 0.88);
  border: 1px solid rgba(42, 54, 75, 0.08);
  box-shadow: 0 12px 28px rgba(16, 23, 35, 0.04);
  overflow: hidden;
}

.usage-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(42, 54, 75, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.usage-history-head h4 {
  margin: 0;
  font-size: 1rem;
}

.usage-history-list {
  display: grid;
  gap: 0;
  max-height: 460px;
  overflow: auto;
  padding: 0 0 4px;
}

.usage-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(42, 54, 75, 0.06);
  background: transparent;
}

.usage-history-item strong {
  font-size: 0.95rem;
}

.usage-history-item span,
.usage-history-item time {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.usage-history-item time {
  justify-self: end;
  white-space: nowrap;
}

.admin-category-tab-row {
  margin-top: -6px;
}

.taxonomy-item-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  cursor: grab;
}

.taxonomy-item-card.dragging {
  opacity: 0.62;
  cursor: grabbing;
}

.taxonomy-drag-handle {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(16, 23, 35, 0.04);
}

body.theme-dark {
  --bg-paper: #0f1724;
  --bg-paper-soft: #182334;
  --panel: rgba(18, 26, 39, 0.9);
  --panel-strong: #182334;
  --text: #eef2f8;
  --muted: #9aa8bb;
  --border: rgba(164, 183, 209, 0.14);
  --border-strong: rgba(164, 183, 209, 0.22);
  --accent-soft: rgba(191, 138, 62, 0.22);
  --shadow-soft: 0 16px 44px rgba(0, 0, 0, 0.22);
  --shadow-strong: 0 22px 80px rgba(0, 0, 0, 0.34);
}

body.theme-dark {
  background:
    radial-gradient(circle at top left, rgba(191, 138, 62, 0.18), transparent 22%),
    radial-gradient(circle at top right, rgba(112, 146, 216, 0.12), transparent 28%),
    linear-gradient(180deg, #0c1320 0%, #121b2b 100%);
}

body.theme-dark::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 88px,
      rgba(255, 255, 255, 0.03) 88px,
      rgba(255, 255, 255, 0.03) 89px
    );
}

body.theme-dark .space-toggle,
body.theme-dark .search-input,
body.theme-dark .toolbar-select,
body.theme-dark .account-menu-toggle {
  border-bottom-color: rgba(164, 183, 209, 0.24);
  color: var(--text);
}

body.theme-dark .search-icon {
  color: rgba(164, 183, 209, 0.5);
}

body.theme-dark .workspace-stat-label,
body.theme-dark .brand-mark .micro-label,
body.theme-dark .space-current-hint,
body.theme-dark .mini-switch-text,
body.theme-dark .account-menu-row {
  color: var(--muted);
}

body.theme-dark .space-toggle-icon {
  border-color: rgba(164, 183, 209, 0.7);
}

body.theme-dark .space-menu,
body.theme-dark .account-menu {
  background: rgba(18, 26, 39, 0.96);
  border-color: rgba(164, 183, 209, 0.12);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.34);
}

body.theme-dark .space-option,
body.theme-dark .account-menu-link,
body.theme-dark .account-menu-action {
  color: var(--text);
}

body.theme-dark .space-option:hover,
body.theme-dark .account-menu-link:hover,
body.theme-dark .account-menu-action:hover,
body.theme-dark .password-visibility-button:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(164, 183, 209, 0.08);
}

body.theme-dark .mini-switch-track {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(164, 183, 209, 0.12);
}

@media (max-width: 980px) {
  .brand-mark {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .toolbar {
    justify-self: stretch;
    min-width: 0;
  }

  .workspace-meta-cluster {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .directory-grid,
  .spotlight-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .usage-workbench {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .brand-copy,
  .toolbar,
  .workspace-meta-cluster,
  .workspace-stats {
    width: 100%;
  }

  .workspace-meta-cluster {
    justify-content: space-between;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .search-input,
  .toolbar-select {
    min-width: 0;
    width: 100%;
  }

  .directory-grid,
  .spotlight-strip {
    grid-template-columns: 1fr;
  }

  .company-list-workbench,
  .department-list-workbench,
  .department-workbench-toolbar {
    padding: 16px;
  }

  .department-row,
  .list-workbench-head-departments {
    min-width: 0;
    grid-template-columns: 64px minmax(0, 1fr) 84px 72px 72px 96px;
  }

  .frequent-link-strip,
  .category-tab-row,
  .admin-category-tab-row,
  .usage-toolbar {
    width: 100%;
  }

  .compact-spotlight-card {
    grid-template-columns: 1fr;
  }
}
