:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  background: #eef1f4;
  color: #1f2933;
}

body {
  margin: 0;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 19px;
}

.topbar p,
.muted {
  color: #687482;
  margin-top: 6px;
}

.tabs {
  display: inline-flex;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

.tab,
button {
  appearance: none;
  border: 0;
  background: #fff;
  color: #1f2933;
  font: inherit;
  cursor: pointer;
}

.tab {
  padding: 10px 14px;
  border-right: 1px solid #b8c1cc;
}

.tab:last-child {
  border-right: 0;
}

.tab.active,
button[type="submit"],
.section-head button {
  background: #2f6f5e;
  color: #fff;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metrics article,
.panel,
.table-wrap {
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  background: #fff;
}

.metrics article {
  padding: 14px;
}

.metrics span {
  display: block;
  color: #687482;
  font-size: 13px;
  margin-bottom: 8px;
}

.metrics strong {
  font-size: 28px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.section-head.compact {
  justify-content: flex-start;
}

.section-head button,
button[type="submit"] {
  border-radius: 7px;
  padding: 10px 14px;
}

.secondary {
  width: fit-content;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  padding: 8px 11px;
  margin-bottom: 10px;
}

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

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.points-table {
  table-layout: fixed;
}

.points-table th:nth-child(1),
.points-table td:nth-child(1) {
  width: 210px;
}

.points-table th:nth-child(2),
.points-table td:nth-child(2) {
  width: 110px;
}

.points-table th:nth-child(4),
.points-table td:nth-child(4) {
  width: 150px;
}

.points-table th:nth-child(5),
.points-table td:nth-child(5) {
  width: 260px;
}

.points-table td {
  overflow-wrap: anywhere;
}

.points-table td:nth-child(5) {
  white-space: normal;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #e3e8ee;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #687482;
  font-size: 13px;
  font-weight: 600;
}

tr:last-child td {
  border-bottom: 0;
}

.track-title {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: #edf3f0;
  color: #2f6f5e;
  font-size: 13px;
}

.status.offline {
  background: #f5eeee;
  color: #9b2c2c;
}

.danger {
  border: 1px solid #cf8d8d;
  border-radius: 7px;
  padding: 8px 10px;
  color: #9b2c2c;
}

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

.clock-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(560px, 1.65fr) minmax(300px, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.window-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.panel.wide {
  margin-top: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: #3a4652;
  font-size: 14px;
}

input,
select,
textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  padding: 9px 10px;
  font: inherit;
}

textarea {
  resize: vertical;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.client-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.client-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  padding: 14px;
  text-align: left;
}

.client-row:hover {
  border-color: #2f6f5e;
  background: #f7faf8;
}

.client-row strong,
.client-row small,
.client-row-meta {
  display: block;
}

.client-row small,
.client-row-meta {
  color: #687482;
  font-size: 13px;
  margin-top: 4px;
}

.client-row-meta {
  text-align: right;
}

.client-detail[hidden],
#adminOverview[hidden] {
  display: none;
}

.playlist-list,
.location-list,
.clock-category-library,
.clock-list {
  display: grid;
  gap: 8px;
}

.hour-schedule {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hour-slot {
  display: grid;
  gap: 8px;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  text-align: left;
}

.hour-slot span {
  color: #687482;
  font-size: 13px;
  font-weight: 700;
}

.hour-slot strong {
  min-height: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hour-slot:hover {
  border-color: #9fb0c2;
  background: #f8fafc;
}

.hour-slot.selected {
  border-color: #2f6f5e;
  box-shadow: 0 0 0 2px rgba(47, 111, 94, 0.14);
  background: #f4faf7;
}

.clock-category,
.clock-card {
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  background: #fff;
}

.clock-category {
  cursor: grab;
  padding: 10px;
}

.clock-category:active {
  cursor: grabbing;
}

.clock-category strong,
.clock-category small {
  display: block;
}

.clock-category small,
.clock-foot,
.clock-empty {
  color: #687482;
  font-size: 13px;
  margin-top: 4px;
}

.clock-card {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.clock-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.clock-head button,
.clock-item button {
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  padding: 8px 10px;
}

.clock-dropzone {
  display: grid;
  gap: 6px;
  min-height: 54px;
  border: 1px dashed #b8c1cc;
  border-radius: 8px;
  padding: 8px;
  background: #fafbfc;
}

.clock-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid #d9e0e7;
  border-radius: 7px;
  background: #fff;
  padding: 8px;
}

.clock-item small {
  display: block;
  color: #687482;
  margin-top: 2px;
}

.clock-context-menu {
  position: fixed;
  z-index: 30;
  display: grid;
  gap: 4px;
  min-width: 210px;
  max-width: 280px;
  padding: 6px;
  border: 1px solid #b8c1cc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(31, 41, 51, 0.18);
}

.clock-context-menu[hidden] {
  display: none;
}

.clock-context-menu button {
  width: 100%;
  border-radius: 6px;
  padding: 9px 10px;
  text-align: left;
}

.clock-context-menu button:hover {
  background: #edf3f0;
}

.playlist-row,
.location-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  padding: 10px;
}

.playlist-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.playlist-row input {
  width: auto;
}

.playlist-row small,
.location-card small {
  display: block;
  color: #687482;
  margin-top: 3px;
}

.row-actions {
  display: flex;
  gap: 5px;
}

.row-actions button {
  width: 34px;
  height: 32px;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
}

.row-actions button:disabled {
  color: #9aa5b1;
  cursor: default;
}

.location-card {
  align-items: flex-start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.location-card a {
  color: #2f6f5e;
  font-size: 13px;
}

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

.point-playlist-row td {
  background: #f7faf8;
}

.point-playlist {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  max-width: 100%;
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  overflow-wrap: anywhere;
}

.point-playlist-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.point-playlist-head small {
  color: #687482;
}

.now-grid,
.playlist-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.now-grid > div,
.playlist-columns > div {
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  padding: 10px;
}

.now-grid strong,
.now-grid span,
.playlist-columns strong {
  display: block;
}

.now-grid span {
  color: #3a4652;
  margin-top: 5px;
}

.playlist-columns ol {
  margin: 8px 0 0;
  padding-left: 20px;
}

.playlist-columns li {
  margin-bottom: 5px;
  color: #3a4652;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.category-card {
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.category-card strong,
.category-card span {
  display: block;
}

.category-card span {
  color: #687482;
  margin-top: 5px;
  font-size: 13px;
}

.card {
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.card p {
  color: #687482;
  margin-top: 4px;
}

code {
  font-family: Consolas, monospace;
}

@media (max-width: 1120px) {
  .clock-layout {
    grid-template-columns: 1fr;
  }

  .hour-schedule {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar,
  .grid,
  .clock-layout,
  .window-grid,
  .now-grid,
  .playlist-columns,
  .hour-schedule {
    display: grid;
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tab {
    border-right: 0;
    border-bottom: 1px solid #b8c1cc;
  }
}
