/* Raven Cloud - Design system ESGARD (dark, púrpura + cyan) */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #8B5CF6;
  --primary-dark: #7C3AED;
  --cyan: #06B6D4;
  --cyan-bright: #00D9FF;
  --green: #2ed573;
  --gold: #F59E0B;
  --danger: #ef4444;
  --bg-dark: #0a0e27;
  --bg-card: #1a1f3a;
  --bg-lighter: #242d47;
  --text: #ffffff;
  --text-gray: #b0b5c0;
  --border: rgba(139, 92, 246, 0.2);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a3e 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Fondo plasma */
body::before {
  content: ''; position: fixed; top: -50%; right: -10%; width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, rgba(6,182,212,0.1) 50%, transparent 70%);
  border-radius: 50%; animation: pulse-glow 8s ease-in-out infinite; z-index: 0; pointer-events: none;
}
body::after {
  content: ''; position: fixed; bottom: -20%; left: -5%; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(6,182,212,0.1) 0%, transparent 70%);
  border-radius: 50%; animation: pulse-glow 10s ease-in-out infinite reverse; z-index: 0; pointer-events: none;
}
@keyframes pulse-glow {
  0%, 100% { transform: translate(0,0) scale(1); opacity: 1; }
  50% { transform: translate(20px,20px) scale(1.1); opacity: 0.8; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Header */
.topbar {
  background: rgba(10,14,39,0.85); border-bottom: 1px solid var(--border);
  padding: 14px 28px; position: sticky; top: 0; z-index: 100; backdrop-filter: blur(10px);
}
.topbar-inner { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 19px; font-weight: 800; color: #fff; text-decoration: none; text-transform: uppercase; letter-spacing: 2px; white-space: nowrap; }
.brand svg { width: 30px; height: 30px; filter: drop-shadow(0 0 10px rgba(6,182,212,0.3)); flex-shrink: 0; }
.brand-raven { width: 54px; height: 46px; object-fit: contain; display: block; filter: brightness(1.55) contrast(1.16) drop-shadow(0 0 1px rgba(255,255,255,0.72)) drop-shadow(0 0 12px rgba(6,182,212,0.34)); flex-shrink: 0; }
.brand-wordmark { font-size: 16px; line-height: 1; letter-spacing: 2.6px; font-weight: 900; }
.brand span {
  background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--primary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

main { position: relative; z-index: 10; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: none; border-radius: 9px; cursor: pointer;
  font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px;
  transition: all 0.25s ease; text-decoration: none; color: inherit; font-family: inherit;
}
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; box-shadow: 0 0 18px rgba(139,92,246,0.3); }
.btn-primary:hover { box-shadow: 0 0 28px rgba(139,92,246,0.5); transform: translateY(-2px); }
.btn-secondary { background: transparent; color: var(--cyan-bright); border: 1px solid var(--cyan-bright); }
.btn-secondary:hover { background: rgba(6,182,212,0.1); box-shadow: 0 0 18px rgba(6,182,212,0.3); }
.btn-danger { background: rgba(239,68,68,0.15); color: #ff8888; border: 1px solid rgba(239,68,68,0.4); }
.btn-danger:hover { background: rgba(239,68,68,0.3); }
.btn-green { background: linear-gradient(135deg, var(--green) 0%, #10b981 100%); color: #04200f; }
.btn-green:hover { box-shadow: 0 0 24px rgba(46,213,115,0.4); transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-sm { padding: 7px 12px; font-size: 11px; }

/* Cards */
.card {
  background: rgba(26,31,58,0.65); border: 1px solid var(--border); border-radius: 14px;
  padding: 26px; backdrop-filter: blur(10px); transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { border-color: rgba(139,92,246,0.45); }
.card h2, .card h3 {
  font-size: 15px; margin-bottom: 18px; text-transform: uppercase;
  color: var(--cyan-bright); letter-spacing: 1px; font-weight: 700;
}

/* Forms */
label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--text-gray); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
input, textarea, select {
  width: 100%; padding: 12px 14px; background: rgba(36,45,71,0.55);
  border: 1px solid var(--border); border-radius: 9px; color: var(--text);
  font-size: 14px; font-family: inherit; transition: all 0.25s ease;
}
input::placeholder, textarea::placeholder { color: rgba(176,181,192,0.45); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary); background: rgba(36,45,71,0.85);
  box-shadow: 0 0 16px rgba(139,92,246,0.25);
}
select option { background: var(--bg-card); color: var(--text); }
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Status badges */
.badge {
  display: inline-block; padding: 5px 12px; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-trial { background: rgba(245,158,11,0.18); color: var(--gold); border: 1px solid rgba(245,158,11,0.35); }
.badge-active { background: rgba(46,213,115,0.15); color: var(--green); border: 1px solid rgba(46,213,115,0.35); }
.badge-expired { background: rgba(239,68,68,0.15); color: #ff8888; border: 1px solid rgba(239,68,68,0.35); }
.badge-suspended { background: rgba(107,114,128,0.2); color: #9ca3af; border: 1px solid rgba(107,114,128,0.4); }
.badge-cancelled { background: rgba(107,114,128,0.2); color: #9ca3af; border: 1px solid rgba(107,114,128,0.4); }
.badge-submitted { background: rgba(59,130,246,0.18); color: #60a5fa; border: 1px solid rgba(59,130,246,0.35); }
.badge-accepted { background: rgba(139,92,246,0.18); color: #b79cfb; border: 1px solid rgba(139,92,246,0.35); }
.badge-fulfilled { background: rgba(46,213,115,0.15); color: var(--green); border: 1px solid rgba(46,213,115,0.35); }
.badge-rejected, .badge-pending { background: rgba(245,158,11,0.15); color: var(--gold); border: 1px solid rgba(245,158,11,0.35); }
.badge-approved { background: rgba(46,213,115,0.15); color: var(--green); border: 1px solid rgba(46,213,115,0.35); }

/* Tablas */
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 12px 14px; text-align: left; color: var(--cyan-bright); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--border); }
.table td { padding: 12px 14px; border-bottom: 1px solid rgba(139,92,246,0.1); color: var(--text-gray); font-size: 13px; }
.table tr:hover td { background: rgba(139,92,246,0.06); }

/* Modal */
.modal {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.72);
  backdrop-filter: blur(5px); z-index: 1000; align-items: center; justify-content: center; padding: 18px;
}
.modal.active { display: flex; }
.modal-content {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-lighter) 100%);
  border: 1px solid var(--border); border-radius: 14px; padding: 30px;
  max-width: 460px; width: 100%; max-height: 88vh; overflow-y: auto;
  animation: slideUp 0.3s ease; position: relative;
}
.modal-content h2 { font-size: 18px; margin-bottom: 20px; color: var(--cyan-bright); text-transform: uppercase; letter-spacing: 1px; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--text-gray); font-size: 22px; cursor: pointer; }
.modal-close:hover { color: var(--cyan-bright); }

/* Toast */
#toast-zone { position: fixed; bottom: 22px; right: 22px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 13px 18px; border-radius: 10px; font-size: 13px; font-weight: 600;
  animation: slideUp 0.3s ease; max-width: 340px; backdrop-filter: blur(10px);
}
.toast-ok { background: rgba(46,213,115,0.15); border: 1px solid rgba(46,213,115,0.45); color: var(--green); }
.toast-err { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.45); color: #ff9999; }

/* Spinner */
.spinner {
  display: inline-block; width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle;
}

/* Tabs */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: 26px; flex-wrap: wrap; }
.tab {
  padding: 13px 2px; background: none; border: none; color: var(--text-gray);
  cursor: pointer; font-size: 13px; font-weight: 700; position: relative;
  text-transform: uppercase; letter-spacing: 0.5px; transition: color 0.25s ease; font-family: inherit;
}
.tab:hover { color: var(--cyan-bright); }
.tab.active { color: var(--primary); }
.tab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--cyan-bright)); border-radius: 2px;
}
.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

/* Utilidades */
.muted { color: var(--text-gray); }
.price-gradient {
  background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--primary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  font-weight: 800;
}
.empty-state { text-align: center; padding: 44px 18px; color: var(--text-gray); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .topbar { padding: 12px 16px; }
  .brand { flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 16px; letter-spacing: 1px; }
  .brand-raven { width: 42px; height: 36px; }
  .brand-wordmark { font-size: 9px; letter-spacing: 0.9px; max-width: none; overflow: visible; text-overflow: clip; }
  .tabs { gap: 14px; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 9px 8px; }
}
