*{ box-sizing:border-box; }

:root{
  --prim:#0EA5E9;
  --sec:#0369A1;
  --bg:#F1F5F9;
  --card:#fff;
  --txt:#1E293B;
  --ok:#10B981;
  --bad:#EF4444;
  --muted:#94A3B8;
  --header-h: 76px;
}

body{
  margin:0;
  font-family:Arial, Helvetica, sans-serif;
  background:var(--bg);
  color:var(--txt);
  overflow-x:hidden;
}

.backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.35);
  display:none;
  z-index:80;
}
.backdrop.show{ display:block; }

header{
  background:white;
  padding:12px 22px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  box-shadow:0 2px 6px rgba(0,0,0,.1);
  position:fixed;
  top:0;
  left:0;
  width:100%;
  z-index:100;
}

.left-header{
  display:flex;
  align-items:center;
  gap:14px;
}

.menu-btn{
  font-size:26px;
  background:none;
  border:none;
  cursor:pointer;
  color:var(--prim);
}


.user-box{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  background:white;
  padding:8px 14px;
  border-radius:22px;
  box-shadow:0 2px 6px rgba(0,0,0,.12);
  margin-right:6px;
  max-width:280px;
  border:1px solid rgba(0,0,0,.06);
}

.user-icon{
  width:36px;
  height:36px;
  border-radius:50%;
  background:var(--prim);
  color:white;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  flex-shrink:0;
}

.user-name{
  max-width:160px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-weight:bold;
}

.caret{ font-size:14px; opacity:.8; }

.user-menu{
  display:none;
  position:absolute;
  top:54px;
  right:0;
  background:white;
  width:220px;
  border-radius:14px;
  box-shadow:0 10px 22px rgba(0,0,0,.18);
  overflow:hidden;
  z-index:200;
  border:1px solid rgba(0,0,0,.06);
}

.user-menu::before{
  content:"";
  position:absolute;
  top:-8px;
  right:18px;
  width:14px;
  height:14px;
  background:white;
  transform:rotate(45deg);
  border-left:1px solid rgba(0,0,0,.06);
  border-top:1px solid rgba(0,0,0,.06);
}

.user-menu button{
  width:100%;
  padding:13px 14px;
  border:none;
  background:none;
  cursor:pointer;
  text-align:left;
  font-size:15px;
}
.user-menu button:hover{ background:var(--bg); }


aside{
  width:240px;
  background:var(--sec);
  color:white;
  position:fixed;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));

  left:-240px;
  padding-top:10px;
  transition:left .25s ease;
  z-index:90;
}
aside.open{ left:0; }

aside button{
  width:100%;
  background:none;
  border:none;
  color:white;
  padding:14px 18px;
  font-size:16px;
  cursor:pointer;
  text-align:left;
}
aside button:hover{ background:rgba(255,255,255,.15); }

main{
  margin-left:0;
  margin-top: var(--header-h);
  padding:24px;
  transition:margin-left .25s ease;
}
main.push{ margin-left:240px; }

.seccion{ display:none; }

.card{
  background:var(--card);
  padding:22px;
  border-radius:14px;
  margin-bottom:22px;
  box-shadow:0 2px 6px rgba(0,0,0,.1);
}

label{
  display:block;
  margin-top:10px;
  font-weight:bold;
}

input, select, textarea{
  width:100%;
  padding:10px;
  margin-top:5px;
  border-radius:10px;
  border:1px solid #cbd5e1;
  background:white;
}

textarea{ min-height:90px; }

button.prim{
  margin-top:16px;
  padding:12px;
  width:100%;
  background:var(--prim);
  color:white;
  border:none;
  border-radius:10px;
  cursor:pointer;
  font-weight:bold;
}
button.prim:hover{ filter:brightness(.95); }
.w-auto{ width:auto !important; }

.row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.col{
  flex:1;
  min-width:240px;
}

.inline-field{
  display:flex;
  gap:10px;
  align-items:center;
  margin-top:5px;
}
.inline-field input{ margin-top:0; flex:1; }
.inline-field button{ margin-top:0; }

.cal-toolbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  margin-bottom:12px;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:12px;
  background:var(--bg);
  font-size:14px;
  white-space:nowrap;
}

.actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.btn-mini{
  background:var(--bg);
  border:1px solid #d3e1eb;
  color:var(--txt);
  padding:10px 12px;
  border-radius:10px;
  cursor:pointer;
  font-weight:bold;
}
.btn-mini:hover{ border-color:var(--prim); }

table.cal{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:14px;
  box-shadow:0 3px 8px rgba(0,0,0,.08);
  background:white;
}

table.cal th, table.cal td{
  border-bottom:1px solid #e8eef5;
  border-right:1px solid #e8eef5;
  padding:12px;
  text-align:center;
  font-size:14px;
}
table.cal th{
  background:var(--bg);
  font-weight:bold;
}
table.cal tr:last-child td{ border-bottom:none; }
table.cal td:last-child, table.cal th:last-child{ border-right:none; }

.slot{
  display:inline-block;
  padding:8px 10px;
  border-radius:10px;
  font-weight:bold;
  min-width:120px;
  user-select:none;
  border:1px solid transparent;
}

.slot.disponible{
  background:rgba(16,185,129,.12);
  color:#047857;
  border-color:rgba(16,185,129,.35);
  cursor:pointer;
}

.slot.no{
  background:rgba(148,163,184,.12);
  color:#334155;
  border-color:rgba(148,163,184,.35);
  cursor:pointer;
}

.slot.ocupado{
  background:rgba(239,68,68,.10);
  color:#991B1B;
  border-color:rgba(239,68,68,.30);
  cursor:pointer;
}

.legend{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
  justify-content:center;
}

.dot{ width:10px; height:10px; border-radius:50%; display:inline-block; }
.dot.ok{ background:var(--ok); }
.dot.bad{ background:var(--bad); }
.dot.muted{ background:var(--muted); }

.hint{
  font-size:13px;
  color:#475569;
  text-align:center;
  margin-top:8px;
}
.small{
  font-size:13px;
  color:#475569;
  margin:0;
}

table.simple{ width:100%; border-collapse:collapse; }
table.simple th, table.simple td{
  padding:10px;
  border-bottom:1px solid #e5e7eb;
  text-align:left;
}
.badge{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  font-weight:bold;
  font-size:12px;
  background:var(--bg);
}

@media (max-width: 980px){
  main.push{ margin-left:0; }
}
