:root{
  --bg:#f4f6f8;
  --card:#fff;
  --dark:#111;
  --muted:#6b7280;
  --primary:#e53935;
  --link:#0d47a1;
  --border:#e5e7eb;
  --shadow: 0 4px 12px rgba(0,0,0,.08);
  --radius:12px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: Arial, sans-serif;
  background:var(--bg);
  color:#111;
}

.header{
  background:var(--dark);
  color:#fff;
  padding:16px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.header h1{
  margin:0;
  font-size:20px;
  font-weight:800;
  letter-spacing:.5px;
}
.header .actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:0;
  cursor:pointer;
  padding:10px 14px;
  border-radius:10px;
  font-weight:700;
  text-decoration:none;
  font-size:14px;
  line-height:1;
}
.btn-primary{background:var(--primary); color:#fff;}
.btn-dark{background:#222; color:#fff;}
.btn-link{background:var(--link); color:#fff;}
.btn-ghost{background:#fff; color:#111; border:1px solid var(--border);}

.container{
  max-width:1200px;
  margin:auto;
  padding:22px 18px 40px;
}

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:16px;
}
@media (min-width: 980px){
  .grid{ grid-template-columns: 420px 1fr; }
}

.card{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
}
.card h2{
  margin:0 0 12px;
  font-size:18px;
}
.muted{color:var(--muted); font-size:13px}

.field{
  margin-bottom:12px;
}
label{
  display:block;
  font-size:13px;
  color:#111;
  font-weight:700;
  margin:0 0 6px;
}
input[type="text"], input[type="password"], select{
  width:100%;
  padding:11px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  font-size:14px;
  outline:none;
  background:#fff;
}
input[type="file"]{
  width:100%;
}
.row{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}
@media (min-width: 600px){
  .row{ grid-template-columns: 1fr 1fr; }
}

.table-wrap{
  overflow:auto;
  border-radius:var(--radius);
  border:1px solid var(--border);
}
table{
  width:100%;
  border-collapse:collapse;
  min-width: 880px;
  background:#fff;
}
thead th{
  background:#111;
  color:#fff;
  font-size:12px;
  text-transform:uppercase;
  padding:12px 10px;
  text-align:left;
  position:sticky;
  top:0;
}
tbody td{
  border-bottom:1px solid var(--border);
  padding:12px 10px;
  font-size:13px;
  vertical-align:middle;
}
tr:hover td{ background:#fafafa; }

.badge{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
}
.badge-aire{ background:#e3f2fd; color:#0d47a1; }
.badge-aceite{ background:#fbe9e7; color:#bf360c; }
.badge-ac{ background:#e8f5e9; color:#1b5e20; }

.thumb{
  width:56px;
  height:40px;
  object-fit:contain;
  background:#fff;
  border:1px solid var(--border);
  border-radius:10px;
  padding:4px;
}

.tools{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.notice{
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  margin-bottom:14px;
}
.notice.ok{ border-color:#bbf7d0; background:#f0fdf4; }
.notice.err{ border-color:#fecaca; background:#fef2f2; }

.searchbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.searchbar input{
  flex:1;
  min-width:240px;
}

.hr{ height:1px; background:var(--border); margin:14px 0; }

/* Modal simple */
.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:2000;
}
.modal.open{ display:flex; }
.modal .box{
  width:min(720px, 100%);
  background:#fff;
  border-radius:16px;
  box-shadow: 0 18px 40px rgba(0,0,0,.22);
  padding:16px;
}
.modal .top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.modal .top h3{ margin:0; font-size:16px; }
.modal .close{
  border:0;
  background:#fff;
  cursor:pointer;
  font-weight:900;
  font-size:18px;
}
.preview{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}
.preview img{
  width:110px; height:80px; object-fit:contain;
  border:1px solid var(--border);
  border-radius:12px;
  padding:6px;
  background:#fff;
}
