@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Core Theme: Dark Obsidian Slate & Deep Royal Purple ("Roxo Mais Escuro") */
  --bg-canvas: #07050e;
  --bg-sidebar: #0a0714;
  --bg-surface: #0f0b1e;
  --bg-surface-elevated: #16112a;
  --bg-surface-subtle: rgba(18, 13, 34, 0.65);
  --bg-input: #0a0716;

  --border-subtle: rgba(168, 85, 247, 0.1);
  --border-medium: rgba(168, 85, 247, 0.18);
  --border-bright: rgba(168, 85, 247, 0.45);

  /* Primary Deep Royal & Neon Purples */
  --purple-primary: #7c3aed;
  --purple-gradient: linear-gradient(135deg, #4c1d95 0%, #6d28d9 45%, #7c3aed 100%);
  --purple-hover: #8b5cf6;
  --purple-active: #5b21b6;
  --purple-subtle: rgba(124, 58, 237, 0.15);
  --purple-badge: rgba(147, 51, 234, 0.2);
  --purple-glow: 0 0 24px rgba(124, 58, 237, 0.4);
  --purple-light: #c084fc;
  --purple-ice: #e9d5ff;

  /* Compatibility Aliases */
  --blue-primary: var(--purple-primary);
  --blue-gradient: var(--purple-gradient);
  --blue-hover: var(--purple-hover);
  --blue-active: var(--purple-active);
  --blue-subtle: var(--purple-subtle);
  --blue-badge: var(--purple-badge);
  --blue-glow: var(--purple-glow);
  --blue-light: var(--purple-light);
  --blue-ice: var(--purple-ice);

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #71717a;
  --text-on-purple: #ffffff;

  /* Status Colors */
  --active-text: #34d399;
  --active-bg: rgba(16, 185, 129, 0.12);
  --active-border: rgba(16, 185, 129, 0.25);

  --expired-text: #fbbf24;
  --expired-bg: rgba(245, 158, 11, 0.12);
  --expired-border: rgba(245, 158, 11, 0.25);

  --revoked-text: #f87171;
  --revoked-bg: rgba(239, 68, 68, 0.12);
  --revoked-border: rgba(239, 68, 68, 0.25);

  /* Elevation Shadows */
  --shadow-card: 0 8px 30px rgba(3, 2, 8, 0.55);
  --shadow-dropdown: 0 16px 40px rgba(2, 1, 6, 0.75);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg-canvas);
  background-image: 
    radial-gradient(ellipse 85% 50% at 50% -20%, rgba(109, 40, 217, 0.18), transparent 70%),
    radial-gradient(circle 600px at 100% 100%, rgba(76, 29, 149, 0.1), transparent 70%),
    radial-gradient(circle 500px at 0% 50%, rgba(139, 92, 246, 0.05), transparent 70%);
  background-attachment: fixed;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-body);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit;
}

button {
  cursor: pointer;
  border: 0;
  outline: 0;
}

/* ==========================================================================
   App Shell & Navigation Sidebar
   ========================================================================== */

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 256px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  color: var(--text-body);
  position: fixed;
  inset: 0 auto 0 0;
  padding: 24px 16px 18px;
  display: flex;
  flex-direction: column;
  z-index: 50;
  backdrop-filter: blur(16px);
}

.brand {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  text-decoration: none;
  color: var(--text-main);
  transition: opacity 0.15s ease;
}

.brand:hover {
  opacity: 0.95;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: #ffffff;
}

.brand-name span {
  color: var(--purple-light);
  text-shadow: 0 0 16px rgba(192, 132, 252, 0.6);
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: 0 0 18px rgba(124, 58, 237, 0.5);
  border: 1px solid rgba(168, 85, 247, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand:hover .brand-logo-img {
  transform: scale(1.06);
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.7);
}

.workspace-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--text-dim);
  margin: 32px 10px 10px;
  text-transform: uppercase;
}

.main-nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.18s ease;
  position: relative;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(36, 24, 58, 0.45);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.22) 0%, rgba(124, 58, 237, 0.06) 100%);
  color: #ffffff;
  font-weight: 600;
  border-left: 3px solid var(--purple-light);
  box-shadow: inset 0 0 14px rgba(124, 58, 237, 0.12);
}

.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  color: var(--text-dim);
  transition: color 0.18s ease;
}

.nav-item:hover .nav-icon {
  color: var(--purple-light);
}

.nav-item.active .nav-icon {
  color: var(--purple-light);
  filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.6));
}

.nav-count {
  margin-left: auto;
  color: var(--purple-ice);
  background: rgba(124, 58, 237, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 12px;
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.environment-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 11, 30, 0.7);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.environment-card b, .user-info b {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.environment-card small, .user-info small {
  display: block;
  color: var(--text-muted);
  font-size: 10.5px;
  margin-top: 1px;
}

.environment-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), 0 0 10px rgba(16, 185, 129, 0.6);
}

.environment-tag {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--purple-light);
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
}

.user-card {
  display: flex;
  align-items: center;
  padding: 8px 4px 0;
  gap: 10px;
  border-top: 1px solid var(--border-subtle);
}

.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%);
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.45);
  overflow: hidden;
}

.user-info {
  flex: 1;
}

.icon-button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  font-size: 16px;
  transition: all 0.15s ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.user-card .icon-button:hover {
  background: rgba(36, 24, 58, 0.7);
  color: #ffffff;
}

/* ==========================================================================
   Main Content & Topbar
   ========================================================================== */

.main-content {
  margin-left: 256px;
  flex: 1;
  min-height: 100vh;
  padding: 0 44px 50px;
  max-width: 1540px;
}

.topbar {
  height: 70px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: rgba(7, 5, 14, 0.88);
  backdrop-filter: blur(16px);
  z-index: 40;
  margin: 0 -44px;
  padding: 0 44px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 13px;
}

.breadcrumbs i {
  font-style: normal;
  color: rgba(168, 85, 247, 0.3);
}

.breadcrumbs b {
  color: var(--text-main);
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.local-badge {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 13, 34, 0.6);
  border: 1px solid var(--border-subtle);
  padding: 5px 11px;
  border-radius: 20px;
}

.local-badge span {
  width: 6px;
  height: 6px;
  background: var(--purple-light);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.8);
}

.topbar-actions .icon-button {
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

.topbar-actions .icon-button:hover {
  border-color: var(--border-medium);
  background: rgba(36, 24, 58, 0.6);
}

.menu-toggle {
  display: none;
}

/* ==========================================================================
   Page Views & Headings
   ========================================================================== */

.page-view {
  display: none;
  padding-top: 36px;
  animation: viewAppear 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-view.active {
  display: block;
}

@keyframes viewAppear {
  from { opacity: 0.3; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--purple-light);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.eyebrow-line {
  width: 14px;
  height: 2px;
  background: var(--purple-primary);
  display: inline-block;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.8);
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-top: 6px;
  color: #ffffff;
}

.page-heading p {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-top: 6px;
}

/* Buttons */
.button {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12.5px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.button-primary {
  color: #ffffff;
  background: var(--purple-gradient);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.button-primary:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.55);
  transform: translateY(-1px);
}

.button-primary:active {
  transform: translateY(0);
}

.button-primary .plus {
  font-size: 16px;
  line-height: 1;
}

.button-secondary {
  background: rgba(22, 17, 42, 0.7);
  color: var(--text-main);
  border: 1px solid var(--border-medium);
}

.button-secondary:hover {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(36, 24, 58, 0.8);
  transform: translateY(-1px);
}

/* Notice Banner */
.demo-notice {
  min-height: 52px;
  background: rgba(76, 29, 149, 0.16);
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-body);
  margin-bottom: 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.notice-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  background: rgba(124, 58, 237, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 50%;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 11px;
  color: var(--purple-light);
  flex: none;
}

.demo-notice div:nth-child(2) {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
}

.demo-notice b {
  color: #ffffff;
  white-space: nowrap;
}

.demo-notice span {
  color: var(--text-muted);
}

.demo-notice > button {
  margin-left: auto;
  color: var(--text-muted);
  background: none;
  border: 0;
  font-size: 18px;
  transition: color 0.15s ease;
}

.demo-notice > button:hover {
  color: #ffffff;
}

/* ==========================================================================
   Metrics Grid (KPI Cards)
   ========================================================================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.metric-card, .panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.metric-card {
  padding: 18px 20px 16px;
  min-height: 116px;
  background: linear-gradient(145deg, rgba(15, 11, 30, 0.95) 0%, rgba(10, 7, 20, 0.85) 100%);
}

.metric-card:hover {
  border-color: rgba(168, 85, 247, 0.35);
  transform: translateY(-2px);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.7), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
}

.metric-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 14px;
}

.metric-icon.green, .quick-icon.green {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.metric-icon.blue, .quick-icon.blue {
  background: rgba(124, 58, 237, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.metric-icon.purple {
  background: rgba(168, 85, 247, 0.18);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1.2px;
  margin-top: 8px;
  color: #ffffff;
}

.metric-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.metric-caption {
  font-size: 11px;
  color: var(--text-dim);
}

.metric-caption.muted {
  color: rgba(113, 113, 122, 0.7);
}

.metric-trend {
  font-size: 11px;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Content Grid & Panels
   ========================================================================== */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.licenses-panel {
  min-height: 360px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-heading h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #ffffff;
}

.panel-heading p {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 3px;
}

.text-button {
  border: 0;
  background: none;
  color: var(--purple-light);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.text-button:hover {
  color: #ffffff;
  background: rgba(124, 58, 237, 0.2);
}

.table-tools {
  height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 11, 30, 0.5);
  border-bottom: 1px solid var(--border-subtle);
}

.search-box {
  height: 34px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  min-width: 200px;
  flex: 1;
  color: var(--text-dim);
  background: var(--bg-input);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--purple-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.search-box span {
  font-size: 16px;
  line-height: 1;
}

.search-box input {
  border: 0;
  outline: 0;
  min-width: 0;
  width: 100%;
  font-size: 12px;
  color: var(--text-main);
  background: transparent;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.filter-button, .select-control {
  height: 34px;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0 12px;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.filter-button:hover, .select-control:hover {
  border-color: rgba(168, 85, 247, 0.4);
  color: var(--text-main);
}

.select-control {
  outline: 0;
  cursor: pointer;
}

.select-control option {
  background: #0f0b1e;
  color: #f8fafc;
}

.filter-button span {
  margin-left: 8px;
  color: var(--text-dim);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}

thead {
  background: rgba(10, 7, 20, 0.7);
}

th {
  height: 36px;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.9px;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
}

td, th {
  padding: 0 14px;
}

td:first-child, th:first-child {
  padding-left: 20px;
}

td:last-child, th:last-child {
  padding-right: 20px;
}

tbody tr {
  border-top: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: rgba(36, 24, 58, 0.35);
}

td {
  height: 58px;
  font-size: 12.5px;
  color: var(--text-body);
  white-space: nowrap;
}

.table-empty {
  text-align: center;
  padding: 32px !important;
  color: var(--text-dim);
  font-style: italic;
}

.server-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.server-logo {
  height: 32px;
  width: 32px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(76, 29, 149, 0.5), rgba(124, 58, 237, 0.3));
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-sm);
  color: var(--purple-light);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 11.5px;
}

.server-meta b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
}

.server-meta small {
  display: block;
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 2px;
  font-family: monospace;
}

.ip-cell {
  font-family: 'Plus Jakarta Sans', monospace, sans-serif;
  font-size: 12px;
  color: var(--purple-ice);
}

.module-count {
  color: var(--text-muted);
}

.module-count b {
  font-size: 12px;
  color: var(--text-main);
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-pill:before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.status-pill.active {
  color: var(--active-text);
  background: var(--active-bg);
  border-color: var(--active-border);
}

.status-pill.expired {
  color: var(--expired-text);
  background: var(--expired-bg);
  border-color: var(--expired-border);
}

.status-pill.revoked {
  color: var(--revoked-text);
  background: var(--revoked-bg);
  border-color: var(--revoked-border);
}

/* Row Actions */
.row-action {
  background: rgba(36, 24, 58, 0.6);
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 6px;
  transition: all 0.15s ease;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.row-actions .row-action { margin-right: 0; }

.row-action:hover {
  background: rgba(59, 39, 94, 0.8);
  color: #ffffff;
  border-color: rgba(168, 85, 247, 0.4);
}

.row-action.revoke:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.row-action.restore:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.row-menu {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 18px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.row-menu:hover {
  color: var(--purple-light);
  background: rgba(124, 58, 237, 0.2);
}

/* ==========================================================================
   Side Stack & Quick Panels
   ========================================================================== */

.side-stack {
  display: grid;
  gap: 16px;
}

.quick-panel {
  padding-bottom: 8px;
}

.panel-heading.compact {
  padding-bottom: 12px;
}

.quick-action {
  border: 0;
  background: transparent;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 11px 20px;
  transition: background 0.15s ease;
}

.quick-action:hover {
  background: rgba(36, 24, 58, 0.4);
}

.quick-icon {
  height: 32px;
  width: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 15px;
}

.quick-action > span:nth-child(2) {
  flex: 1;
}

.quick-action b {
  display: block;
  font-size: 12px;
  color: var(--text-main);
  font-weight: 600;
}

.quick-action small {
  display: block;
  color: var(--text-dim);
  font-size: 10.5px;
  margin-top: 2px;
}

.quick-arrow {
  font-size: 15px;
  color: var(--text-dim);
  transition: transform 0.15s ease, color 0.15s ease;
}

.quick-action:hover .quick-arrow {
  transform: translateX(3px);
  color: var(--purple-light);
}

.security-note {
  display: flex;
  gap: 11px;
  border-top: 1px solid var(--border-subtle);
  margin: 10px 16px 0;
  padding: 14px 4px 8px;
}

.security-lock {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.16);
  border: 1px solid rgba(168, 85, 247, 0.3);
  display: grid;
  place-items: center;
  color: var(--purple-light);
  font-size: 12px;
  flex: none;
}

.security-note b {
  display: block;
  font-size: 11.5px;
  color: var(--text-main);
}

.security-note span {
  display: block;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
  margin-top: 3px;
}

.module-summary {
  padding-bottom: 16px;
}

.module-chips {
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.module-chip {
  padding: 4px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 10px;
  background: rgba(10, 7, 20, 0.7);
  transition: all 0.15s ease;
}

.module-chip:hover {
  border-color: rgba(168, 85, 247, 0.4);
  color: var(--purple-light);
  background: rgba(124, 58, 237, 0.15);
}

.icon-button.tiny {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

/* Empty States */
.empty-state {
  display: none;
  min-height: 200px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 32px;
}

.empty-state.visible {
  display: flex;
}

.empty-symbol {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(124, 58, 237, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: var(--purple-light);
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-bottom: 12px;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.25);
}

.empty-state b {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.empty-state > span {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.empty-state .button {
  margin-top: 16px;
}

.full-panel {
  min-height: 420px;
}

.full-panel table td {
  height: 64px;
}

/* Catalog View */
.catalog-counter {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: linear-gradient(135deg, rgba(76, 29, 149, 0.35), rgba(124, 58, 237, 0.15));
  border-radius: var(--radius-md);
  padding: 8px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.catalog-counter small {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--purple-light);
  margin-left: 2px;
}

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

.module-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  min-height: 118px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.module-card:hover {
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(124, 58, 237, 0.2);
  transform: translateY(-2px);
}

.module-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.module-symbol {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: var(--purple-light);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 12px;
}

.module-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--purple-ice);
  background: rgba(76, 29, 149, 0.35);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.module-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 4px;
  color: #ffffff;
}

.module-card p {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.45;
}

.catalog-note {
  margin-top: 18px;
  background: rgba(76, 29, 149, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  gap: 12px;
  padding: 14px 18px;
}

.catalog-note > span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(168, 85, 247, 0.45);
  background: rgba(124, 58, 237, 0.25);
  color: var(--purple-light);
  text-align: center;
  font-size: 12px;
  line-height: 18px;
  flex: none;
}

.catalog-note b {
  font-size: 12px;
  color: #ffffff;
}

.catalog-note p {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  padding: 32px 4px 20px;
  color: var(--text-dim);
  font-size: 11px;
}

.footer i {
  font-style: normal;
  padding: 0 6px;
  color: rgba(168, 85, 247, 0.25);
}

/* ==========================================================================
   Modal Dialog
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 3, 10, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.modal-backdrop.open {
  display: flex;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: min(620px, 100%);
  max-height: min(90vh, 800px);
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dropdown), 0 0 60px rgba(124, 58, 237, 0.2);
  padding: 26px 28px;
  color: var(--text-body);
}

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

.modal-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin-top: 6px;
  color: #ffffff;
}

.modal-header p {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.close-modal {
  font-size: 24px;
  color: var(--text-dim);
  transition: color 0.15s ease;
}

.close-modal:hover {
  color: #ffffff;
}

.form-section-title {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  margin-bottom: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 9px;
}

.form-section-title > span {
  font-size: 10px;
  font-weight: 700;
  color: var(--purple-light);
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 4px;
  padding: 2px 6px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.field {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field input {
  height: 38px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0 12px;
  outline: 0;
  color: #ffffff;
  font-size: 12.5px;
  background: var(--bg-input);
  transition: all 0.2s ease;
}

.field input:focus {
  border-color: var(--purple-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.field input::placeholder {
  color: var(--text-dim);
}

.field input:disabled {
  background: rgba(15, 11, 30, 0.6);
  color: var(--text-dim);
  border-color: var(--border-subtle);
}

.field.wide {
  grid-column: span 2;
}

.optional {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 4px;
}

.module-title {
  margin-top: 4px;
}

.select-all {
  margin-left: auto;
  font-size: 11.5px;
}

.module-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 20px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.module-option {
  min-height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 11px;
  font-size: 11.5px;
  color: var(--text-muted);
  background: rgba(10, 7, 20, 0.65);
  cursor: pointer;
  transition: all 0.15s ease;
}

.module-option:hover {
  border-color: rgba(168, 85, 247, 0.35);
  color: #ffffff;
  background: rgba(36, 24, 58, 0.55);
}

.module-option input {
  accent-color: var(--purple-primary);
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

.module-option:has(input:checked) {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(168, 85, 247, 0.45);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(124, 58, 237, 0.15);
}

.expiry-title {
  margin-top: 4px;
}

.modal-foot {
  border-top: 1px solid var(--border-subtle);
  margin-top: 6px;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-foot > span {
  font-size: 10.5px;
  color: var(--text-dim);
}

.modal-foot > div {
  display: flex;
  gap: 8px;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 18px);
  padding: 11px 18px;
  background: rgba(15, 11, 30, 0.95);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-dropdown), 0 0 30px rgba(124, 58, 237, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
  backdrop-filter: blur(12px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1100px) {
  .main-content {
    padding: 0 28px 40px;
    margin-left: 230px;
  }
  .sidebar {
    width: 230px;
  }
  .topbar {
    margin: 0 -28px;
    padding: 0 28px;
  }
  .content-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(230px, 0.8fr);
  }
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.7);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    padding: 0 20px 30px;
  }
  .topbar {
    margin: 0 -20px;
    padding: 0 20px;
    justify-content: flex-start;
  }
  .menu-toggle {
    display: grid;
    margin-right: 12px;
    color: var(--text-main);
  }
  .breadcrumbs {
    flex: 1;
  }
  .content-grid {
    grid-template-columns: 1fr;
  }
  .side-stack {
    grid-template-columns: 1fr 1fr;
  }
  .page-view {
    padding-top: 24px;
  }
  .licenses-panel {
    min-height: 0;
  }
}

@media (max-width: 600px) {
  .main-content {
    padding: 0 14px 24px;
  }
  .topbar {
    height: 60px;
    margin: 0 -14px;
    padding: 0 14px;
  }
  .topbar-actions {
    gap: 8px;
  }
  .local-badge {
    font-size: 0;
    padding: 6px;
  }
  .local-badge span {
    margin: 0;
  }
  .page-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-heading h1 {
    font-size: 26px;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .side-stack {
    grid-template-columns: 1fr;
  }
  .module-grid {
    grid-template-columns: 1fr;
  }
  .module-picker {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.wide {
    grid-column: span 1;
  }
  .modal {
    padding: 20px 16px;
  }
  .modal-foot {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .modal-foot > div {
    justify-content: flex-end;
  }
}

.status-pill.pending { color: #8bbcff; background: rgba(44,110,205,.14); border-color: rgba(88,153,245,.28); }
body:not(.authenticated) .app-shell { display:none; }
.login-screen { min-height:100vh; display:grid; place-items:center; padding:24px; background:radial-gradient(ellipse at 50% 0%, rgba(40,84,150,.22), transparent 55%), #090e17; }
body.authenticated .login-screen { display:none; }
.login-card { width:min(100%,420px); padding:36px; border:1px solid rgba(148,163,184,.16); border-radius:20px; background:#101824; box-shadow:0 24px 80px rgba(0,0,0,.4); display:grid; gap:16px; }
.login-logo { width:54px; height:54px; object-fit:cover; border-radius:14px; margin-bottom:4px; }
.login-card h1 { margin:0; font-size:28px; }
.login-card p { margin:-8px 0 4px; color:var(--text-muted); line-height:1.5; }
.login-card .button { width:100%; justify-content:center; margin-top:4px; }
.login-card small { text-align:center; color:var(--text-muted); }
.login-error { min-height:16px; color:#ff8b8b; font-size:13px; }
