:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #65706d;
  --line: #dce4e0;
  --panel: #ffffff;
  --panel-2: #f6f8f6;
  --canvas: #edf2ee;
  --accent: #0b7a75;
  --accent-2: #c78321;
  --danger: #b64242;
  --ok: #2d8b57;
  --shadow: 0 18px 50px rgba(23, 33, 31, 0.11);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.login-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  min-height: 100vh;
  background: var(--canvas);
}

.login-media {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #17211f;
}

.login-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(23, 33, 31, 0.22), rgba(23, 33, 31, 0.82));
}

.login-card {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 44px;
  background: var(--panel);
}

.login-card h1 {
  margin-bottom: 12px;
  font-size: 32px;
}

.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-card input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
}

.login-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 750;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
  color: #eff5f1;
  background: #17211f;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: #0b7a75;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.sidebar-footer {
  color: rgba(239, 245, 241, 0.66);
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 38px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  color: rgba(239, 245, 241, 0.78);
  text-decoration: none;
  border-radius: var(--radius);
}

.nav-item.active,
.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-item svg,
button svg,
.searchbox svg,
.empty-state svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7bd38b;
  box-shadow: 0 0 0 5px rgba(123, 211, 139, 0.12);
}

.workspace {
  min-width: 0;
  padding: 26px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
}

h2 {
  font-size: 16px;
}

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

.role-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

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

.role-switcher select {
  min-height: 30px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 750;
}

.page-panel {
  display: none;
}

.page-panel.is-active {
  display: block;
}

.primary-button,
.secondary-button,
.icon-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  border-radius: var(--radius);
  font-weight: 750;
}

.primary-button {
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
}

.secondary-button {
  padding: 0 14px;
  color: var(--ink);
  background: #e6ece8;
}

.secondary-button.danger {
  color: var(--danger);
}

.icon-button {
  width: 40px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
}

.icon-button.danger {
  color: var(--danger);
  background: #fff;
  border-color: #e8caca;
}

.icon-button.danger:hover {
  background: #fff1f1;
}

.text-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--accent);
  background: transparent;
}

.full {
  width: 100%;
}

.hero-strip {
  position: relative;
  min-height: 174px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #17211f;
  box-shadow: var(--shadow);
}

.hero-strip img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-strip::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(23, 33, 31, 0.9), rgba(23, 33, 31, 0.34), rgba(23, 33, 31, 0.76));
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 174px;
  padding: 24px;
  color: #fff;
}

.hero-copy p,
.hero-copy strong {
  display: block;
  margin: 0;
}

.hero-copy p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-copy strong {
  margin-top: 8px;
  font-size: clamp(24px, 3vw, 36px);
}

.hero-meter {
  width: min(260px, 32vw);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.hero-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #e6af55;
  transition: width 220ms ease;
}

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

.stat-card,
.main-panel,
.side-panel,
.upload-dialog,
.upload-page-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.stat-card {
  padding: 16px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 16px;
  align-items: start;
}

.main-panel,
.side-panel {
  min-width: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 160px;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.searchbox input,
.toolbar select,
.detail-panel input,
.detail-panel select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
}

.searchbox input {
  min-height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
}

.toolbar select,
.detail-panel input,
.detail-panel select {
  min-height: 40px;
  padding: 0 10px;
}

.table-wrap {
  position: relative;
  min-height: 410px;
  overflow: auto;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.pagination-bar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #fbfcfb;
  font-size: 12px;
  font-weight: 800;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.active-row {
  background: #f3f7f4;
}

.check-cell {
  width: 42px;
}

.admin-track-action {
  width: 64px;
  text-align: center;
}

.track-delete-button,
.upload-delete-button {
  width: 34px;
  min-height: 34px;
}

.track-delete-button svg,
.upload-delete-button svg {
  width: 16px;
  height: 16px;
}

.track-title {
  display: grid;
  gap: 4px;
}

.track-title strong,
.track-title span {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-title span,
.platform-muted,
.date-muted {
  color: var(--muted);
  font-size: 12px;
}

.table-value-detail {
  position: relative;
  min-width: 0;
}

.table-value-detail summary {
  display: block;
  max-width: 220px;
  cursor: pointer;
  list-style: none;
}

.table-value-detail summary::-webkit-details-marker {
  display: none;
}

.table-value-detail > div {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 5px;
  width: min(320px, 70vw);
  margin-top: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.table-value-detail > div b {
  color: var(--ink);
  font-size: 11px;
}

.table-value-detail > div span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.hub-preview-details {
  width: 100%;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.hub-preview-details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.hub-preview-details div {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.hub-preview-details div span {
  display: grid;
  gap: 2px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.hub-preview-details b {
  color: var(--ink);
  font-size: 11px;
}

.platform-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 260px;
}

.chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.chip {
  color: #28605c;
  background: #dff0ec;
}

.status-chip {
  color: #5b4a24;
  background: #f3e6c9;
}

.status-chip.online {
  color: #245f3d;
  background: #dff0e6;
}

.status-chip.submitted {
  color: #275f75;
  background: #dcecf1;
}

.empty-state {
  position: absolute;
  inset: 82px 16px 16px;
  display: none;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  border: 1px dashed #c7d4ce;
  border-radius: var(--radius);
  background: #fbfcfb;
}

.empty-state.show {
  display: grid;
}

.empty-state svg {
  width: 34px;
  height: 34px;
  color: var(--accent);
}

.empty-state strong {
  color: var(--ink);
}

.side-panel {
  display: grid;
  gap: 0;
}

.panel-section {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-section:last-child {
  border-bottom: 0;
}

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

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

.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.platform-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 700;
}

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

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

.detail-panel {
  display: grid;
  gap: 10px;
}

.cover-art {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #17211f;
}

.cover-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.limit-box,
.hub-detail-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.limit-box {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 12px;
}

.limit-box span,
.hub-detail-box span,
.hub-detail-box small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.limit-box strong,
.hub-detail-box strong {
  color: var(--accent);
}

.detail-panel label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-panel audio {
  width: 100%;
  min-height: 42px;
}

.upload-dialog {
  width: min(620px, calc(100vw - 30px));
  padding: 0;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.upload-dialog::backdrop {
  background: rgba(23, 33, 31, 0.48);
}

.upload-dialog form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dropzone {
  display: grid;
  min-height: 196px;
  place-items: center;
  align-content: center;
  gap: 9px;
  border: 1px dashed #b9c7c1;
  border-radius: var(--radius);
  background: var(--panel-2);
}

.upload-page-panel .dropzone {
  margin: 16px;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: #edf8f5;
}

.dropzone.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone svg {
  width: 34px;
  height: 34px;
  color: var(--accent);
}

.dropzone span {
  color: var(--muted);
  font-size: 13px;
}

.upload-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.upload-page-panel .upload-list {
  max-height: none;
  padding: 0 16px 16px;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 40px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.upload-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 4;
  max-width: min(380px, calc(100vw - 40px));
  padding: 12px 14px;
  color: #fff;
  background: #17211f;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.records-panel,
.admin-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.records-filters {
  display: flex;
  gap: 10px;
}

.compact-search {
  width: min(260px, 34vw);
}

.records-filters select,
.admin-form input,
.admin-form select,
.card-use-form input,
.distributor-card input {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
}

.record-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.record-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.record-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--accent);
}

.record-icon.download {
  background: var(--accent-2);
}

.record-card strong,
.record-card span,
.record-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-card span,
.record-card small {
  color: var(--muted);
}

.record-card small {
  margin-top: 4px;
}

.record-details {
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.record-details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
}

.record-details div {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.record-details div span {
  white-space: normal;
}

.record-detail-body {
  display: grid;
  gap: 10px;
}

.record-detail-section {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.record-detail-section h3 {
  margin: 0 0 9px;
  font-size: 13px;
}

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

.record-detail-grid span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border-radius: var(--radius);
  background: #fff;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.record-detail-grid b {
  color: var(--ink);
  font-size: 11px;
}

.record-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.record-detail-heading h3 {
  margin-bottom: 0;
}

.record-track-list {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.record-track-list span {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border-radius: var(--radius);
  background: #fff;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.record-track-list b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 11px;
}

.record-redownload-button {
  justify-self: start;
}

.record-status-control {
  display: grid;
  gap: 8px;
  min-width: 118px;
  justify-items: stretch;
}

.record-status-control > .status-chip {
  justify-self: end;
}

.record-status-control label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.record-status-control select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
}

.record-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.record-delete-button {
  width: 36px;
  min-height: 36px;
}

.record-status-static {
  justify-self: end;
}

.record-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  border: 1px dashed #c7d4ce;
  border-radius: var(--radius);
}

.admin-only-badge {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.admin-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.4fr) 150px auto;
  gap: 10px;
  align-items: end;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.split-form {
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
}

.account-create-form {
  grid-template-columns: 130px repeat(3, minmax(150px, 1fr)) auto;
}

.admin-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 10px;
  border-top: 1px solid var(--line);
}

.admin-section-title:first-of-type {
  border-top: 0;
}

.admin-section-title strong {
  font-size: 15px;
}

.admin-section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.cleanup-form {
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 0.5fr) auto;
}

.cleanup-preview {
  display: grid;
  gap: 5px;
  align-self: stretch;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.cleanup-preview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.cleanup-preview strong {
  font-size: 16px;
}

.hub-sync-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.hub-sync-toolbar > div {
  display: grid;
  gap: 4px;
}

.hub-sync-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.hub-sync-toolbar .is-loading svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.admin-form label,
.distributor-card label,
.employee-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.distributor-list,
.employee-list,
.task-admin-list,
.card-admin-list,
.card-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.employee-list {
  border-bottom: 1px solid var(--line);
}

.distributor-card,
.employee-card {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(200px, 1.2fr) minmax(200px, 1.2fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.employee-card {
  display: block;
  padding: 0;
  overflow: hidden;
}

.account-card > details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.account-card > details > summary::-webkit-details-marker {
  display: none;
}

.account-card > details > summary > div {
  min-width: 0;
}

.account-card > details > summary > div span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.account-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

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

.distributor-card strong,
.distributor-card span,
.employee-card strong,
.employee-card span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distributor-card > div span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.hub-details {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.hub-details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
}

.hub-details div {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.hub-details .hub-account-list {
  gap: 8px;
}

.hub-details div span {
  color: var(--muted);
  font-size: 12px;
}

.hub-account-detail {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.hub-account-detail summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
}

.hub-account-detail summary small {
  color: var(--muted);
  font-size: 11px;
}

.hub-details .hub-account-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
}

.hub-account-fields span {
  display: grid;
  gap: 2px;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.hub-account-fields b {
  color: var(--ink);
  font-size: 11px;
}

.task-menu {
  position: relative;
}

.task-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.task-menu summary::-webkit-details-marker {
  display: none;
}

.task-menu summary.has-alert {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.task-menu summary strong {
  font-size: 12px;
}

.task-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 6;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 34px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.task-row,
.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.task-row.alert {
  border-color: rgba(182, 66, 66, 0.35);
}

.task-row.done {
  opacity: 0.75;
}

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

.task-row span,
.admin-row span {
  color: var(--muted);
  font-size: 12px;
}

.virtual-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.virtual-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.virtual-card-head span {
  color: var(--muted);
  font-size: 12px;
}

.card-head-notices {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.card-usage-warning {
  color: var(--danger);
  font-size: 13px;
  font-weight: 850;
}

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

.card-delete-button {
  width: 34px;
  min-height: 34px;
}

.card-delete-button svg {
  width: 16px;
  height: 16px;
}

.card-details {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.card-details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
}

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

.card-copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.card-copy-field span {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.card-copy-field b {
  color: var(--ink);
  font-size: 11px;
}

.copy-field-button {
  width: 32px;
  min-height: 32px;
}

.copy-field-button svg {
  width: 15px;
  height: 15px;
}

.delete-employee {
  width: 34px;
  min-height: 34px;
}

.card-use-form {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 8px;
}

.card-usage-details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.card-usage-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  cursor: pointer;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.card-usage-details > summary small {
  color: var(--muted);
  font-size: 13px;
}

.card-usage-list {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.card-usage-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.4fr) minmax(90px, auto) minmax(100px, 0.8fr);
  gap: 6px 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.card-usage-row time {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.card-usage-row strong {
  color: var(--danger);
  font-size: 16px;
  text-align: right;
}

.card-usage-row span {
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.card-usage-row p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.card-usage-empty {
  padding: 18px 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.compact-empty {
  min-height: 82px;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

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

  .brand div:not(.brand-mark),
  .nav-item span,
  .sidebar-footer span {
    display: none;
  }

  .nav-item {
    justify-content: center;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .admin-form,
  .split-form,
  .distributor-card,
  .employee-card {
    grid-template-columns: 1fr 1fr;
  }

  .account-edit-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cleanup-form {
    grid-template-columns: 1fr 1fr auto;
  }

  .account-create-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 780px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-media {
    min-height: 28vh;
  }

  .login-card {
    padding: 24px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px;
  }

  .brand div:not(.brand-mark),
  .nav-item span,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 12px;
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .primary-button {
    width: 100%;
  }

  .topbar-actions {
    display: flex;
    width: 100%;
  }

  .hero-content {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-meter {
    width: 100%;
  }

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

  .toolbar {
    grid-template-columns: 1fr;
  }

  .platform-grid {
    grid-template-columns: 1fr;
  }

  .records-head,
  .records-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-form,
  .split-form,
  .distributor-card,
  .employee-card {
    grid-template-columns: 1fr;
  }

  .account-edit-grid {
    grid-template-columns: 1fr;
  }

  .hub-sync-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .hub-details .hub-account-fields {
    grid-template-columns: 1fr;
  }

  .card-use-form,
  .task-row,
  .admin-row,
  .record-card {
    grid-template-columns: 1fr;
  }

  .card-field-grid {
    grid-template-columns: 1fr;
  }

  .record-detail-grid,
  .cleanup-form,
  .account-create-form {
    grid-template-columns: 1fr;
  }

  .card-usage-row {
    grid-template-columns: 1fr;
  }

  .card-usage-row strong,
  .card-usage-row span {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }
}
