:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-soft: #f3f7f8;
  --text: #172026;
  --muted: #64727f;
  --faint: #8a97a3;
  --border: #dde5ea;
  --border-strong: #cad6dc;
  --accent: #0f8f8a;
  --accent-soft: #e5f5f3;
  --green: #15965d;
  --green-soft: #e8f7ef;
  --amber: #c27803;
  --amber-soft: #fff4db;
  --red: #d93f45;
  --red-soft: #fdebec;
  --blue: #2a68b8;
  --blue-soft: #eaf2ff;
  --shadow: 0 14px 42px rgba(28, 42, 52, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

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

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(180deg, rgba(15, 143, 138, 0.06), rgba(42, 104, 184, 0.03)),
    var(--bg);
}

.auth-panel {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.auth-brand h1 {
  font-size: 22px;
  line-height: 1.25;
}

.auth-brand p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
}

.auth-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 700;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(17, 32, 38, 0.08);
}

.auth-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #36454f;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 143, 138, 0.12);
}

textarea {
  min-height: 76px;
  padding-top: 10px;
  resize: vertical;
}

.message {
  min-height: 20px;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.message.error {
  color: var(--red);
}

.message.success {
  color: var(--green);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.app-shell.sidebar-collapsed .sidebar-title {
  justify-content: center;
  padding: 0;
}

.app-shell.sidebar-collapsed .sidebar-title span,
.app-shell.sidebar-collapsed .side-item {
  font-size: 0;
}

.app-shell.sidebar-collapsed .side-item {
  justify-content: center;
  padding: 0;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar-title {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  font-size: 17px;
  font-weight: 800;
}

.side-nav {
  display: grid;
  gap: 5px;
  padding: 14px 10px;
}

.side-item {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #3d4b55;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.side-item:hover,
.side-item.active {
  background: var(--accent-soft);
  color: #0b6f6a;
}

.side-item svg,
.icon-button svg,
.ghost-button svg,
.primary-button svg,
.command-grid svg,
.search-box svg,
.note-list svg,
.empty-state svg,
.muted-detail svg,
.user-chip svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex: 0 0 auto;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
}

.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 7;
}

.hospital-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.hospital-control select {
  width: 250px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding-left: 8px;
}

.user-chip strong,
.user-chip span {
  display: block;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 13px;
}

.user-chip span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.icon-button,
.ghost-button,
.primary-button,
.link-button {
  border-radius: 7px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: #273741;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.ghost-button {
  padding: 0 13px;
}

.ghost-button.icon-only {
  width: 40px;
  padding: 0;
}

.primary-button {
  padding: 0 15px;
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.icon-button:disabled,
.ghost-button:disabled,
.primary-button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.primary-button.compact {
  min-height: 38px;
}

.link-button {
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  color: var(--accent);
  background: transparent;
}

.page-title {
  padding: 24px 24px 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.page-title h2 {
  font-size: 26px;
  line-height: 1.2;
}

.page-title p {
  margin-top: 7px;
  color: var(--muted);
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(68px, 1fr));
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.segmented button.active {
  color: #086c68;
  background: var(--accent-soft);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 24px 16px;
}

.summary-card,
.main-panel,
.detail-panel,
.activity-panel,
.asset-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(17, 28, 36, 0.03);
}

.summary-card {
  min-height: 112px;
  padding: 16px;
  display: grid;
  gap: 9px;
}

.summary-card span {
  color: #32434d;
  font-weight: 800;
}

.summary-card strong {
  font-size: 30px;
  line-height: 1;
  color: var(--accent);
}

.summary-card small {
  color: var(--muted);
}

.summary-card small b {
  color: var(--text);
}

.content-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: start;
  gap: 12px;
  padding: 0 24px;
}

.main-panel {
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.table-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.table-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.search-box {
  position: relative;
  width: min(420px, 100%);
  min-width: 0;
  flex: 1 1 420px;
  display: block;
  color: var(--muted);
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  padding-left: 38px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}

th,
td {
  height: 42px;
  padding: 0 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

th:nth-child(1),
td:nth-child(1) { width: 18%; }

th:nth-child(2),
td:nth-child(2) { width: 18%; }

th:nth-child(3),
td:nth-child(3) { width: 12%; }

th:nth-child(4),
td:nth-child(4) { width: 15%; }

th:nth-child(5),
td:nth-child(5) { width: 14%; }

th:nth-child(6),
td:nth-child(6) { width: 12%; }

th:nth-child(7),
td:nth-child(7) { width: 11%; }

th {
  background: #f8fafb;
  color: #5a6873;
  font-size: 12px;
  font-weight: 800;
}

td {
  color: #273842;
  font-size: 13px;
}

tr[data-selected="true"] {
  background: #edf8f7;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: #f4f8f9;
}

.kiosk-code {
  display: grid;
  gap: 2px;
}

.kiosk-code strong {
  font-size: 13px;
}

.kiosk-code span {
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  min-width: 76px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.status-online {
  color: var(--green);
  background: var(--green-soft);
}

.status-offline {
  color: var(--red);
  background: var(--red-soft);
}

.status-warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.text-green {
  color: var(--green);
  font-weight: 800;
}

.text-red {
  color: var(--red);
  font-weight: 800;
}

.text-amber {
  color: var(--amber);
  font-weight: 800;
}

.text-blue {
  color: var(--blue);
  font-weight: 800;
}

.detail-panel {
  min-height: 0;
  max-height: calc(100vh - 170px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  position: sticky;
  top: 76px;
  overflow: hidden;
}

.summary-grid:not(.view-hidden) + .content-grid .detail-panel {
  max-height: calc(100vh - 318px);
  position: static;
}

.detail-header {
  min-width: 0;
  min-height: 76px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.detail-header > div:first-child {
  min-width: 0;
  flex: 1 1 130px;
}

.detail-header-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.detail-header h3 {
  min-width: 0;
  font-size: 17px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.detail-header span {
  color: var(--muted);
  display: block;
  margin-top: 6px;
  line-height: 1.4;
}

.detail-body {
  min-width: 0;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-message {
  margin: 0 16px 12px;
}

.muted-detail {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  gap: 12px;
}

.muted-detail svg {
  width: 36px;
  height: 36px;
}

.detail-list {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.detail-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.detail-row span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-row span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.agent-setup {
  min-width: 0;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.agent-setup-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  cursor: pointer;
  list-style: none;
}

.agent-setup-heading::-webkit-details-marker {
  display: none;
}

.agent-setup-heading > span {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.agent-setup-heading strong {
  font-size: 13px;
}

.agent-setup-heading small,
.agent-field-grid span,
.agent-token-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.agent-setup-heading svg {
  width: 18px;
  height: 18px;
  transition: transform 140ms ease;
}

.agent-setup[open] .agent-setup-heading svg {
  transform: rotate(180deg);
}

.agent-setup-content {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

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

.agent-field-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #f8fafb;
}

.agent-field-grid strong {
  display: block;
  margin-top: 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.agent-env-block {
  max-width: 100%;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #101820;
  color: #e7f3f2;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent-setup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.agent-setup-actions button {
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  font-size: 12px;
}

.command-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  border-top: 1px solid var(--border);
}

.command-grid button {
  min-height: 52px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fbfcfd;
  color: #273842;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  gap: 5px;
}

.command-grid button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
  padding: 12px 24px 24px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 24px 0;
}

.asset-grid.single-view,
.bottom-grid.single-view {
  grid-template-columns: minmax(0, 1fr);
}

.asset-panel {
  min-width: 0;
  overflow: hidden;
}

.license-panel {
  grid-column: 1 / -1;
}

.admin-user-panel {
  grid-column: 1 / -1;
}

.panel-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.asset-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.media-upload-form {
  grid-template-columns: minmax(0, 1.3fr) 150px minmax(260px, 1fr);
}

.media-upload-form > label {
  min-width: 0;
}

.media-upload-form > label input {
  width: 100%;
  min-width: 0;
}

.media-upload-form .file-field {
  grid-column: auto;
}

.license-form {
  display: grid;
  grid-template-columns: 132px 112px minmax(0, 1fr) 132px 132px 132px;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.license-form .wide-field,
.license-form .form-actions,
.license-form .message {
  grid-column: 1 / -1;
  margin-top: 0;
}

.license-core-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.license-core-summary > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 16px;
  border-right: 1px solid var(--border);
}

.license-core-summary > div:last-child {
  border-right: 0;
}

.license-core-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.license-core-summary strong {
  font-size: 20px;
  line-height: 1.15;
}

.license-core-table-head,
.license-core-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) 100px 130px 150px 24px;
  gap: 12px;
  align-items: center;
}

.license-core-table-head {
  min-height: 34px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.license-core-list {
  max-height: 280px;
  overflow-y: auto;
  border-bottom: 1px solid var(--border);
}

.license-core-row {
  width: 100%;
  min-height: 58px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.license-core-row:last-child {
  border-bottom: 0;
}

.license-core-row:hover {
  background: var(--accent-soft);
}

.license-core-row > span,
.license-core-row > em {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.license-core-row > i {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.license-core-kiosk strong,
.license-core-kiosk small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.license-core-kiosk strong {
  color: var(--text);
  font-size: 13px;
}

.license-core-kiosk small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.license-core-row > .text-green {
  color: var(--green);
}

.license-core-row > .text-amber {
  color: var(--amber);
}

.license-core-row > .text-red {
  color: var(--red);
}

.license-legacy-heading {
  min-height: 42px;
  border-bottom: 1px solid var(--border);
}

.license-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px 360px;
}

.license-list {
  display: grid;
  align-content: start;
  border-right: 1px solid var(--border);
}

.license-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
}

.license-row:hover,
.license-row.selected {
  background: var(--accent-soft);
}

.license-row strong,
.license-row span,
.license-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.license-row strong {
  display: block;
  font-size: 13px;
}

.license-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.license-row span,
.license-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.license-row em.text-green {
  color: var(--green);
}

.license-row em.text-amber {
  color: var(--amber);
}

.license-row em.text-red {
  color: var(--red);
}

.license-assignment-form {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  background: var(--surface-soft);
}

.license-assignment-list .assignment-row {
  grid-template-columns: minmax(0, 1fr) 72px;
}

.license-assignment-list button {
  min-height: 34px;
}

.asset-form.package-form {
  grid-template-columns: 112px minmax(0, 1fr);
}

.asset-form .file-field {
  grid-column: 1 / -1;
}

.asset-form .primary-button {
  grid-column: 1 / -1;
  min-width: 0;
  white-space: nowrap;
}

.asset-form .message {
  grid-column: 1 / -1;
  margin-top: 0;
}

.playlist-manager {
  border-bottom: 1px solid var(--border);
}

.playlist-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.playlist-form .wide-field {
  grid-column: span 3;
}

.playlist-form > label {
  min-width: 0;
}

.playlist-form > label input {
  width: 100%;
  min-width: 0;
}

.weekday-field,
.playlist-picker-grid,
.playlist-actions,
.playlist-form .message {
  grid-column: 1 / -1;
}

.weekday-field {
  display: grid;
  gap: 6px;
}

.weekday-field > span,
.playlist-picker-grid legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.weekday-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.weekday-options label,
.target-all-option {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.weekday-options label {
  min-width: 42px;
  min-height: 34px;
  justify-content: center;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.weekday-options input,
.target-all-option input {
  width: 15px;
  height: 15px;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.playlist-picker-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 14px;
}

.playlist-picker-grid fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.playlist-picker-grid legend {
  margin-bottom: 7px;
}

.playlist-media-option {
  grid-template-columns: 18px minmax(0, 1fr) 132px;
}

.playlist-item-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.playlist-item-controls label {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.playlist-media-option .playlist-item-controls input[type="number"] {
  width: 100%;
  height: 30px;
  min-height: 30px;
  padding: 4px 6px;
  font-size: 12px;
}

.playlist-actions,
.playlist-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.playlist-actions .primary-button,
.playlist-actions .ghost-button {
  min-width: 150px;
}

.playlist-row {
  grid-template-columns: minmax(0, 1fr) 70px 76px;
}

.playlist-row-actions {
  justify-content: flex-end;
}

.file-field input {
  padding: 8px 10px;
  min-height: 40px;
}

.manifest-summary {
  grid-column: 1 / -1;
  min-height: 0;
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.manifest-summary strong {
  color: var(--text);
  font-size: 12px;
  word-break: break-all;
}

.manifest-summary.error,
.manifest-summary.error strong {
  color: var(--red);
}

.asset-list {
  display: grid;
}

.media-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--border);
  background: var(--border);
}

.media-metrics div {
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
}

.media-metrics span,
.subsection-title span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.media-metrics strong {
  display: block;
  margin-top: 5px;
  color: var(--accent);
  font-size: 18px;
}

.subsection-title {
  min-height: 38px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.subsection-title h4 {
  margin: 0;
  font-size: 13px;
}

.asset-row {
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 110px;
  gap: 10px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.asset-row strong,
.asset-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-row strong {
  display: block;
  font-size: 13px;
}

.asset-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.asset-row button {
  min-height: 34px;
}

.asset-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.asset-actions .ghost-button {
  min-width: 34px;
}

.asset-row.playback-row {
  grid-template-columns: minmax(0, 1fr) 90px 90px;
}

.asset-row.event-row {
  grid-template-columns: minmax(0, 1fr) 90px 120px;
}

.deployment-form {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.deployment-header,
.target-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.deployment-header h4 {
  margin: 0;
  font-size: 13px;
}

.deployment-header span,
.target-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.target-list {
  display: grid;
  gap: 6px;
  max-height: 174px;
  overflow: auto;
}

.target-option {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 74px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.target-option.disabled {
  opacity: 0.62;
}

.target-option input {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
}

.target-option span,
.assignment-row div {
  min-width: 0;
}

.target-option strong,
.assignment-row strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.target-option small,
.assignment-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-option em {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.target-empty {
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.assignment-list {
  display: grid;
}

.assignment-row {
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 10px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.assignment-row span {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.activity-panel {
  min-height: 180px;
}

.admin-user-panel,
.hospital-panel,
.public-url-panel {
  min-width: 0;
}

.public-base-url-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  background: var(--surface-soft);
}

.public-base-url-form .message {
  grid-column: 1 / -1;
}

.admin-user-form {
  display: grid;
  grid-template-columns: 132px 150px minmax(0, 1fr) 132px 150px 112px;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.admin-user-form .form-actions,
.admin-user-form .message {
  grid-column: 1 / -1;
}

.checkbox-field {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.hospital-form {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 112px;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.hospital-form .wide-field,
.hospital-form .form-actions,
.hospital-form .message {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.admin-user-list,
.hospital-list {
  display: grid;
}

.admin-user-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 98px;
  gap: 10px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.admin-user-row.selected {
  background: var(--accent-soft);
}

.hospital-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 98px;
  gap: 10px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.hospital-row.selected {
  background: var(--accent-soft);
}

.admin-user-main,
.hospital-main {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.admin-user-main strong,
.admin-user-main small,
.admin-user-row span,
.hospital-main strong,
.hospital-main small,
.hospital-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-main strong,
.hospital-main strong {
  display: block;
  font-size: 13px;
}

.admin-user-main small,
.hospital-main small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.admin-user-row span,
.hospital-row span {
  text-align: right;
  font-size: 12px;
}

.alert-panel,
.artifact-panel {
  grid-column: 1 / -1;
}

.panel-heading {
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-heading h3 {
  font-size: 14px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.activity-list {
  display: grid;
}

.system-status-list {
  display: grid;
}

.system-status-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.system-status-row strong,
.system-status-row small,
.system-status-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-status-row strong {
  display: block;
  font-size: 13px;
}

.system-status-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.system-status-row > span {
  justify-self: end;
  font-size: 12px;
  font-weight: 900;
}

.system-warning-list {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  background: #fff8eb;
  color: #7a4b00;
  font-size: 12px;
  line-height: 1.45;
}

.system-warning-list div {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.system-warning-list svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--amber);
  flex: 0 0 auto;
}

.alert-list {
  display: grid;
}

.alert-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 86px 148px;
  gap: 10px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.alert-row strong,
.alert-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-row strong {
  display: block;
  font-size: 13px;
}

.alert-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.alert-row span.text-green {
  color: var(--green);
}

.alert-row span.text-blue {
  color: var(--blue);
}

.alert-row span.text-amber {
  color: var(--amber);
}

.alert-row span.text-red {
  color: var(--red);
}

.alert-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.alert-actions button {
  min-width: 64px;
  min-height: 34px;
}

.artifact-list {
  display: grid;
}

.artifact-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 110px 104px 84px;
  gap: 10px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.artifact-row strong,
.artifact-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-row strong {
  display: block;
  font-size: 13px;
}

.artifact-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.artifact-row .artifact-kind {
  color: var(--text);
}

.artifact-row span.text-green {
  color: var(--green);
}

.artifact-row span.text-blue {
  color: var(--blue);
}

.artifact-row span.text-amber {
  color: var(--amber);
}

.artifact-row span.text-red {
  color: var(--red);
}

.artifact-row button {
  min-height: 34px;
}

.activity-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: 140px 130px minmax(0, 1fr) 86px;
  gap: 10px;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.activity-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-list {
  display: grid;
  gap: 12px;
  padding: 16px;
  color: #3d4b55;
  line-height: 1.45;
}

.note-list div {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.note-list svg {
  color: var(--accent);
  margin-top: 1px;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
}

.empty-state.compact {
  min-height: 132px;
}

.empty-state svg {
  width: 34px;
  height: 34px;
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(13, 27, 34, 0.28);
}

.dialog-card {
  width: min(540px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.dialog-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

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

.dialog-details {
  min-width: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.dialog-details summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.dialog-details > p {
  margin: 9px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.dialog-details[open] {
  display: grid;
  gap: 12px;
}

.dialog-details[open] summary {
  margin-bottom: 0;
}

.dialog-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #172026;
  color: white;
  box-shadow: var(--shadow);
  z-index: 10;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .app-shell.sidebar-expanded {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  .sidebar-title span,
  .side-item {
    font-size: 0;
  }

  .app-shell.sidebar-expanded .sidebar-title {
    justify-content: flex-start;
    padding: 0 18px;
  }

  .app-shell.sidebar-expanded .sidebar-title span,
  .app-shell.sidebar-expanded .side-item {
    font-size: 14px;
  }

  .app-shell.sidebar-expanded .side-item {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .side-item {
    justify-content: center;
    padding: 0;
  }

  .content-grid,
  .asset-grid,
  .bottom-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .license-form,
  .license-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .license-core-table-head,
  .license-core-row {
    grid-template-columns: minmax(200px, 1fr) 92px 120px 140px 20px;
  }

  .admin-user-form,
  .hospital-form,
  .public-base-url-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .public-base-url-form .form-actions {
    grid-column: 1;
  }

  .admin-user-row,
  .hospital-row {
    grid-template-columns: minmax(0, 1fr) 72px 94px;
  }

  .license-list,
  .license-assignment-form {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .detail-panel {
    min-height: 380px;
    max-height: none;
    position: static;
    overflow: visible;
  }

  .detail-body {
    overflow-y: visible;
  }

  .detail-header {
    align-items: flex-start;
  }

  .detail-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: 100%;
    height: auto;
    min-height: 0;
    position: sticky;
    top: 0;
    z-index: 8;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }

  .sidebar-title {
    display: none;
  }

  .side-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 10px;
  }

  .side-item {
    flex: 0 0 auto;
    min-width: 88px;
    padding: 0 10px;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    white-space: nowrap;
  }

  .app-shell.sidebar-collapsed .side-item {
    justify-content: center;
    padding: 0 10px;
    font-size: 12px;
  }

  .side-item svg {
    width: 16px;
    height: 16px;
  }

  .topbar {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    padding: 12px;
  }

  .topbar-actions,
  .hospital-control {
    width: 100%;
  }

  .hospital-control {
    justify-content: flex-start;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .hospital-control select {
    width: min(100%, 240px);
  }

  .primary-button.compact {
    min-width: 132px;
  }

  .page-title {
    align-items: stretch;
    flex-direction: column;
    padding: 18px 14px 12px;
  }

  .segmented {
    width: 100%;
  }

  .summary-grid,
  .content-grid,
  .asset-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
    padding-left: 14px;
    padding-right: 14px;
  }

  .summary-grid {
    gap: 8px;
  }

  .summary-card {
    min-height: 92px;
  }

  .table-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  table {
    min-width: 760px;
    table-layout: auto;
  }

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

  .table-toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  #deploy-agent-config-button {
    flex: 1;
  }

  .hospital-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .admin-user-panel .panel-heading,
  .hospital-panel .panel-heading,
  .public-url-panel .panel-heading {
    height: auto;
    min-height: 44px;
    gap: 10px;
  }

  .admin-user-panel .panel-heading h3,
  .hospital-panel .panel-heading h3,
  .public-url-panel .panel-heading h3 {
    white-space: nowrap;
  }

  .admin-user-panel .panel-actions,
  .hospital-panel .panel-actions,
  .public-url-panel .panel-actions {
    flex: 0 0 auto;
  }

  .admin-user-row span,
  .hospital-row span {
    text-align: left;
  }

  .admin-user-row .ghost-button,
  .hospital-row .ghost-button {
    width: 100%;
  }

  .public-base-url-form .form-actions {
    width: 100%;
  }

  .public-base-url-form .form-actions button {
    flex: 1;
  }

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

  .user-chip,
  #refresh-button {
    display: none;
  }

  .activity-row {
    grid-template-columns: 1fr;
    height: auto;
    padding: 10px 14px;
  }

  .artifact-row {
    grid-template-columns: minmax(0, 1fr) 76px;
    align-items: start;
  }

  .alert-row {
    grid-template-columns: minmax(0, 1fr) 96px;
    align-items: start;
  }

  .alert-row .alert-severity,
  .alert-row div:not(.alert-actions) {
    grid-column: 1 / -1;
  }

  .alert-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .alert-actions button {
    flex: 1;
  }

  .artifact-row .artifact-kind,
  .artifact-row div {
    grid-column: 1 / -1;
  }

  .artifact-row button {
    width: 100%;
  }

  .asset-form,
  .asset-form.package-form,
  .playlist-form,
  .admin-user-form,
  .license-form {
    grid-template-columns: 1fr;
  }

  .playlist-form .wide-field,
  .weekday-field,
  .playlist-picker-grid,
  .playlist-actions,
  .playlist-form .message {
    grid-column: auto;
  }

  .playlist-picker-grid {
    grid-template-columns: 1fr;
  }

  .playlist-row {
    grid-template-columns: minmax(0, 1fr) 64px 76px;
  }

  .asset-form .file-field,
  .asset-form .primary-button {
    grid-column: auto;
    grid-row: auto;
  }

  .admin-user-row,
  .license-row {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .license-core-summary > div:nth-child(2) {
    border-right: 0;
  }

  .license-core-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .license-core-table-head {
    display: none;
  }

  .license-core-row {
    grid-template-columns: minmax(0, 1fr) 86px 20px;
    gap: 8px;
  }

  .license-core-row > span:nth-child(3),
  .license-core-row > span:nth-child(4) {
    display: none;
  }

  .media-metrics,
  .asset-row.playback-row,
  .asset-row.event-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
