:root {
  color-scheme: light;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #eef1f5;
  color: #1d2a35;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #12324d;
  color: #fff;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.container {
  padding: 16px;
  max-width: 1280px;
  margin: 0 auto;
}

.error-box {
  background: #fdebec;
  color: #8d1f1f;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #f1b5b7;
}

.hint {
  background: #fff;
  border-left: 4px solid #0f2d46;
  padding: 10px 12px;
  border-radius: 6px;
}

.chip,
.adm-btn {
  background: #fff;
  border: none;
  color: #0f2d46;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  text-decoration: none;
}

.floating-menu {
  position: sticky;
  top: 76px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(238, 241, 245, 0.96);
  backdrop-filter: blur(4px);
  border: 1px solid #d3d9e1;
  border-radius: 12px;
  padding: 10px;
  margin: 14px 0;
}

.cat-btn {
  border: 1px solid #0f2d46;
  background: #ffffff;
  color: #0f2d46;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.cat-btn:hover {
  background: #e8f1fa;
}

.cat-btn.active {
  background: #0f2d46;
  color: #fff;
  border-color: #0f2d46;
}

.category-panel { display: block; scroll-margin-top: 130px; margin-bottom: 20px; }

.category-panel h2 {
  margin: 10px 0 12px;
}

.machine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  align-items: start;
}

.machine-card {
  background: #fff;
  border: 1px solid #d7dbe0;
  border-radius: 8px;
  padding: 8px 6px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
}

.machine-button {
  border: 1px solid #ccd4de;
  background: #f7f9fc;
  border-radius: 8px;
  width: 76px;
  height: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.machine-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.machine-meta {
  text-align: center;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.machine-meta strong {
  font-size: 0.73rem;
}

.machine-meta small {
  font-size: 0.62rem;
  color: #5a6570;
}

.light {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid #222;
}

.light-red { background: #d92f2f; }
.light-green { background: #0fbd44; }

.is-delivered {
  border-color: #9bcca8;
  background: #f5fff7;
}

.machine-hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
}

.hidden { display: none; }

.modal-card {
  width: min(400px, 92vw);
  background: #fff;
  border-radius: 10px;
  padding: 16px;
}

.admin-section {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-form input,
.admin-form button,
.admin-form label {
  padding: 8px;
}

.grid-4 input,
.grid-6 input { flex: 1; min-width: 150px; }

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.danger {
  background: #c62828;
  color: #fff;
  border: none;
}

@media (max-width: 640px) {
  .top-bar h1 { font-size: 1.1rem; }
  .floating-menu { top: 118px; }
  .machine-grid { grid-template-columns: repeat(3, minmax(90px, 1fr)); }
}
