* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f3f5f8;
  color: #1d2630;
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card, .panel {
  background: #fff;
  border: 1px solid #d9dfe7;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(26, 37, 49, 0.06);
}
.login-card {
  width: 100%;
  max-width: 420px;
  padding: 28px;
}
.login-card h1 { margin: 0 0 10px; }
.login-card p { margin: 0 0 16px; color: #55606d; }
.login-card input,
.login-card button,
input,
select,
textarea,
button,
a.logout-btn {
  font: inherit;
}
.login-card input,
input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
}
.login-card button,
button,
a.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: #1e66f5;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .logout-btn:hover, .login-card button:hover { filter: brightness(0.96); }
.error { margin-top: 12px; color: #b42318; font-weight: 700; }
.app-shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 18px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
.topbar h1 { margin: 0 0 4px; }
.subline { color: #5d6b7b; font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.save-state {
  padding: 8px 10px;
  background: #eef3ff;
  color: #214a9b;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.save-state[data-type="error"] { background: #fff1f1; color: #b42318; }
.panel { padding: 16px; margin-bottom: 16px; }
.controls-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
}
.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-group label { font-weight: 700; font-size: 14px; }
.actions-row {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.print-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
}
.print-wrap input { width: 90px; }
.table-panel { padding: 0; overflow: hidden; }
.table-wrap { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1050px;
}
thead th {
  position: sticky;
  top: 0;
  background: #eef2f8;
  z-index: 1;
}
th, td {
  border-bottom: 1px solid #dbe2ea;
  border-right: 1px solid #e7edf4;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}
th:last-child, td:last-child { border-right: none; }
.row-index { font-weight: 700; width: 60px; }
.color-select {
  min-width: 120px;
  font-weight: 700;
}
.select-red { background: #ffe0e0; }
.select-green { background: #e3f9e6; }
.select-blue { background: #e4eeff; }
.select-yellow { background: #fff8d5; }
.select-orange { background: #ffead8; }
.select-purple { background: #f0e4ff; }
.row-color td { transition: background-color 0.2s ease; }
.row-red td { background: #ffe0e0; }
.row-green td { background: #e3f9e6; }
.row-blue td { background: #e4eeff; }
.row-yellow td { background: #fff8d5; }
.row-orange td { background: #ffead8; }
.row-purple td { background: #f0e4ff; }
.empty-state {
  padding: 24px 16px;
  color: #607081;
}
.delete-btn { background: #c93434; }
@media (max-width: 980px) {
  .controls-grid { grid-template-columns: 1fr; }
  .print-wrap { margin-left: 0; }
}
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .panel, .app-shell { box-shadow: none; margin: 0; padding: 0; }
}
