/* ============================================================
   EHOST — Design System
   Baseado na identidade visual da exall-host.com.br
   ============================================================ */

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

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  /* Background */
  --bg-base:        #05070A;
  --bg-surface:     #0D0F14;
  --bg-card:        #12141A;
  --bg-card-hover:  #161920;
  --bg-input:       #0a0c11;
  --bg-overlay:     rgba(5,7,10,0.85);

  /* Brand */
  --brand-primary:  #4A7DFF;
  --brand-indigo:   #6366F1;
  --brand-cyan:     #00D1FF;
  --brand-gradient: linear-gradient(135deg, #4A7DFF 0%, #6366F1 100%);
  --brand-glow:     0 0 20px rgba(74,125,255,0.35);
  --brand-glow-sm:  0 0 10px rgba(74,125,255,0.25);

  /* Status */
  --color-success:  #10B981;
  --color-warning:  #F59E0B;
  --color-danger:   #EF4444;
  --color-info:     #00D1FF;

  /* Text */
  --text-primary:   #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted:     #4B5563;
  --text-accent:    #4A7DFF;

  /* Border */
  --border-subtle:  rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.10);
  --border-active:  rgba(74,125,255,0.40);
  --border-focus:   rgba(74,125,255,0.70);

  /* Radius */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --font-xs:   11px;
  --font-sm:   13px;
  --font-base: 14px;
  --font-md:   16px;
  --font-lg:   18px;
  --font-xl:   22px;
  --font-2xl:  28px;
  --font-3xl:  36px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-card:0 0 0 1px var(--border-subtle), var(--shadow-md);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4,0,0.2,1);
  --transition-base: 250ms cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 400ms cubic-bezier(0.4,0,0.2,1);

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 68px;
  --topbar-height: 60px;
}

/* ─── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  font-size: var(--font-base);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--brand-cyan); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: rgba(74,125,255,0.3); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(74,125,255,0.6); }

/* ─── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  font-weight: 600;
  border: none;
  transition: all var(--transition-base);
  white-space: nowrap;
  user-select: none;
}
.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: var(--brand-glow-sm);
}
.btn-primary:hover {
  filter: brightness(1.15);
  box-shadow: var(--brand-glow);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  border-color: var(--border-active);
}
.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--color-danger);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-success {
  background: rgba(16,185,129,0.15);
  color: var(--color-success);
  border: 1px solid rgba(16,185,129,0.2);
}
.btn-success:hover { background: rgba(16,185,129,0.25); }
.btn-sm { padding: 5px 12px; font-size: var(--font-xs); }
.btn-lg { padding: 12px 24px; font-size: var(--font-base); }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ─── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.card:hover { border-color: var(--border-default); box-shadow: var(--shadow-md); }
.card-glass {
  background: rgba(18,20,26,0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.card-title {
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--text-primary);
}

/* ─── STAT CARDS ─────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--brand-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.stat-card:hover { border-color: var(--border-active); box-shadow: var(--brand-glow-sm); }
.stat-card:hover::before { opacity: 1; }
.stat-value {
  font-size: var(--font-2xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
}
.stat-label {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: var(--space-4);
}
.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.stat-change.up { background: rgba(16,185,129,0.1); color: var(--color-success); }
.stat-change.down { background: rgba(239,68,68,0.1); color: var(--color-danger); }

/* ─── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
}
.badge-success { background: rgba(16,185,129,0.12); color: var(--color-success); border: 1px solid rgba(16,185,129,0.2); }
.badge-warning { background: rgba(245,158,11,0.12); color: var(--color-warning); border: 1px solid rgba(245,158,11,0.2); }
.badge-danger  { background: rgba(239,68,68,0.12);  color: var(--color-danger);  border: 1px solid rgba(239,68,68,0.2); }
.badge-info    { background: rgba(0,209,255,0.12);  color: var(--color-info);    border: 1px solid rgba(0,209,255,0.2); }
.badge-neutral { background: rgba(148,163,184,0.1); color: var(--text-secondary);border: 1px solid var(--border-default); }
.badge-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ─── FORMS ──────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-5); }
.form-label {
  display: block;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(74,125,255,0.12);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { appearance: none; cursor: pointer; }
.form-hint { font-size: var(--font-xs); color: var(--text-muted); margin-top: var(--space-1); }
.form-row { display: grid; gap: var(--space-4); }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ─── TABLE ──────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-sm);
}
thead tr {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border-default);
}
thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: var(--font-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody td {
  padding: 12px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}
.td-muted { color: var(--text-secondary); }

/* ─── PROGRESS BARS ──────────────────────────────────────── */
.progress {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--brand-gradient);
  transition: width var(--transition-slow);
}
.progress-bar.warning { background: linear-gradient(90deg, #F59E0B, #EF4444); }
.progress-bar.success { background: linear-gradient(90deg, #10B981, #059669); }

/* ─── ALERTS ─────────────────────────────────────────────── */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  display: flex; align-items: flex-start; gap: var(--space-3);
  border: 1px solid;
}
.alert-info    { background: rgba(0,209,255,0.07);   border-color: rgba(0,209,255,0.2);    color: var(--color-info); }
.alert-success { background: rgba(16,185,129,0.07);  border-color: rgba(16,185,129,0.2);   color: var(--color-success); }
.alert-warning { background: rgba(245,158,11,0.07);  border-color: rgba(245,158,11,0.2);   color: var(--color-warning); }
.alert-danger  { background: rgba(239,68,68,0.07);   border-color: rgba(239,68,68,0.2);    color: var(--color-danger); }

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition-base);
}
.modal-backdrop.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-base);
}
.modal-backdrop.active .modal { transform: translateY(0) scale(1); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-6);
}
.modal-title { font-size: var(--font-lg); font-weight: 700; }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 20px; padding: 4px; border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.modal-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.modal-footer {
  display: flex; gap: var(--space-3); justify-content: flex-end;
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

/* ─── TOOLTIP ─────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: #1e2330; border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: var(--font-xs); font-weight: 500;
  padding: 4px 10px; border-radius: 6px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--transition-fast);
  z-index: 100;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ─── LAYOUT HELPERS ─────────────────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-gap-4 { gap: var(--space-4); }
.grid-gap-6 { gap: var(--space-6); }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-xs { font-size: var(--font-xs); }
.text-sm { font-size: var(--font-sm); }
.text-base { font-size: var(--font-base); }
.text-lg { font-size: var(--font-lg); }
.text-xl { font-size: var(--font-xl); }
.text-muted { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-accent { color: var(--brand-primary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounded { border-radius: var(--radius-sm); }
.rounded-full { border-radius: var(--radius-full); }

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes glow {
  0%,100% { box-shadow: 0 0 10px rgba(74,125,255,0.3); }
  50%      { box-shadow: 0 0 25px rgba(74,125,255,0.6), 0 0 50px rgba(99,102,241,0.2); }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.animate-in { animation: fadeIn 0.4s ease both; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-glow { animation: glow 3s ease-in-out infinite; }
.loading-shimmer {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.04) 50%, var(--bg-card) 75%);
  background-size: 200% auto;
  animation: shimmer 1.5s linear infinite;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .modal { padding: var(--space-6); }
}
