:root{
  --bg:#0b1220;
  --panel:#0f1a2e;
  --card:#111f38;
  --muted:#9bb0d1;
  --text:#e9f0ff;
  --line:rgba(255,255,255,.08);
  --shadow: 0 12px 30px rgba(0,0,0,.35);

  --ok:#1fbf75;
  --bad:#ff4d6d;
  --warn:#f6c945;
  --neutral:#8aa0c2;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 500px at 20% -10%, #1a2d57, transparent),
              radial-gradient(900px 400px at 90% 0%, #2b1a57, transparent),
              var(--bg);
  color: var(--text);
}

a{ color: inherit; }

.container{
  width:min(1525px, 92vw);
  margin: 0 auto;
}

.topbar{
  position: sticky;
  top:0;
  z-index:10;
  background: rgba(11,18,32,.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 0;
  gap: 16px;
}

.brand{ display:flex; align-items:center; gap:10px; }
.brand__logo{
  width:40px; height:40px;
  display:grid; place-items:center;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.brand__title{ font-weight:800; letter-spacing:.2px; }
.brand__sub{ color: var(--muted); font-size: 12px; margin-top:2px; }

.topnav{ display:flex; gap:10px; }
.topnav__link{
  text-decoration:none;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--muted);
}
.topnav__link:hover{
  border-color: var(--line);
  color: var(--text);
  background: rgba(255,255,255,.04);
}

.userbox{ display:flex; align-items:center; gap:10px; }
.userbox__name{ color: var(--muted); font-size: 13px; }

.footer{
  margin-top: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 14px 0;
}

.h1{ font-size: 28px; margin: 18px 0 6px; }
.muted{ color: var(--muted); }

.pills{ display:flex; flex-wrap:wrap; gap:10px; margin-top:10px; }
.pill{
  border:1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255,255,255,.03);
  color: var(--muted);
}
.pill b{ color: var(--text); }

.btn{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
}
.btn:hover{ background: rgba(255,255,255,.10); }
.btn--ghost{
  background: transparent;
}
.btn--ok{
  border-color: rgba(31,191,117,.35);
}
.btn--bad{
  border-color: rgba(255,77,109,.35);
}

.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 14px;
}
.table th, .table td{
  border-bottom: 1px solid var(--line);
  padding: 10px 10px;
  text-align:left;
  color: var(--muted);
}
.table th{ color: var(--text); font-weight: 700; }
.table tr:hover td{ background: rgba(255,255,255,.03); }

.hr{ border:0; border-top:1px solid var(--line); margin: 12px 0; }

/* Tablero */
.board-wrap{
  overflow:auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
  box-shadow: var(--shadow);
}
.grid{
  display:grid;
  grid-template-columns: 60px repeat(15, 86px);
  gap: 8px;
  align-items: stretch;
  padding: 12px;
  min-width: 60px + 15*86px;
}
.head{
  font-weight:800;
  text-align:center;
  color: var(--muted);
  padding: 6px 0;
}
.rowhead{
  font-weight:800;
  text-align:center;
  padding: 10px 0;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  border-radius: 12px;
}

.cell{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  min-height: 64px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  text-align:center;
  transition: transform .06s ease, background .12s ease, border-color .12s ease;
}
.cell:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.20);
}
.cell--link{ text-decoration:none; color: inherit; display:block; }

.libre{ background: rgba(31,191,117,.12); }
.ocupado{ background: rgba(255,77,109,.12); }
.fuera{ background: rgba(138,160,194,.10); }

.tag{ font-size: 12px; opacity: .9; color: var(--muted); }
.dominio{ font-weight: 900; margin-top: 6px; color: var(--text); }
.codigo{ font-size: 12px; opacity: .9; color: var(--muted); }


.h2{ font-size: 18px; font-weight: 800; margin:0; }

.grid-actions{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.action{
  display:block;
  text-decoration:none;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,.03);
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.action:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.18);
}
.action__icon{
  width: 42px; height: 42px;
  display:grid; place-items:center;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  margin-bottom: 10px;
  font-size: 18px;
}
.action__title{ font-weight: 900; margin-bottom: 4px; }
.action__desc{ color: var(--muted); font-size: 13px; line-height: 1.3; }

.action--disabled{
  opacity: .55;
  cursor: not-allowed;
}
.action--disabled:hover{
  transform:none;
  background: rgba(255,255,255,.03);
  border-color: var(--line);
}

@media (max-width: 980px){
  .grid-actions{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px){
  .grid-actions{ grid-template-columns: 1fr; }
}

.table a{
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}
.table a:hover{
  text-decoration: underline;
}

/* Forms */
.field-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-label{
  font-weight: 800;
  margin-bottom: 6px;
}

.field-req{ color: var(--warn); }

.field-error{
  margin-top: 6px;
  color: var(--bad);
  font-weight: 700;
  font-size: 13px;
}

.form-errors{
  border-color: rgba(255,77,109,.35) !important;
}

input, select, textarea{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  outline: none;
}

input:focus, select:focus, textarea:focus{
  border-color: rgba(255,255,255,.20);
  background: rgba(255,255,255,.06);
}

textarea{ min-height: 90px; resize: vertical; }

@media (max-width: 860px){
  .field-grid{ grid-template-columns: 1fr; }
}

.section-gap{ height: 16px; }

    /* Grilla compacta tipo ficha */
    .info-grid{
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px 14px;
      margin-top: 10px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: rgba(255,255,255,.02);
    }
    .kv{
      border: 1px solid rgba(255,255,255,.06);
      border-radius: 12px;
      padding: 10px 12px;
      background: rgba(255,255,255,.02);
      min-height: 54px;
      display:flex;
      flex-direction:column;
      justify-content:center;
    }
    .kv.wide{
      grid-column: 1 / -1;
    }
    .k{
      font-size: 15px;
      letter-spacing: .2px;
      color: var(--muted);
      margin-bottom: 4px;
      font-weight: 800;
      text-transform: uppercase;
    }
    .v{
      color: var(--text);
      font-weight: 800;
      line-height: 1.2;
      word-break: break-word;
    }
    .mono{
      font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
      font-weight: 700;
      font-size: 15px;
    }

    /* Auditoría más compacta */
    .table-compact th, .table-compact td{
      padding: 8px 10px;
      font-size: 15px;
    }

    @media (max-width: 860px){
      .info-grid{ grid-template-columns: 1fr; }
      .kv.wide{ grid-column: auto; }
    }