
:root {
  --bg: #fffdf5;
  --bg-2: #fff7db;
  --card: rgba(255,255,255,.88);
  --card-2: #fffdf7;
  --text: #5a4300;
  --muted: #8b6b00;
  --border: rgba(234, 179, 8, .22);
  --accent: #facc15;
  --accent-2: #f59e0b;
  --red: #ef4444;
  --yellow: #facc15;
  --green: #22c55e;
  --gray: #d6d3c9;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #fffef8 0%, #fff7d6 52%, #ffe9a8 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card, .panel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 16px 50px rgba(202, 138, 4, .12);
  backdrop-filter: blur(8px);
}
.login-card { width: 100%; max-width: 420px; padding: 28px; }
.login-card h1 { margin-top: 0; }
input, select, button {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 15px;
}
input, select {
  background: rgba(255,255,255,.85);
  color: var(--text);
}
button, .btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #5a4300;
  cursor: pointer;
  border: 0;
  font-weight: 700;
}
button:hover, .btn:hover { filter: brightness(1.03); }
.btn.ghost {
  background: rgba(255,255,255,.62);
  border: 1px solid var(--border);
}
.topbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:16px 20px;
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  backdrop-filter: blur(12px);
  background: rgba(255, 252, 235, .86);
  z-index:10;
}
.topbar-actions { display:flex; gap:10px; }
.page { padding: 20px; }
.panel-card { padding: 18px; }
.toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.legend { display:flex; gap:16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.dot { display:inline-block; width:10px; height:10px; border-radius:99px; margin-right:6px; }
.dot.gray { background: #c8c3b0; }
.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.badge { padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: bold; }
.badge.online { background: rgba(34,197,94,.12); color: #15803d; border: 1px solid rgba(34,197,94,.25); }
.badge.offline { background: rgba(239,68,68,.1); color: #b91c1c; border: 1px solid rgba(239,68,68,.22); }
.buttons-grid {
  display:grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 12px;
}
.op-btn {
  min-height: 102px;
  text-align:left;
  padding:14px;
  background: linear-gradient(180deg, #fffef8, #ffefb8);
  border: 1px solid rgba(234, 179, 8, .28);
  position:relative;
  transition: .15s ease;
  color: var(--text);
  box-shadow: 0 8px 18px rgba(234,179,8,.08);
}
.op-btn:hover { transform: translateY(-1px); }
.op-btn.is-active { outline: 2px solid rgba(245, 158, 11, .55); }
.op-btn.is-red {
  background: linear-gradient(180deg, #fda4a4, #f87171);
  color: #651616;
  border-color: rgba(239,68,68,.35);
}
.op-btn.is-yellow {
  background: linear-gradient(180deg, #fde68a, #facc15);
  color:#5a4300;
}
.op-btn .idx {
  display:inline-flex;
  width:30px;
  height:30px;
  border-radius:999px;
  background: rgba(255,255,255,.62);
  align-items:center;
  justify-content:center;
  font-weight:bold;
  margin-bottom: 10px;
}
.op-btn .label {
  display:block;
  font-weight:bold;
  font-size: 15px;
  line-height:1.2;
  min-height: 38px;
}
.op-btn .meta {
  display:block;
  margin-top:10px;
  font-size: 13px;
  opacity: .9;
}
.empty { padding: 30px; text-align:center; color: var(--muted); }
.alert { padding: 12px 14px; border-radius: 14px; margin-bottom: 16px; }
.alert.success { background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.18); }
.alert.error { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.18); }
.stack-form { display:grid; gap:10px; }
.admin-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:16px; }
.full-width { grid-column: 1 / -1; }
.labels-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 16px; }
.muted { color: var(--muted); margin-left:10px; }
.op-btn:disabled, .op-btn.is-disabled { opacity: .72; cursor: not-allowed; transform: none; }
.op-btn.is-red:disabled, .op-btn.is-red.is-disabled { box-shadow: inset 0 0 0 2px rgba(255,255,255,.28); }

@media (max-width: 1400px) {
  .buttons-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .admin-grid { grid-template-columns: 1fr; }
  .buttons-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .buttons-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .topbar { align-items:flex-start; }
  .topbar-actions { width:100%; }
  .buttons-grid { grid-template-columns: 1fr; }
}
