:root {
  color-scheme: light;
  --sidebar: #111a1f;
  --sidebar-active: #273139;
  --bg: #eef1f4;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #657181;
  --line: #cfd6df;
  --blue: #2f80ed;
  --blue-dark: #1d64bd;
  --red: #ed3f63;
  --yellow: #fff9d8;
  --row: #f6f8fa;
  --green: #24764b;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 14px;
}

.login-page {
  min-height: 100vh;
  background: #eef2f6;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  display: grid;
  gap: 22px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 28px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

.login-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-card h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

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

.login-form input {
  width: 100%;
  height: 42px;
  font-size: 16px;
}

.login-form button {
  min-height: 42px;
}

.login-error {
  min-height: 18px;
  margin: 0;
  color: #a2384e;
  font-size: 13px;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 34px;
  border: 0;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--blue-dark);
}

button.ghost,
button.muted {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

button.muted {
  background: #68717b;
  color: #fff;
}

button.link-button {
  background: transparent;
  color: var(--text);
  padding: 0 4px;
}

button.small {
  min-height: 28px;
  padding: 0 10px;
}

input,
select {
  min-height: 34px;
  border: 1px solid #b9c2cc;
  border-radius: 3px;
  background: #fff;
  color: var(--text);
  padding: 6px 9px;
}

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

.sidebar {
  background: var(--sidebar);
  color: #cbd4dc;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 700;
}

.brand button {
  width: 28px;
  min-height: 28px;
  padding: 0;
  background: transparent;
  color: #cbd4dc;
  font-size: 22px;
}

.nav {
  display: grid;
  padding: 12px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border-radius: 0;
  background: transparent;
  color: #cbd4dc;
  padding: 0 12px 0 36px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--sidebar-active);
}

.nav-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 20px;
  border-radius: 999px;
  background: #a66b19;
  color: #fff;
  font-size: 12px;
}

.main {
  min-width: 0;
  padding: 0 0 24px;
}

.operation-banners {
  display: grid;
  gap: 6px;
  padding: 8px 30px 0;
}

.operation-banners[hidden] {
  display: none;
}

.operation-banner {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border: 1px solid #a9bfd8;
  border-radius: 4px;
  background: #eaf3ff;
  color: #17324d;
  padding: 6px 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.operation-banner.stopping {
  border-color: #f0c36c;
  background: #fff7df;
  color: #5f4300;
}

.operation-banner-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.operation-banner-text strong,
.operation-banner-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-banner-text span {
  color: #55616f;
  font-size: 12px;
}

.operation-stop-btn {
  min-height: 26px;
  border: 1px solid #c92849;
  background: #ed3f63;
  padding: 0 10px;
  font-size: 12px;
}

.operation-stop-btn:hover {
  background: #c92849;
}

.operation-stop-btn:disabled {
  border-color: #c8b47b;
  background: #d4bd7a;
  cursor: default;
}

.page {
  display: none;
  padding: 10px 30px 0;
}

.page.active {
  display: block;
}

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

.page-head h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.head-actions,
.toolbar,
.logs-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar {
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.search {
  position: relative;
}

.search input {
  width: 200px;
  padding-right: 32px;
}

.search span {
  position: absolute;
  right: 10px;
  top: 6px;
  color: var(--text);
  font-size: 20px;
}

.matrix-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #9fa8b2;
  background: #fff;
}

.matrix {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

.matrix th,
.matrix td {
  border: 1px solid #9fa8b2;
  padding: 0;
  vertical-align: top;
}

.matrix th {
  height: 48px;
  background: #dfe3e8;
  font-size: 12px;
  text-align: center;
  font-weight: 700;
}

.matrix th.wide {
  width: 260px;
}

.th-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
}

.header-fetch {
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  font-size: 15px;
}

.site-col {
  width: 120px;
}

.girl-cell {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 34px 34px;
  gap: 6px;
  align-items: center;
  min-height: 56px;
  padding: 4px;
}

.girl-thumb {
  width: 46px;
  height: 50px;
  border-radius: 3px;
  background: #d7dde4;
  object-fit: cover;
  display: block;
}

.girl-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.girl-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mini-fetch-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border: 1px solid #b7c3cf;
  border-radius: 50%;
  background: #fff;
  color: #11517c;
  font-size: 14px;
  line-height: 1;
}

.row-spinner {
  width: 14px;
  min-width: 14px;
  height: 14px;
  border: 2px solid #cfd6df;
  border-top-color: #2468bd;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.inline-spinner {
  display: inline-block;
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin-left: 8px;
  vertical-align: middle;
  border: 2px solid #cfd6df;
  border-top-color: #2468bd;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.inline-spinner[hidden] {
  display: none;
}

.time-pill {
  display: inline-block;
  margin-top: 2px;
  border: 1px solid #2468bd;
  border-radius: 7px;
  background: #aac9ef;
  color: #164d8c;
  padding: 1px 5px;
  font-size: 11px;
}

.icon-button {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: #11517c;
  font-size: 20px;
}

.memo-cell,
.updated-cell,
.site-status {
  min-height: 56px;
  padding: 8px;
  background: #eef0e2;
  font-size: 12px;
}

.updated-cell {
  background: #d7d7d7;
  text-align: center;
}

.site-status {
  background: #e4e6dc;
}

.status-serving {
  display: inline-block;
  border-radius: 4px;
  background: #4637b8;
  color: #fff;
  padding: 3px 8px;
  font-size: 12px;
}

.status-waiting,
.status-ready,
.status-closed,
.status-unknown {
  display: inline-block;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.status-waiting {
  background: #e8f6ee;
  color: #14794d;
}

.status-ready {
  background: #fff4db;
  color: #8a5300;
}

.status-closed {
  background: #eef0f4;
  color: #586272;
}

.status-unknown {
  background: #f7e9ec;
  color: #a2384e;
}

.status-error {
  color: #a2384e;
  font-size: 11px;
}

.remaining {
  color: #5d4200;
  font-weight: 700;
}

.instant-on-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e83f6f;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

.instant-reserved-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: #8b919b;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

.panel,
.placeholder {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 14px;
}

.placeholder {
  margin: 10px 30px 0;
}

.platform-list {
  display: grid;
  gap: 10px;
}

.platform {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
}

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

.platform-title strong {
  font-size: 16px;
}

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

.platform-fields {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1.25fr 1.25fr 0.7fr;
  gap: 8px;
}

label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.check input {
  width: 18px;
  height: 18px;
}

.settings {
  display: grid;
  gap: 12px;
  max-width: 520px;
}

.site-automation {
  display: grid;
  gap: 12px;
}

.compact-field {
  display: grid;
  gap: 4px;
  max-width: 220px;
}

.instant-guide-grid {
  display: grid;
  gap: 10px;
}

.instant-guide-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
}

.instant-guide-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.instant-guide-title span {
  color: var(--muted);
  font-size: 12px;
}

.instant-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.instant-fields input {
  width: 100%;
}

.schedule-panel {
  display: grid;
  gap: 12px;
}

.schedule-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.schedule-controls input,
.schedule-controls select {
  min-width: 120px;
}

.auto-toggle-field {
  align-items: flex-start;
  gap: 6px;
}

.auto-toggle-field input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-toggle {
  min-width: 118px;
  height: 34px;
  border: 1px solid #b9c2cf;
  border-radius: 17px;
  background: #eef2f6;
  color: #4a5565;
  font-weight: 700;
  font-size: 13px;
}

.switch-toggle.wide {
  min-width: 190px;
}

.switch-toggle.is-on {
  border-color: #1f8a57;
  background: #1f8a57;
  color: #fff;
}

.instant-guide-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.on {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.status-pill.off {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.schedule-sync-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.compact-result {
  min-height: 48px;
  max-height: 180px;
}

.schedule-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.schedule-table {
  width: 100%;
  min-width: 1500px;
  border-collapse: collapse;
  table-layout: fixed;
}

.schedule-table th,
.schedule-table td {
  border: 1px solid #b7c3cf;
  padding: 8px;
  text-align: center;
  vertical-align: middle;
  font-size: 12px;
}

.schedule-table thead th {
  background: #e8edf3;
  font-weight: 700;
}

.schedule-table .schedule-name {
  width: 210px;
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f7f9fb;
}

.schedule-girl-cell {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.schedule-girl-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-thumb {
  width: 36px;
  height: 42px;
  border-radius: 3px;
  background: #d7dde4;
  object-fit: cover;
  display: block;
}

.schedule-working {
  background: #8fc8ef;
  color: #10263d;
  font-weight: 700;
}

.schedule-off {
  background: #f3f5f7;
  color: #8a94a3;
}

.schedule-empty {
  background: #fff;
}

.schedule-media-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.schedule-media-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.schedule-media-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.schedule-media-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  table-layout: fixed;
}

.schedule-media-table th,
.schedule-media-table td {
  border: 1px solid #d0d7e2;
  padding: 7px 8px;
  text-align: center;
  vertical-align: middle;
  font-size: 12px;
}

.schedule-media-table thead th {
  background: #e8edf3;
  font-weight: 700;
}

.schedule-media-table th:first-child {
  width: 210px;
  text-align: left;
}

.media-schedule-system {
  background: #f8fafc;
  font-weight: 700;
}

.media-schedule-working {
  background: #e8f7ee;
  color: #174f2a;
  font-weight: 700;
}

.media-schedule-off {
  background: #f1f5f9;
  color: #64748b;
}

.media-schedule-unknown {
  background: #fff;
  color: #94a3b8;
}

.media-schedule-out-of-scope {
  background: #f8fafc;
  color: #94a3b8;
  font-size: 11px;
}

.media-schedule-out-of-scope small {
  color: #94a3b8;
}

.media-schedule-mismatch {
  background: #fff1c2;
  color: #7a4b00;
  box-shadow: inset 0 0 0 2px #f0b429;
}

.simple-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.simple-table th,
.simple-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

.simple-table th {
  color: var(--muted);
  font-size: 12px;
}

.simple-table input[type="text"],
.simple-table input[type="time"] {
  width: 100%;
}

.girls-head-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.girls-head-actions .link-button {
  color: #111;
  font-weight: 700;
}

.girls-head-actions .danger-action {
  width: auto;
  min-width: 110px;
  height: 34px;
  border-radius: 3px;
  box-shadow: 0 2px 5px rgba(194, 47, 37, 0.28);
  font-weight: 700;
}

.girls-list-panel {
  padding: 0;
}

.girls-list-panel[hidden],
.girls-detail-panel[hidden] {
  display: none;
}

.girls-detail-panel {
  padding: 0;
}

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

.girl-detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 126px;
}

.girl-detail-identity {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.girl-detail-thumb {
  width: 54px;
  height: 72px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e8edf3;
}

.girl-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.girl-detail-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.girl-detail-dates span {
  border: 1px solid #d5dae1;
  border-radius: 2px;
  background: #fff;
  padding: 2px 6px;
}

.girl-detail-top h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.girl-detail-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.girl-detail-links .blue-action {
  width: 104px;
  height: 34px;
}

.girl-detail-tabs {
  height: 40px;
  border-bottom: 1px solid #b9c2cc;
}

.girl-detail-tab {
  width: 120px;
  height: 40px;
  border: 1px solid #2f80ed;
  border-bottom-color: #fff;
  border-radius: 0;
  background: #fff;
  color: #111;
  font-weight: 400;
}

.girl-detail-card {
  border: 1px solid #b9c2cc;
  background: #fff;
  padding: 30px;
}

.girl-publish-row {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.publish-button {
  width: 100px;
  height: 32px;
  border: 1px solid #35a797;
  border-radius: 2px;
  background: #fff;
  color: #27877c;
  font-weight: 700;
}

.publish-button.active {
  background: #3fb0a4;
  color: #fff;
}

.girl-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 30px;
  row-gap: 0;
}

.detail-field {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  min-height: 62px;
  border-bottom: 1px solid #d7d7d7;
}

.detail-field span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111;
  font-weight: 700;
}

.detail-field b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #b3272d;
  color: #fff;
  font-size: 11px;
}

.detail-field input,
.detail-field select {
  width: 100%;
}

.detail-field textarea {
  width: 100%;
  min-height: 82px;
  border: 1px solid #b9c2cc;
  border-radius: 3px;
  padding: 8px;
  resize: vertical;
  font: inherit;
}

.detail-field.wide {
  grid-column: 1 / -1;
  grid-template-columns: 170px minmax(0, 1fr);
  padding: 10px 0;
}

.detail-checks {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 62px;
  border-bottom: 1px solid #d7d7d7;
}

.detail-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}

.girl-detail-section {
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
}

.girl-detail-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.girl-photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-photo {
  width: 88px;
  margin: 0;
}

.detail-photo img {
  width: 88px;
  height: 118px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #eef2f6;
}

.detail-photo figcaption {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

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

.media-link-row {
  display: grid;
  grid-template-columns: 130px minmax(110px, 0.7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border-bottom: 1px solid #eceff3;
  font-size: 12px;
}

.media-link-row strong {
  color: #334155;
}

.media-link-row span {
  overflow: hidden;
  border: 1px solid #d5dee8;
  border-radius: 3px;
  padding: 3px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-link-row span.linked {
  background: #eef8ff;
  color: #174d7a;
}

.media-link-row span.missing {
  background: #f7f7f7;
  color: #777;
}

.media-link-row small {
  overflow: hidden;
  color: #475569;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.raw-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  max-height: 360px;
  overflow: auto;
}

.raw-field-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid #eceff3;
  padding: 7px 0;
  font-size: 12px;
}

.raw-field-row strong {
  color: #334155;
}

.raw-field-row span {
  color: #111;
  word-break: break-word;
}

.girls-list-toolbar {
  display: flex;
  align-items: center;
  min-height: 56px;
}

.girls-search {
  position: relative;
  width: 252px;
}

.girls-search input {
  width: 100%;
  border-color: #9eb5d7;
  background: #fffde9;
  padding-right: 36px;
}

.girls-search span {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 20px;
}

.girls-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
}

.blue-action {
  background: #28608f;
}

.blue-action:hover {
  background: #1f4f78;
}

.girls-tabs {
  display: grid;
  grid-template-columns: 130px 150px 1fr;
  align-items: end;
  border-bottom: 1px solid #b7bcc3;
}

.girls-tab {
  height: 42px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  color: #111;
  font-weight: 400;
}

.girls-tab.active {
  border-color: #b7bcc3;
  background: #fff;
}

.girls-list-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-bottom: 7px;
  font-size: 13px;
}

.pager-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid #b9c2cc;
  border-radius: 50%;
  color: #657181;
}

.pager-dot.active {
  border-color: #68717b;
  background: #68717b;
  color: #fff;
}

.pager-next {
  min-height: 22px;
  border: 1px solid #b9c2cc;
  border-radius: 999px;
  background: #fff;
  color: #111;
  padding: 0 12px;
}

.girls-selection-row {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  min-height: 28px;
  padding: 7px 4px 0;
}

.girls-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 6px;
  align-items: start;
  max-height: calc(100vh - 270px);
  overflow: auto;
  border-left: 1px solid #c7cbd0;
  border-top: 1px solid #c7cbd0;
  padding: 0 0 24px 0;
}

.girl-card {
  position: relative;
  display: grid;
  grid-template-rows: 24px 1fr 22px 22px;
  justify-items: center;
  min-height: 170px;
  border-right: 1px solid #c7cbd0;
  border-bottom: 1px solid #c7cbd0;
  background: #fff;
  padding: 0 6px 5px;
}

.girl-card.selected {
  background: #fff9d8;
}

.girl-card-check {
  position: absolute;
  top: 30px;
  left: 4px;
  width: 16px;
  height: 16px;
}

.girl-card-check input {
  position: absolute;
  opacity: 0;
}

.girl-card-check span {
  display: block;
  width: 14px;
  height: 14px;
  border: 1px solid #9db4cc;
  border-radius: 50%;
  background: #fff;
}

.girl-card-check input:checked + span {
  border-color: #2f80ed;
  background: radial-gradient(circle at center, #2f80ed 0 42%, #fff 45%);
}

.girl-card-name {
  width: calc(100% + 12px);
  height: 24px;
  overflow: hidden;
  border-bottom: 1px solid #cfd6df;
  background: #f0f0f0;
  padding: 3px 4px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.girl-card-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 92px;
  margin-top: 5px;
  overflow: hidden;
  background: #eef2f6;
}

.girl-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.girl-card-placeholder {
  width: 100%;
  height: 100%;
  background: #d9dee6;
}

.girl-card-edit {
  width: 66px;
  min-height: 20px;
  height: 20px;
  border-radius: 1px;
  background: #1e679b;
  color: #fff;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.girl-card-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  color: #111;
  font-size: 12px;
  white-space: nowrap;
}

.girl-card-profile b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 18px;
  border-radius: 999px;
  background: #ff7a1a;
  color: #fff;
  font-size: 11px;
}

.girls-empty {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.cityheaven-import-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.cityheaven-import-panel[hidden] {
  display: none;
}

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

.import-table-wrap {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
}

.import-table {
  min-width: 980px;
}

.import-thumb {
  display: block;
  width: 52px;
  height: 68px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #eef2f6;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 0 4px 4px 0;
  border: 1px solid #b7c8da;
  border-radius: 999px;
  background: #f2f7fc;
  color: #24445f;
  padding: 0 8px;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef5fb;
  color: var(--blue-dark);
  font-size: 12px;
}

.badge.warn {
  background: #fff4e4;
  color: #8a5300;
}

.badge.ok {
  background: #eaf7f0;
  color: var(--green);
}

.result {
  min-height: 90px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 10px;
  white-space: pre-wrap;
}

.logs-panel {
  margin: 12px 30px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.logs-head {
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.logs {
  display: grid;
  max-height: 170px;
  overflow: auto;
}

.log-row {
  display: grid;
  grid-template-columns: 170px 170px minmax(0, 1fr);
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 6px 10px;
  color: var(--muted);
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
}

.modal-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(500px, calc(100vw - 28px));
  transform: translate(-50%, -50%);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
  padding: 16px 10px 10px;
}

.modal-card h2 {
  margin: 0 42px 36px 10px;
  font-size: 16px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  min-height: 28px;
  padding: 0;
  background: transparent;
  color: #111;
  font-size: 30px;
  line-height: 1;
}

.modal-close:hover {
  background: transparent;
}

.status-options {
  display: grid;
  gap: 12px;
  padding: 0 16px 34px;
}

.radio-row {
  display: grid;
  grid-template-columns: 24px 1fr 200px;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 8px;
  font-weight: 700;
}

.radio-row.selected {
  border-color: #e4d897;
  background: var(--yellow);
}

.radio-row input {
  width: 18px;
  height: 18px;
}

.radio-row select {
  width: 100%;
}

.site-picker {
  position: relative;
  display: inline-block;
  margin-left: 0;
}

.site-picker > button {
  width: 150px;
  height: 34px;
  border-radius: 2px;
}

.site-picker span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 999px;
  background: #3c7df0;
  color: #fff;
}

.site-checks {
  display: none;
  position: absolute;
  bottom: 40px;
  left: 0;
  width: 230px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  padding: 8px;
}

.site-picker.open .site-checks {
  display: grid;
  gap: 6px;
}

.modal-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
}

.danger-action {
  width: 150px;
  background: var(--red);
}

.danger-action:hover {
  background: #c92849;
}

.danger-action.live {
  background: #d92d50;
}

.danger-action.live:hover {
  background: #b4233f;
}

.running-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 31, 0.38);
}

.running-overlay.open {
  display: flex;
}

.running-card {
  display: grid;
  justify-items: center;
  gap: 9px;
  min-width: 230px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  padding: 22px 24px;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid #d8dee6;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.running-card strong {
  font-size: 16px;
}

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

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

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

  .sidebar {
    position: static;
  }

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

  .nav-item {
    padding-left: 14px;
  }

  .page,
  .placeholder {
    padding: 10px;
    margin: 0;
  }

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

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

  .logs-panel {
    margin: 12px 10px;
  }

  .radio-row {
    grid-template-columns: 24px 1fr;
  }

.radio-row select {
    grid-column: 2;
  }
}

.registration-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.girl-media-actions-panel.registration-controls {
  grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1fr) minmax(360px, auto);
  align-items: start;
}

.registration-section-title {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.registration-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 6px;
}

.registration-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.registration-status-panel {
  display: grid;
  gap: 14px;
}

.registration-status-toolbar,
.registration-status-actions,
.registration-status-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.registration-status-toolbar label {
  display: grid;
  gap: 4px;
}

.registration-status-toolbar input {
  min-width: 200px;
}

.registration-status-toolbar select {
  min-width: 210px;
}

.registration-status-meta {
  color: var(--muted);
  font-size: 12px;
}

.registration-status-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.registration-status-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

.registration-status-table th,
.registration-status-table td {
  border: 1px solid #c6ced8;
  padding: 8px;
  text-align: center;
  vertical-align: middle;
  font-size: 12px;
}

.registration-status-table thead th {
  background: #e8edf3;
  font-weight: 700;
}

.registration-check-col {
  width: 34px;
}

.registration-girl-col {
  width: 260px;
  text-align: left !important;
}

.registration-girl-cell {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.registration-girl-cell strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.registration-thumb {
  width: 40px;
  height: 48px;
  border-radius: 3px;
  background: #d7dde4;
  object-fit: cover;
  display: block;
}

.registration-public-pill {
  display: inline-block;
  margin-top: 4px;
  border: 1px solid #8ab8ff;
  border-radius: 9px;
  background: #e8f1ff;
  color: #2468bd;
  padding: 1px 8px;
  font-size: 11px;
}

.registration-status-cell {
  background: #f8fafc;
}

.registration-status-cell.registered {
  background: #f4fbf6;
}

.registration-status-cell.registered[data-platform-id] {
  cursor: pointer;
}

.registration-status-cell.registered[data-platform-id]:hover {
  background: #edf8ff;
  outline: 2px solid #4a90d9;
  outline-offset: -2px;
}

.registration-status-cell.registered[data-platform-id]:focus {
  outline: 2px solid #1e63a4;
  outline-offset: -2px;
}

.registration-status-cell.missing {
  background: #fff7f8;
}

.registration-status-cell.missing[data-platform-id] {
  cursor: pointer;
}

.registration-status-cell.missing[data-platform-id]:hover {
  background: #ffe8ec;
  outline: 2px solid #ef8aa0;
  outline-offset: -2px;
}

.registration-status-cell.missing[data-platform-id]:focus {
  outline: 2px solid #ef3d55;
  outline-offset: -2px;
}

.registration-status-cell.site-only {
  background: #fff9e8;
}

.registration-site-only-heading td {
  background: #eef2f6;
  color: #344054;
  font-weight: 700;
  text-align: left;
}

.registration-site-only-row .registration-girl-cell strong {
  color: #7a4a00;
}

.registration-public-pill.site-only {
  border-color: #d99a2b;
  background: #fff2cf;
  color: #7a4a00;
}

.registration-thumb.placeholder {
  border: 1px dashed #aab4c0;
}

.mini-btn {
  margin-top: 6px;
  padding: 3px 8px;
  border: 1px solid #c9d2dc;
  border-radius: 4px;
  background: #fff;
  color: #25313f;
  font-size: 11px;
  cursor: pointer;
}

.mini-btn.danger {
  border-color: #ef8a8a;
  color: #c82f2f;
}

.mini-btn.danger:hover {
  background: #fff1f1;
}

.registration-mark {
  display: block;
  color: #1e63a4;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}

.registration-status-cell.missing .registration-mark {
  color: #ef3d55;
}

.registration-status-cell.site-only .registration-mark {
  color: #b7791f;
}

.registration-status-label {
  display: block;
  margin-top: 3px;
  font-weight: 700;
}

.registration-status-cell small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.media-links-panel {
  display: grid;
  gap: 14px;
}

.media-links-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.media-links-toolbar label {
  display: grid;
  gap: 4px;
}

.media-links-toolbar input {
  min-width: 240px;
}

.media-links-toolbar select {
  min-width: 180px;
}

.media-links-meta {
  color: var(--muted);
  font-size: 12px;
  padding-bottom: 8px;
}

.media-links-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.media-links-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  table-layout: fixed;
}

.media-links-table th,
.media-links-table td {
  border: 1px solid #c6ced8;
  padding: 8px;
  vertical-align: middle;
  font-size: 12px;
}

.media-links-table thead th {
  background: #e8edf3;
  text-align: center;
  font-weight: 700;
}

.media-links-girl-col {
  width: 260px;
  text-align: left !important;
}

.media-links-girl-cell {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.media-links-girl-cell strong,
.media-link-cell strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-links-thumb {
  width: 40px;
  height: 48px;
  border-radius: 3px;
  background: #d7dde4;
  object-fit: cover;
  display: block;
}

.media-links-pill {
  display: inline-block;
  margin-top: 4px;
  border: 1px solid #8ab8ff;
  border-radius: 9px;
  background: #e8f1ff;
  color: #2468bd;
  padding: 1px 8px;
  font-size: 11px;
}

.media-link-cell {
  text-align: center;
  background: #f8fafc;
}

.media-link-cell.linked {
  background: #f4fbf6;
}

.media-link-cell.name-missing {
  background: #fff9e8;
}

.media-link-cell.missing {
  background: #fff7f8;
  color: #a42a3a;
}

.media-link-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.order-panel {
  max-width: 980px;
}

.order-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
}

.order-list {
  display: grid;
  gap: 4px;
}

.order-row {
  display: grid;
  grid-template-columns: 28px 44px 48px minmax(0, 1fr);
  align-items: center;
  min-height: 58px;
  border: 1px solid #c6ced8;
  background: #fff;
  cursor: grab;
}

.order-row.dragging {
  opacity: 0.55;
  border-color: #2468bd;
  background: #eef5ff;
}

.order-handle {
  color: #64748b;
  text-align: center;
  font-size: 16px;
}

.order-number {
  color: #1f2937;
  font-weight: 700;
  text-align: center;
}

.order-thumb {
  width: 38px;
  height: 48px;
  object-fit: cover;
  background: #d8dee6;
}

.order-girl-info {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-right: 10px;
}

.order-girl-info strong,
.order-girl-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-girl-info span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .registration-controls {
    grid-template-columns: 1fr;
  }

  .registration-actions {
    flex-wrap: wrap;
  }
}
