/* หน้าหลัก (dashboard.mjs) */
.dash-workspace {
  display: none;
  overflow: auto;
  grid-column: 2/-1;
  min-width: 0;
  background: #f3f5f8;
}
.shell.dash-open > .settings,
.shell.dash-open > .workarea {
  display: none;
}
.shell.dash-open > .dash-workspace {
  display: block;
}
.dash-inner {
  max-width: 1240px;
  margin: auto;
  padding: 28px 36px 64px;
}
.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.dash-eyebrow {
  font-size: 11px;
  letter-spacing: 1.6px;
  color: #8b95a4;
  font-weight: 600;
  text-transform: uppercase;
}
.dash-hero h1 {
  margin: 6px 0 4px;
  font-size: 32px;
  color: #171e2b;
}
.dash-hero p {
  margin: 0;
  color: #6b778a;
}
.dash-me {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e1e6ee;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 6px 18px #283c500d;
}
.dash-me strong,
.dash-me small {
  display: block;
}
.dash-me small {
  color: #7c8c9f;
  font-size: 12.5px;
  margin-bottom: 4px;
}
.dash-me.guest {
  max-width: 460px;
  flex-wrap: wrap;
}
.dash-me.guest p {
  margin: 0;
  font-size: 13.5px;
  color: #4e5d72;
  flex: 1 1 220px;
}
.dash-me-btns {
  margin-left: 6px;
}
.dash-level {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  color: var(--lv);
  background: color-mix(in srgb, var(--lv) 12%, white);
  border: 1px solid color-mix(in srgb, var(--lv) 30%, white);
  vertical-align: middle;
}
.dash-flag {
  margin-left: 6px;
  font-size: 12px;
  color: #b04a3e;
  font-weight: 600;
}
.dash-primary {
  background: #273449;
  color: #fff;
  border-color: #273449;
}
.dash-primary:hover {
  background: #34445e;
}
.dash-primary:disabled {
  background: #9aa5b6;
  border-color: #9aa5b6;
}
.dash-quick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.dash-tile {
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  white-space: normal;
  gap: 4px;
  padding: 16px;
  min-height: 132px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e1e6ee;
  box-shadow: 0 6px 18px #283c500d;
}
.dash-tile:hover {
  border-color: #b9c8dd;
  background: #fbfcfe;
}
.dash-tile > .ico {
  width: 26px;
  height: 26px;
  color: #3f6fb5;
  margin-bottom: 6px;
}
.dash-tile b {
  font-size: 15px;
  color: #1d2a3f;
}
.dash-tile small {
  color: #7c8c9f;
  font-size: 12.5px;
  line-height: 1.45;
}
.dash-tile.locked {
  background: #f7f8fa;
}
.dash-tile.locked > .ico,
.dash-tile.locked b {
  color: #9aa5b6;
}
.dash-tile em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-style: normal;
  font-size: 11.5px;
  color: #a0552f;
  margin-top: auto;
}
.dash-tile em .ico {
  width: 13px;
  height: 13px;
}
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.dash-card {
  background: #fff;
  border: 1px solid #e1e6ee;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 6px 18px #283c500d;
  min-width: 0;
}
.dash-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  margin: 0 0 14px;
  color: #1d2a3f;
}
.dash-card h2 .ico {
  color: #3f6fb5;
}
.dash-card h3 {
  font-size: 13px;
  color: #6b778a;
  margin: 16px 0 6px;
  font-weight: 600;
}
.dash-continue {
  width: 100%;
  justify-content: space-between;
  text-align: left;
  white-space: normal;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f0f5ff;
  border-color: #c8d8f3;
}
.dash-continue span {
  display: flex;
  flex-direction: column;
}
.dash-continue small {
  font-size: 11.5px;
  color: #6b7a8e;
}
.dash-continue b {
  font-size: 16px;
  color: #1d2a3f;
}
.dash-continue em {
  font-style: normal;
  font-size: 12.5px;
  color: #4e6b98;
}
.dash-jobs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-jobs button {
  width: 100%;
  justify-content: space-between;
  text-align: left;
  border-color: transparent;
  background: transparent;
  padding: 8px 10px;
  white-space: normal;
}
.dash-jobs button:hover {
  background: #f3f6fa;
}
.dash-jobs span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dash-jobs b {
  font-weight: 600;
  color: #22324a;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-jobs small {
  font-size: 12px;
  color: #8b95a4;
}
.dash-where {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-style: normal;
  font-size: 11.5px;
  color: #6b778a;
  background: #eef1f5;
  border-radius: 10px;
  padding: 1px 8px;
  white-space: nowrap;
}
.dash-where.cloud {
  color: #2f6a9e;
  background: #e8f1fb;
}
.dash-where .ico {
  width: 13px;
  height: 13px;
}
.dash-link {
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: #3f6fb5;
  padding: 4px 0;
  min-height: 0;
}
.dash-note {
  font-size: 12.5px;
  color: #7c8c9f;
  margin: 10px 0 0;
}
.dash-note.warn {
  color: #b04a3e;
}
.dash-bar {
  margin-bottom: 12px;
}
.dash-bar div {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #4e5d72;
  margin-bottom: 4px;
}
.dash-bar b {
  font-family: system-ui;
  font-size: 12.5px;
  color: #22324a;
}
.dash-bar i {
  display: block;
  height: 7px;
  border-radius: 6px;
  background: #edf0f4;
  overflow: hidden;
}
.dash-bar s {
  display: block;
  height: 100%;
  background: #4f7fc4;
  border-radius: 6px;
}
.dash-bar.over s {
  background: #c9553f;
}
.dash-bar.over b {
  color: #b04a3e;
}
.dash-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px 18px;
  margin-top: 14px;
}
.dash-features h4 {
  margin: 6px 0 4px;
  font-size: 12px;
  color: #8b95a4;
  font-weight: 600;
}
.dash-features span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 2px 0;
}
.dash-features .ico {
  width: 15px;
  height: 15px;
}
.dash-features .on {
  color: #2d4a3a;
}
.dash-features .on .ico {
  color: #2f8a5a;
}
.dash-features .off {
  color: #a0a9b6;
}
.dash-admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.dash-admin-head h2 {
  margin: 0;
}
.dash-tabs {
  display: flex;
  background: #eef1f5;
  padding: 3px;
  border-radius: 9px;
  gap: 3px;
}
.dash-tabs button {
  border: 0;
  background: transparent;
  min-height: 32px;
  padding: 4px 14px;
}
.dash-tabs button.on {
  background: #fff;
  box-shadow: 0 1px 4px #132b4420;
  color: #172c4f;
}
.dash-users-tools,
.dash-levels-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13.5px;
  color: #4e5d72;
}
.dash-users-tools input {
  flex: 1 1 240px;
  max-width: 360px;
  min-height: 36px;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  padding: 6px 10px;
}
.dash-levels-tools select {
  width: auto;
  min-height: 34px;
  padding: 4px 8px;
  margin-left: 4px;
}
.dash-small {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 13px;
}
.dash-table-wrap {
  overflow-x: auto;
  border: 1px solid #e6eaf0;
  border-radius: 12px;
}
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.dash-table th {
  text-align: left;
  font-weight: 600;
  color: #6b778a;
  font-size: 12.5px;
  background: #f7f9fb;
  padding: 9px 10px;
  border-bottom: 1px solid #e6eaf0;
  vertical-align: top;
}
.dash-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef1f5;
  vertical-align: middle;
}
.dash-table tr.off td {
  opacity: 0.55;
}
.dash-table select {
  width: auto;
  min-height: 32px;
  padding: 3px 8px;
  font-size: 13px;
}
.dash-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 200px;
}
.dash-user span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dash-user small {
  color: #8b95a4;
  font-size: 12px;
}
.dash-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #6b778a;
}
.dash-edit-row td {
  background: #f8fafd;
}
.dash-override p {
  margin: 0 0 10px;
  font-size: 13px;
  color: #4e5d72;
}
.dash-override-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px 14px;
}
.dash-override-grid label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
  color: #4e5d72;
}
.dash-override-grid select,
.dash-override-grid input {
  width: 100%;
  min-height: 32px;
  padding: 3px 8px;
  font-size: 13px;
  border: 1px solid #dce2ea;
  border-radius: 7px;
  background: #fff;
}
.dash-override-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.dash-levels td:first-child {
  min-width: 210px;
  color: #33425a;
}
.dash-levels td:not(:first-child),
.dash-levels th:not(:first-child) {
  text-align: center;
  min-width: 112px;
}
.dash-levels input[type="number"] {
  width: 88px;
  min-height: 30px;
  padding: 3px 6px;
  text-align: right;
  font: 13px system-ui;
  border: 1px solid #dce2ea;
  border-radius: 6px;
}
.dash-levels input[type="checkbox"] {
  width: 17px;
  height: 17px;
}
.dash-lv-name {
  width: 100%;
  min-width: 90px;
  font: 600 13px Sarabun, sans-serif;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 5px;
  text-align: center;
  background: transparent;
}
.dash-lv-name:hover,
.dash-lv-name:focus {
  border-color: #cfd8e4;
  background: #fff;
}
.dash-lv-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.dash-lv-meta input[type="color"] {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
}
.dash-lv-meta small {
  font-size: 11px;
  color: #8b95a4;
  font-weight: 400;
}
.dash-x {
  min-height: 24px;
  padding: 2px;
  border: 0;
  background: transparent;
  color: #b04a3e;
}
.dash-x .ico {
  width: 15px;
  height: 15px;
}
.dash-group td {
  background: #f7f9fb;
  font-size: 12px;
  font-weight: 600;
  color: #8b95a4;
  padding: 6px 10px;
}
/* Locked studio controls: still clickable, to say why. */
.rail button.locked,
.mode-switch button.locked,
.tabs button.locked {
  opacity: 0.5;
}
.view-locked {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #6b778a;
  padding: 40px;
  gap: 8px;
}
.view-locked strong {
  color: #33425a;
  font-size: 18px;
}
.limit-banner {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: #fff4ec;
  border: 1px solid #f0c8a8;
  color: #8a4a1f;
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 13px;
  box-shadow: 0 6px 18px #283c5014;
  max-width: min(92%, 680px);
  text-align: center;
}
@media (max-width: 900px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .dash-workspace {
    grid-column: 1/-1;
    order: 1;
    overflow: visible;
  }
  .dash-inner {
    padding: 18px 14px 40px;
  }
  .dash-hero h1 {
    font-size: 26px;
  }
  .dash-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-tile {
    min-height: 118px;
    padding: 12px;
  }
}
