:root{
  --bg:#0B0F1A;
  --panel:#101624;
  --panel-soft:#141b2a;
  --text:#E7EEFC;
  --muted:#9aa6c3;
  --accent:#5dd3ff;
  --radius-lg:18px;
  --radius-md:12px;
}

*,
*::before,
*::after{
  box-sizing:border-box;
}

body{
  margin:24px;
  background:var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  -webkit-font-smoothing:antialiased;
}

.app-shell{
  max-width:1120px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:20px;
}

.app-header{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.app-title{
  margin:0;
  font-size:24px;
  font-weight:700;
}

.app-subtitle{
  margin:0;
  font-size:13px;
  color:var(--muted);
}

.layout{
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);
  gap:18px;
}

.panel{
  background:var(--panel);
  border-radius:var(--radius-lg);
  padding:18px 18px 16px;
  box-shadow:0 18px 40px rgba(0,0,0,0.6);
}

.panel-title{
  margin:0 0 12px;
  font-size:16px;
  font-weight:600;
}

.field-group{
  margin-bottom:16px;
  padding:10px;
  border-radius:var(--radius-md);
  background:var(--panel-soft);
}

.field-label{
  margin:0 0 8px;
  font-size:13px;
  font-weight:500;
}

.field-title{
  margin:0 0 8px;
  font-size:13px;
  font-weight:600;
}

.field-row{
  display:flex;
  gap:8px;
  align-items:center;
}

input[type="file"]{
  flex:1;
}

label{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:13px;
  margin-bottom:8px;
}

input[type="number"],
input[type="color"],
input[type="text"],
select{
  background:transparent;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.06);
  color:var(--text);
  padding:6px 8px;
  font-size:13px;
  outline:none;
}

input[type="color"]{
  padding:0;
  height:32px;
}

select{
  height:32px;
}

.checkbox{
  flex-direction:row;
  align-items:center;
  gap:8px;
  margin-top:4px;
}

.checkbox input{
  width:auto;
}

.btn{
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.10);
  background:transparent;
  color:var(--text);
  padding:8px 14px;
  font-size:13px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  transition:background 0.18s ease,border-color 0.18s ease,transform 0.12s ease;
}

.btn.primary{
  background:var(--accent);
  border-color:var(--accent);
  color:#020617;
  font-weight:600;
}

.btn.small{
  padding:6px 10px;
  font-size:12px;
}

.btn:hover{
  background:rgba(255,255,255,0.06);
  transform:translateY(-1px);
}

.btn.primary:hover{
  filter:brightness(1.05);
  background:var(--accent);
}

.btn:active{
  transform:translateY(0);
}

.actions-main{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}

.muted{
  color:var(--muted);
}

/* Preview tabla */
.preview-table{
  border-radius:var(--radius-md);
  background:var(--panel-soft);
  padding:8px;
  max-height:260px;
  overflow:auto;
  font-size:13px;
}

.preview-table table{
  width:100%;
  border-collapse:collapse;
}

.preview-table th,
.preview-table td{
  padding:6px 8px;
  border-bottom:1px solid rgba(255,255,255,0.04);
}

.preview-table th{
  text-align:left;
  font-weight:600;
  font-size:12px;
  color:var(--muted);
}

/* Historial */
.history-header{
  margin-top:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:13px;
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:2px 8px;
  border-radius:999px;
  background:rgba(93,211,255,0.12);
  color:var(--accent);
  font-size:11px;
}

.history-actions{
  margin-top:6px;
}

.history-list{
  margin-top:8px;
  max-height:220px;
  overflow:auto;
  padding:6px;
  border-radius:var(--radius-md);
  background:var(--panel-soft);
  font-size:12px;
}

.history-item{
  padding:6px 8px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.03);
  margin-bottom:6px;
}

.history-item:last-child{
  margin-bottom:0;
}

.history-title{
  font-weight:600;
}

.history-meta{
  color:var(--muted);
  font-size:11px;
}

.history-winners{
  margin-top:2px;
}

/* Footer */
.footer{
  margin-top:4px;
  font-size:12px;
}

/* Responsive */
@media (max-width:900px){
  body{margin:16px;}
  .layout{
    grid-template-columns:1fr;
  }
}
