:root {
  color-scheme: light;
  --bg-primary: #f6f5fb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-muted: #f1edfb;
  --text-primary: #211a2d;
  --text-secondary: #6b6477;
  --text-muted: #938b9f;
  --border-color: rgba(76, 29, 149, 0.13);
  --border-strong: rgba(109, 40, 217, 0.25);
  --brand-primary: #6d28d9;
  --brand-hover: #5521ad;
  --brand-dark: #2e1065;
  --brand-darker: #1e0a46;
  --brand-soft: rgba(109, 40, 217, 0.10);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --shadow-card: 0 10px 30px rgba(46, 16, 101, 0.07), 0 2px 8px rgba(46, 16, 101, 0.04);
  --shadow-soft: 0 8px 22px rgba(109, 40, 217, 0.18);
  --body-gradient:
    radial-gradient(circle at top left, rgba(109, 40, 217, 0.07), transparent 32rem),
    linear-gradient(135deg, #f8f7fc 0%, #f4f2f9 52%, #faf9fd 100%);
  --card-gradient:
    linear-gradient(180deg, #ffffff 0%, #fdfcff 100%),
    var(--bg-card);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-muted: #e5e7eb;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #94a3b8;
  --border-color: #e5e7eb;
  --border-strong: #d1d5db;
  --brand-primary: #6d28d9;
  --brand-hover: #5521ad;
  --brand-dark: #2e1065;
  --brand-darker: #1e0a46;
  --brand-soft: rgba(109, 40, 217, 0.10);
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --info: #2563eb;
  --shadow-card: 0 10px 30px rgba(46, 16, 101, 0.07), 0 2px 8px rgba(46, 16, 101, 0.04);
  --shadow-soft: 0 8px 22px rgba(109, 40, 217, 0.18);
  --body-gradient:
    radial-gradient(circle at top left, rgba(109, 40, 217, 0.07), transparent 30rem),
    linear-gradient(135deg, #f8f7fc 0%, #ffffff 45%, #f3f0f9 100%);
  --card-gradient:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.88)),
    var(--bg-card);
}

* {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    fill 180ms ease,
    stroke 180ms ease;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--body-gradient) !important;
  color: var(--text-primary) !important;
}

.rounded-lg,
.rounded-xl {
  border-radius: 12px !important;
}

.bg-surface-950,
.bg-neutral-950 {
  background: var(--bg-primary) !important;
}

.bg-surface-900 {
  background: var(--bg-secondary) !important;
}

.bg-surface-800,
.bg-neutral-900 {
  background: var(--bg-elevated) !important;
}

.bg-surface-700,
.bg-neutral-800,
.hover\:bg-surface-700:hover,
.hover\:bg-surface-800:hover,
.hover\:bg-surface-600:hover {
  background: var(--bg-muted) !important;
}

.border-surface-600,
.border-neutral-800,
.border-neutral-700 {
  border-color: var(--border-color) !important;
}

.bg-brand-500,
.bg-orange-600 {
  background: linear-gradient(135deg, #7c3aed, var(--brand-primary) 52%, #5b21b6) !important;
  color: #ffffff !important;
}

.hover\:bg-brand-600:hover,
.hover\:bg-orange-700:hover {
  background: linear-gradient(135deg, #6525c7, var(--brand-hover) 52%, #46178f) !important;
}

.bg-brand-500\/10 {
  background-color: var(--brand-soft) !important;
}

.bg-brand-500\/15 {
  background-color: rgba(109, 40, 217, 0.15) !important;
}

.border-brand-500\/20,
.border-brand-500\/25,
.border-brand-500\/30,
.border-brand-500\/40,
.border-brand-500\/50,
.border-brand-500\/60 {
  border-color: rgba(109, 40, 217, 0.34) !important;
}

.text-brand-500,
.text-orange-400,
.hover\:text-brand-500:hover,
.hover\:text-brand-400:hover,
.hover\:text-orange-300:hover {
  color: var(--brand-primary) !important;
}

.text-white,
.text-gray-100,
.text-neutral-100 {
  color: var(--text-primary) !important;
}

.text-gray-300,
.text-neutral-300,
.text-neutral-200 {
  color: color-mix(in srgb, var(--text-primary) 82%, var(--text-secondary)) !important;
}

.text-gray-400,
.text-neutral-400 {
  color: var(--text-secondary) !important;
}

.text-gray-500,
.text-gray-600,
.text-neutral-500 {
  color: var(--text-muted) !important;
}

.text-surface-950 {
  color: #ffffff !important;
}

aside.app-sidebar {
  background: linear-gradient(180deg, var(--brand-darker) 0%, var(--brand-dark) 100%) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 10px 0 34px rgba(46, 16, 101, 0.18);
}

header {
  background: color-mix(in srgb, var(--brand-dark) 96%, transparent) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 28px rgba(46, 16, 101, 0.12);
}

.sidebar-item {
  border: 1px solid transparent;
}

.sidebar-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.34), rgba(109, 40, 217, 0.18)) !important;
  border-color: rgba(196, 181, 253, 0.28) !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sidebar-item.active span,
.sidebar-item.active i {
  color: var(--brand-primary) !important;
}

.sidebar-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08) !important;
  transform: translateX(2px);
}

main > .bg-surface-800,
main form > .bg-surface-800,
main .grid > .bg-surface-800,
main .space-y-6 > .bg-surface-800,
main .bg-neutral-900,
main section .bg-neutral-900,
.dashboard-card {
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-card) !important;
}

main > .bg-surface-800,
main form > .bg-surface-800,
main .grid > .bg-surface-800,
main .space-y-6 > .bg-surface-800,
main .bg-neutral-900,
main section .bg-neutral-900,
.dashboard-card {
  background: var(--card-gradient) !important;
}

.dashboard-card:hover {
  border-color: rgba(109, 40, 217, 0.26) !important;
}

main > .bg-surface-800,
main form > .bg-surface-800,
main .space-y-6 > .bg-surface-800 {
  overflow: hidden;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

thead tr {
  background: color-mix(in srgb, var(--bg-muted) 28%, transparent) !important;
}

tbody tr {
  transition: background-color 180ms ease, transform 180ms ease;
}

tbody tr:hover {
  background: rgba(109, 40, 217, 0.055) !important;
}

input,
select,
textarea {
  border-radius: 14px !important;
  border-color: var(--border-color) !important;
  background: color-mix(in srgb, var(--bg-secondary) 88%, var(--bg-card)) !important;
  color: var(--text-primary) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted) !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(109, 40, 217, 0.76) !important;
  box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.12) !important;
}

button,
a,
input,
select,
textarea {
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

button:hover,
a.inline-flex:hover {
  transform: translateY(-1px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

button[type="submit"],
a.bg-brand-500,
a.bg-orange-600 {
  box-shadow: var(--shadow-soft);
}

.bg-black\/60,
.bg-black\/70 {
  background-color: rgba(2, 6, 23, 0.68) !important;
}

.bg-green-500\/10,
.bg-green-500\/15 {
  background-color: color-mix(in srgb, var(--success) 14%, transparent) !important;
}

.border-green-500\/20,
.border-green-500\/30 {
  border-color: color-mix(in srgb, var(--success) 32%, transparent) !important;
}

.text-green-300,
.text-green-400 {
  color: var(--success) !important;
}

.bg-red-500\/10 {
  background-color: color-mix(in srgb, var(--danger) 12%, transparent) !important;
}

.border-red-500\/20,
.border-red-500\/30 {
  border-color: color-mix(in srgb, var(--danger) 28%, transparent) !important;
}

.text-red-300,
.text-red-400 {
  color: var(--danger) !important;
}

.bg-yellow-500\/10 {
  background-color: color-mix(in srgb, var(--warning) 14%, transparent) !important;
}

.border-yellow-500\/20 {
  border-color: color-mix(in srgb, var(--warning) 30%, transparent) !important;
}

.text-yellow-200,
.text-yellow-300 {
  color: var(--warning) !important;
}

.bg-blue-500\/10,
.bg-blue-500\/15 {
  background-color: color-mix(in srgb, var(--info) 12%, transparent) !important;
}

.text-blue-300,
.text-blue-400 {
  color: var(--info) !important;
}

.tracking-wider,
.tracking-widest {
  letter-spacing: 0.08em;
}

/* Jet Tech Sistemas: acabamento premium sem alterar a estrutura. */
aside.app-sidebar .text-gray-300,
aside.app-sidebar .text-gray-400,
aside.app-sidebar .text-gray-500,
aside.app-sidebar .text-white {
  color: rgba(255, 255, 255, 0.78) !important;
}

aside.app-sidebar .sidebar-item.active span,
aside.app-sidebar .sidebar-item.active i,
aside.app-sidebar .text-brand-500 {
  color: #ddd6fe !important;
}

header .text-white,
header .text-gray-300,
header .text-gray-400 {
  color: rgba(255, 255, 255, 0.92) !important;
}

header .bg-surface-900 {
  background: rgba(255, 255, 255, 0.09) !important;
}

header .border-surface-600 {
  border-color: rgba(255, 255, 255, 0.16) !important;
}

header .text-brand-500 {
  color: #c4b5fd !important;
}

button.border-surface-600,
a.border-surface-600 {
  border-color: rgba(109, 40, 217, 0.34) !important;
  background: #ffffff;
  color: var(--brand-primary) !important;
}

button.border-surface-600:hover,
a.border-surface-600:hover {
  border-color: var(--brand-primary) !important;
  background: var(--brand-soft) !important;
}

.text-blue-300,
.text-blue-400,
.text-cyan-300,
.text-cyan-400,
.text-purple-300,
.text-purple-400 {
  color: var(--brand-primary) !important;
}

.bg-blue-500\/10,
.bg-blue-500\/15,
.bg-cyan-500\/10,
.bg-purple-500\/10 {
  background-color: var(--brand-soft) !important;
}

.border-blue-500\/20,
.border-blue-500\/30,
.border-purple-500\/20,
.border-purple-500\/30 {
  border-color: rgba(109, 40, 217, 0.28) !important;
}

a:not(.sidebar-item):not([class*="text-green"]):not([class*="text-red"]):hover {
  color: var(--brand-hover);
}

.dashboard-card,
main section,
main form > div {
  border-radius: 12px;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

@media (max-width: 900px) {
  aside.app-sidebar {
    width: 5rem !important;
  }

  aside.app-sidebar span,
  aside.app-sidebar p:not(:first-child),
  aside.app-sidebar .overflow-hidden,
  aside.app-sidebar nav p {
    display: none !important;
  }

  .ml-64 {
    margin-left: 5rem !important;
  }

  header {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  main {
    padding: 1rem !important;
  }
}

/* Menu lateral Jet Tech: deve prevalecer sobre as classes utilitarias. */
body > aside.app-sidebar,
.app-sidebar,
html body aside.w-64.h-screen.fixed.left-0.top-0 {
  background-color: #2e1065 !important;
  background-image: linear-gradient(180deg, #1e0a46 0%, #2e1065 52%, #3b147d 100%) !important;
  background: linear-gradient(180deg, #1e0a46 0%, #2e1065 52%, #3b147d 100%) !important;
  border-right-color: rgba(196, 181, 253, 0.16) !important;
  box-shadow:
    inset 0 0 0 100vmax rgba(46, 16, 101, 0.98),
    12px 0 34px rgba(46, 16, 101, 0.20) !important;
}

body > aside nav {
  background: transparent !important;
}

body > aside nav > p {
  color: rgba(221, 214, 254, 0.58) !important;
}

body > aside .sidebar-item {
  color: rgba(255, 255, 255, 0.82) !important;
}

body > aside .sidebar-item span,
body > aside .sidebar-item i {
  color: rgba(255, 255, 255, 0.76) !important;
}

body > aside .sidebar-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(196, 181, 253, 0.12) !important;
}

body > aside .sidebar-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.48), rgba(109, 40, 217, 0.32)) !important;
  border-color: rgba(221, 214, 254, 0.30) !important;
  box-shadow: 0 10px 24px rgba(17, 6, 39, 0.22) !important;
}

body > aside .sidebar-item.active span,
body > aside .sidebar-item.active i {
  color: #ffffff !important;
}

body > aside nav > div a {
  color: rgba(221, 214, 254, 0.68) !important;
}

body > aside nav > div a:hover,
body > aside nav > div a.text-brand-500 {
  background: rgba(139, 92, 246, 0.18) !important;
  color: #ffffff !important;
}
