/* ============================================================
   Thriveo Design System — shared override layer
   Inject after the module's own style.css to unify appearance
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Design tokens ── */
:root {
  --th-bg:          #0a0f1e;
  --th-surface:     #111827;
  --th-surface-2:   #1a2235;
  --th-surface-3:   #243048;
  --th-border:      rgba(255,255,255,0.07);
  --th-border-md:   rgba(255,255,255,0.13);

  --th-primary:     #6366f1;
  --th-primary-h:   #4f46e5;
  --th-primary-glow:rgba(99,102,241,0.25);
  --th-accent:      #06b6d4;
  --th-success:     #10b981;
  --th-warning:     #f59e0b;
  --th-danger:      #ef4444;

  --th-text:        #e2e8f0;
  --th-text-2:      #94a3b8;
  --th-text-3:      #64748b;

  --th-radius:      10px;
  --th-radius-lg:   16px;
  --th-radius-xl:   24px;
  --th-transition:  0.2s ease;

  --th-shadow:      0 4px 24px rgba(0,0,0,0.4);
  --th-shadow-sm:   0 2px 8px  rgba(0,0,0,0.3);
}

/* ── Base reset ── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  font-family: 'Inter', system-ui, sans-serif !important;
  background-color: var(--th-bg) !important;
  color: var(--th-text) !important;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--th-primary); text-decoration: none; transition: color var(--th-transition); }
a:hover { color: var(--th-accent); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--th-surface); }
::-webkit-scrollbar-thumb { background: var(--th-surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--th-primary); }

/* ── Typography ── */
h1,h2,h3,h4,h5,h6 { color: var(--th-text) !important; font-weight: 600; line-height: 1.3; margin-bottom: .75rem; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); }
h3 { font-size: 1.2rem; }
p  { color: var(--th-text-2); }

/* ── Navbar ── */
nav, .navbar, header.navbar, .main-header, .top-nav {
  background: rgba(10,15,30,0.85) !important;
  backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--th-border) !important;
  padding: .85rem 1.5rem !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
}

.navbar .logo, .nav-brand, .logo {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: var(--th-text) !important;
  letter-spacing: -0.02em;
}
.navbar .logo span, .logo-accent { color: var(--th-primary) !important; }

nav ul, .nav-links { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
nav ul li a, .nav-link {
  color: var(--th-text-2) !important;
  font-size: .875rem !important;
  padding: .45rem .85rem !important;
  border-radius: var(--th-radius) !important;
  transition: all var(--th-transition) !important;
}
nav ul li a:hover, .nav-link:hover,
nav ul li a.active, .nav-link.active {
  background: var(--th-surface-2) !important;
  color: var(--th-text) !important;
}

/* ── Sidebar ── */
.sidebar, aside.sidebar {
  background: var(--th-surface) !important;
  border-right: 1px solid var(--th-border) !important;
  padding: 1.25rem .75rem !important;
  min-height: 100vh;
}
.sidebar a, .sidebar-link {
  display: flex; align-items: center; gap: .6rem;
  color: var(--th-text-2) !important;
  font-size: .875rem !important;
  padding: .55rem .85rem !important;
  border-radius: var(--th-radius) !important;
  transition: all var(--th-transition) !important;
  margin-bottom: .2rem;
}
.sidebar a:hover, .sidebar-link:hover,
.sidebar a.active, .sidebar-link.active {
  background: var(--th-surface-2) !important;
  color: var(--th-text) !important;
}
.sidebar a.active { border-left: 3px solid var(--th-primary) !important; }

/* ── Cards ── */
.card, .glass-card, .box, .panel {
  background: var(--th-surface) !important;
  border: 1px solid var(--th-border) !important;
  border-radius: var(--th-radius-lg) !important;
  padding: 1.5rem !important;
  box-shadow: var(--th-shadow-sm) !important;
  transition: border-color var(--th-transition), box-shadow var(--th-transition);
}
.card:hover, .glass-card:hover {
  border-color: var(--th-border-md) !important;
  box-shadow: var(--th-shadow) !important;
}

/* ── Buttons ── */
.btn, button[type=submit], input[type=submit], .button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .4rem !important;
  padding: .6rem 1.25rem !important;
  border-radius: var(--th-radius) !important;
  font-size: .875rem !important;
  font-weight: 500 !important;
  font-family: 'Inter', sans-serif !important;
  cursor: pointer !important;
  transition: all var(--th-transition) !important;
  border: 1px solid transparent !important;
  white-space: nowrap !important;
}

.btn-primary, button[type=submit], input[type=submit] {
  background: var(--th-primary) !important;
  color: #fff !important;
  border-color: var(--th-primary) !important;
}
.btn-primary:hover, button[type=submit]:hover, input[type=submit]:hover {
  background: var(--th-primary-h) !important;
  border-color: var(--th-primary-h) !important;
  box-shadow: 0 0 0 3px var(--th-primary-glow) !important;
}

.btn-secondary, .btn-outline {
  background: transparent !important;
  color: var(--th-text-2) !important;
  border-color: var(--th-border-md) !important;
}
.btn-secondary:hover, .btn-outline:hover {
  background: var(--th-surface-2) !important;
  color: var(--th-text) !important;
}

.btn-danger {
  background: var(--th-danger) !important;
  color: #fff !important;
  border-color: var(--th-danger) !important;
}

.btn-sm { padding: .35rem .8rem !important; font-size: .8rem !important; }
.btn-lg { padding: .85rem 1.75rem !important; font-size: 1rem !important; }

/* ── Forms ── */
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=url], input[type=search],
input[type=date], select, textarea {
  background: var(--th-surface-2) !important;
  border: 1px solid var(--th-border-md) !important;
  border-radius: var(--th-radius) !important;
  color: var(--th-text) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: .875rem !important;
  padding: .6rem .9rem !important;
  width: 100%;
  transition: border-color var(--th-transition), box-shadow var(--th-transition) !important;
  outline: none !important;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--th-primary) !important;
  box-shadow: 0 0 0 3px var(--th-primary-glow) !important;
}
input::placeholder, textarea::placeholder { color: var(--th-text-3) !important; }

label {
  display: block;
  font-size: .8rem !important;
  font-weight: 500 !important;
  color: var(--th-text-2) !important;
  margin-bottom: .35rem !important;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-group, .form-field { margin-bottom: 1.1rem; }

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
thead th {
  background: var(--th-surface-2) !important;
  color: var(--th-text-2) !important;
  font-weight: 500 !important;
  font-size: .75rem !important;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .75rem 1rem !important;
  border-bottom: 1px solid var(--th-border-md) !important;
}
tbody tr {
  border-bottom: 1px solid var(--th-border) !important;
  transition: background var(--th-transition);
}
tbody tr:hover { background: var(--th-surface-2) !important; }
tbody td { padding: .75rem 1rem !important; color: var(--th-text) !important; }

/* ── Badges ── */
.badge, .tag, .pill, .status {
  display: inline-flex; align-items: center;
  padding: .2rem .65rem !important;
  border-radius: 999px !important;
  font-size: .7rem !important;
  font-weight: 600 !important;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-success, .status-active, .badge-green {
  background: rgba(16,185,129,.15) !important;
  color: #34d399 !important;
}
.badge-warning, .status-pending {
  background: rgba(245,158,11,.15) !important;
  color: #fbbf24 !important;
}
.badge-danger, .badge-red {
  background: rgba(239,68,68,.15) !important;
  color: #f87171 !important;
}
.badge-info, .badge-primary {
  background: rgba(99,102,241,.15) !important;
  color: #a5b4fc !important;
}

/* ── Alerts / Flash messages ── */
.alert, .flash, .message, .notification {
  padding: .9rem 1.1rem !important;
  border-radius: var(--th-radius) !important;
  font-size: .875rem !important;
  border-left: 3px solid;
  margin-bottom: 1rem;
}
.alert-success { background: rgba(16,185,129,.1) !important; border-color: var(--th-success) !important; color: #34d399 !important; }
.alert-error, .alert-danger { background: rgba(239,68,68,.1) !important; border-color: var(--th-danger) !important; color: #f87171 !important; }
.alert-warning { background: rgba(245,158,11,.1) !important; border-color: var(--th-warning) !important; color: #fbbf24 !important; }
.alert-info { background: rgba(99,102,241,.1) !important; border-color: var(--th-primary) !important; color: #a5b4fc !important; }

/* ── Login page ── */
.login-page, .auth-page, body.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--th-bg) !important;
  background-image: radial-gradient(ellipse at 30% 20%, rgba(99,102,241,.12) 0%, transparent 60%),
                    radial-gradient(ellipse at 70% 80%, rgba(6,182,212,.08) 0%, transparent 50%) !important;
}
.login-box, .auth-card, .login-card, .login-container {
  background: var(--th-surface) !important;
  border: 1px solid var(--th-border-md) !important;
  border-radius: var(--th-radius-xl) !important;
  padding: 2.5rem !important;
  width: 100%;
  max-width: 420px !important;
  box-shadow: var(--th-shadow) !important;
}
.login-box h1, .login-box h2, .auth-card h1, .auth-card h2 { text-align: center; margin-bottom: 1.75rem !important; }

/* ── Dashboard layout ── */
.dashboard, .main-content, .content-area, .app-content {
  background: var(--th-bg) !important;
  padding: 1.5rem !important;
  min-height: 100vh;
}

/* ── Stats / Metric cards ── */
.stat-card, .metric-card, .kpi-card, .info-card {
  background: var(--th-surface) !important;
  border: 1px solid var(--th-border) !important;
  border-radius: var(--th-radius-lg) !important;
  padding: 1.25rem !important;
}
.stat-card .value, .metric-card .number, .kpi-value {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  color: var(--th-text) !important;
  line-height: 1.1;
}
.stat-card .label, .metric-card .label, .kpi-label {
  font-size: .75rem !important;
  color: var(--th-text-3) !important;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Modal ── */
.modal-backdrop, .overlay { background: rgba(0,0,0,.6) !important; }
.modal, .modal-box, .dialog {
  background: var(--th-surface) !important;
  border: 1px solid var(--th-border-md) !important;
  border-radius: var(--th-radius-xl) !important;
  box-shadow: var(--th-shadow) !important;
}
.modal-header, .dialog-header {
  border-bottom: 1px solid var(--th-border) !important;
  padding-bottom: .85rem !important;
  margin-bottom: 1rem !important;
}

/* ── Thriveo top bar branding strip ── */
.th-topbar {
  height: 3px;
  background: linear-gradient(90deg, var(--th-primary), var(--th-accent));
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  /* Esconde sidebar apenas em contexto WordPress, não nos layouts de app MLPT */
  body:not(:has(.app-layout)):not(:has(.admin-layout)) .sidebar { display: none; }
  .dashboard, .main-content { padding: 1rem !important; }
  .login-box, .auth-card { padding: 1.5rem !important; margin: 1rem; }
}

/* Garante que sidebar de apps internos sempre apareça */
.app-layout .sidebar,
.admin-layout .sidebar {
  display: block !important;
}
