:root {
  --local-bg: #090d16;
  --local-surface: #111827;
  --local-border: rgba(148, 163, 184, .14);
  --local-text: #edf3ff;
  --local-muted: #8fa0b8;
  --local-accent: #9b8cff;
  --local-accent-strong: #7c6cf2;
}

html.dark, body {
  background: var(--local-bg) !important;
  color: var(--local-text);
}

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
}

.local-app-download {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(155, 140, 255, .45);
  border-radius: 8px;
  background: #6557d8;
  color: #fff !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .2);
}

#nexora-app-download {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.local-app-download:hover {
  background: #7567e5;
}

@media (max-width: 640px) {
  .local-app-download {
    right: 12px;
    bottom: 12px;
  }
}

aside, nav {
  background: rgba(12, 18, 30, .88) !important;
  border-color: var(--local-border) !important;
  backdrop-filter: none !important;
}

main { background: transparent !important; }

header {
  border-color: var(--local-border) !important;
  background: #0c121e !important;
  backdrop-filter: none !important;
}

[class*='rounded-lg'], [class*='rounded-xl'], [class*='rounded-2xl'] { border-color: var(--local-border) !important; }
[class*='bg-card'], [class*='bg-popover'], [class*='bg-background'] { background-color: rgba(17, 24, 39, .82) !important; }
[class*='shadow'] { box-shadow: 0 5px 14px rgba(0, 0, 0, .14) !important; }

button, a, input, select, textarea { transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease; }
button:hover, a:hover { transform: translateY(-1px); }

/* Dashboard shell: one readable column instead of loose full-width blocks. */
main > div,
main > section {
  width: min(100%, 1180px);
  margin-inline: auto;
}

main .space-y-8 { gap: 1.5rem !important; }
main .space-y-6 { gap: 1.15rem !important; }

/* Make every content panel share the same visual language. */
.surface-card,
main [class*='border'][class*='bg-card'] {
  border-radius: 1rem !important;
  border-color: rgba(148, 163, 184, .14) !important;
}

main .grid > .surface-card,
main .grid > [class*='rounded'] {
  min-width: 0;
}

/* Settings forms become clear sections with a compact action row. */
form {
  display: grid;
  gap: 1rem;
}

form label {
  display: block;
  margin-bottom: .4rem;
  color: #cbd5e1;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .01em;
}

form .grid { gap: 1rem !important; }
form button[type='submit'] { margin-top: .35rem; }

/* Avoid oversized empty panels and make dense dashboard grids breathe. */
main .grid { align-items: stretch; }
main .grid > * { min-height: 0; }
main .text-4xl, main .text-5xl { line-height: 1.05; }

/* Keep operational actions together and visually secondary to content. */
main .flex-wrap { row-gap: .65rem; }
main button[class*='variant-outline'], main a[class*='variant-outline'] {
  background: rgba(17, 24, 39, .45) !important;
  border-color: rgba(148, 163, 184, .18) !important;
}

/* Status pills remain compact instead of competing with the customer name. */
main [class*='rounded-full'][class*='text-xs'] {
  white-space: nowrap;
  line-height: 1.5;
}

button[class*='bg-primary'], a[class*='bg-primary'] {
  background: var(--local-accent-strong) !important;
  color: #fff !important;
  box-shadow: none !important;
}

input, select, textarea { background: rgba(8, 13, 23, .62) !important; border-color: var(--local-border) !important; color: var(--local-text) !important; }
input:focus, select:focus, textarea:focus { border-color: var(--local-accent) !important; box-shadow: 0 0 0 3px rgba(155, 140, 255, .16) !important; outline: none !important; }
table thead { background: rgba(23, 34, 53, .55) !important; color: var(--local-muted) !important; }
table tbody tr { border-color: var(--local-border) !important; }
table tbody tr:hover { background: rgba(155, 140, 255, .06) !important; }
[class*='text-muted'] { color: var(--local-muted) !important; }
[class*='text-primary'] { color: var(--local-accent) !important; }

/* Customer cards: make the status and renewal information scan faster. */
.surface-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .16) !important;
  border-radius: 1.25rem !important;
  background: #111827 !important;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .14) !important;
}

.surface-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--local-accent);
  opacity: 1;
}

.surface-card:hover {
  border-color: rgba(155, 140, 255, .42) !important;
  box-shadow: 0 7px 16px rgba(0, 0, 0, .18) !important;
}

.surface-card .gradient-primary {
  background: #6557d8 !important;
  box-shadow: none;
}

.surface-card [class*='border-destructive'],
.surface-card [class*='text-destructive'] {
  border-radius: 999px !important;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.surface-card .font-display {
  letter-spacing: -.02em;
}

.surface-card .text-2xl,
.surface-card .text-3xl {
  color: #fff !important;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: -.05em;
}

.surface-card .text-xs {
  color: #91a0b8;
  letter-spacing: .02em;
}

.surface-card .progress,
.surface-card [role='progressbar'] {
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, .12) !important;
}

.surface-card [role='progressbar'] > * {
  background: var(--local-accent-strong) !important;
}

/* Keep the interface flat and readable: no frosted glass or glow utilities. */
*, *::before, *::after {
  backdrop-filter: none !important;
  text-shadow: none !important;
}

[class*='animate-pulse'], [class*='animate-glow'] {
  animation: none !important;
}

@media (max-width: 768px) {
  body { font-size: 14px; }
  main { padding: 1rem !important; }
  header { padding-inline: 1rem !important; }
  [class*='grid-cols-4'], [class*='grid-cols-3'] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  [class*='grid-cols-2'] { grid-template-columns: minmax(0, 1fr) !important; }
  table { min-width: 680px; }
  main .flex.items-center.justify-between { align-items: flex-start !important; flex-wrap: wrap; gap: .75rem; }
  form .grid { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 480px) {
  [class*='grid-cols-4'] { grid-template-columns: minmax(0, 1fr) !important; }
  h1 { font-size: 1.65rem !important; }
}
