* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f5f7f6;
  color: #1a2b22;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #d4ddd9;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  color: #3d6b5a;
  text-decoration: none;
  font-weight: 600;
  padding: 0 20px 20px;
  border-bottom: 1px solid #e8edeb;
  margin-bottom: 12px;
}

.admin-logo-mark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.admin-logo-text span,
.admin-logo span { color: #6b8078; font-weight: 400; font-size: 13px; }

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  flex: 1;
}

.admin-nav a {
  color: #6b8078;
  text-decoration: none;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.admin-nav a:hover {
  color: #3d6b5a;
  background: #eaf2ee;
}

.admin-nav a.active {
  color: #1a2b22;
  background: #eaf2ee;
  font-weight: 600;
}

.admin-sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 12px 0;
  border-top: 1px solid #e8edeb;
  margin-top: 12px;
}

.admin-sidebar-footer a {
  color: #6b8078;
  text-decoration: none;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
}

.admin-sidebar-footer a:hover {
  color: #3d6b5a;
  background: #eaf2ee;
}

.admin-main {
  flex: 1;
  min-width: 0;
  max-width: 1100px;
  padding: 32px 28px;
}

@media (max-width: 768px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid #d4ddd9;
  }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-sidebar-footer { flex-direction: row; }
}

.admin-card {
  background: #fff;
  border: 1px solid #d4ddd9;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.admin-card-danger {
  border-color: #fecaca;
  background: #fffbfb;
}

.admin-card-danger .admin-section-title {
  color: #991b1b;
}

.btn:disabled,
button.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-card h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.admin-card h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.admin-section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 28px 0 12px;
  padding-top: 20px;
  border-top: 1px solid #e8edeb;
}

.admin-card p { color: #6b8078; font-size: 14px; margin-bottom: 16px; }

.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.admin-subnav a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #d4ddd9;
  color: #355247;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.admin-subnav a.active {
  background: #1f6b52;
  border-color: #1f6b52;
  color: #fff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6b8078;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d4ddd9;
  border-radius: 8px;
  font-size: 14px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary { background: #3d6b5a; color: #fff; }
.btn-primary:hover { background: #1a2b22; }
.btn-secondary { background: #fff; color: #6b8078; border: 1px solid #d4ddd9; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.alert-error {
  background: #fef3f2;
  border: 1px solid #fecdca;
  color: #b42318;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 14px;
}

.alert-success {
  background: #eaf2ee;
  border: 1px solid #c2d9cf;
  color: #3d6b5a;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e8edeb;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.data-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b8078;
}

@media (max-width: 768px) {
  .data-table.data-table-stack thead {
    display: none;
  }

  .data-table.data-table-stack,
  .data-table.data-table-stack tbody,
  .data-table.data-table-stack tr,
  .data-table.data-table-stack td {
    display: block;
    width: 100%;
  }

  .data-table.data-table-stack tr {
    border: 1px solid #e8edeb;
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #fff;
  }

  .data-table.data-table-stack td {
    border-bottom: none;
    padding: 8px 0;
    display: grid;
    grid-template-columns: minmax(72px, 30%) 1fr;
    gap: 8px 12px;
    align-items: start;
  }

  .data-table.data-table-stack td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b8078;
    padding-top: 2px;
  }

  .data-table.data-table-stack td .actions,
  .data-table.data-table-stack td.cms-actions .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .data-table.data-table-stack .cms-slug-link,
  .data-table.data-table-stack .cms-slug-draft {
    word-break: break-all;
  }
}

.data-table tr.row-closed {
  background: #f3f4f6;
  color: #9ca3af;
}

.data-table tr.row-closed td {
  border-bottom-color: #e5e7eb;
}

.data-table tr.row-closed strong,
.data-table tr.row-closed .hint {
  color: #9ca3af;
}

.data-table tr.row-closed .doctor-thumb-img {
  opacity: 0.45;
  filter: grayscale(1);
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  font-size: 14px;
  color: #6b8078;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eaf2ee;
}

.login-card {
  background: #fff;
  border-radius: 14px;
  padding: 36px;
  width: 100%;
  max-width: 400px;
  border: 1px solid #d4ddd9;
}

.login-card h1 {
  font-size: 26px;
  margin-bottom: 6px;
  color: #3d6b5a;
}

.admin-login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-login-brand .admin-logo-mark {
  width: 28px;
  height: 28px;
}

.login-card p { margin-bottom: 20px; color: #6b8078; }

.hint { font-size: 12px; color: #6b8078; margin-top: 12px; }

.import-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #6b8078;
  margin-bottom: 8px;
}

.import-progress-track {
  height: 10px;
  background: #eaf2ee;
  border-radius: 999px;
  overflow: hidden;
}

.import-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #3d6b5a, #5a9e87);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.doctor-thumb-cell { width: 48px; height: 48px; }
.doctor-thumb-img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.doctor-thumb-fallback {
  width: 48px; height: 48px; align-items: center; justify-content: center;
  background: #eaf2ee; border-radius: 8px; color: #6b8078; font-size: 12px;
}

.integration-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.badge-integrated {
  display: inline-block;
  background: #059669;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-closed {
  display: inline-block;
  background: #6b7280;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: 6px;
}

.provider-id-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.provider-id-row .form-control {
  flex: 1;
}

.provider-id-row .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── CMS admin styles ── */
.cms-index-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cms-filter-bar {
  margin-bottom: 16px;
}

.cms-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cms-badge-blog    { background: #dbeafe; color: #1d4ed8; }
.cms-badge-service { background: #d1fae5; color: #065f46; }

.cms-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.cms-status-live  { background: #d1fae5; color: #065f46; }
.cms-status-draft { background: #f3f4f6; color: #6b7280; }

.cms-slug-link   { color: #1d4ed8; font-size: 13px; text-decoration: none; }
.cms-slug-link:hover { text-decoration: underline; }
.cms-slug-draft  { color: #9ca3af; font-size: 13px; }

.cms-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a2b22;
}

.cms-required { color: #b91c1c; }
.cms-hint-inline { font-size: 12px; color: #6b8078; font-weight: 400; }

.cms-slug-preview-row {
  display: flex;
  align-items: center;
  gap: 0;
}
.cms-slug-base {
  background: #f1f5f2;
  border: 1px solid #d4ddd9;
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 10px 10px;
  font-size: 13px;
  color: #6b8078;
  white-space: nowrap;
}
.cms-slug-preview-row .form-control {
  border-radius: 0 8px 8px 0;
}

.cms-body-editor {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
}

.cms-current-image {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}
.cms-img-preview {
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d4ddd9;
}
.cms-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #b91c1c;
  cursor: pointer;
}

.cms-form-footer {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cms-input-error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.cms-char-counter.cms-char-over {
  color: #dc2626;
  font-weight: 600;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #f5f7f6;
  border: 1px solid #d4ddd9;
  border-radius: 12px;
  padding: 18px 16px;
  text-decoration: none;
  color: inherit;
}

a.dash-stat:hover {
  border-color: #3d6b5a;
  background: #eaf2ee;
}

.dash-stat-value {
  font-size: 44px;
  font-weight: 700;
  color: #1a2b22;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.dash-stat-label {
  font-size: 36px;
  font-weight: 600;
  color: #3d6b5a;
}

.dash-stat-hint {
  font-size: 12px;
  color: #6b8078;
}

/* Doctor Languages — master / detail */
.lang-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.lang-split-list,
.lang-split-detail {
  margin-bottom: 0;
}

.lang-table .lang-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.lang-table .lang-row:hover {
  background: #f3f8f5;
}

.lang-table .lang-row.is-selected {
  background: #eaf2ee;
}

.lang-table .lang-row.is-selected td {
  border-bottom-color: #c2d9cf;
}

.lang-table .lang-row:focus-visible {
  outline: 2px solid #3d6b5a;
  outline-offset: -2px;
}

.lang-split-detail h2 {
  margin-bottom: 8px;
}

.lang-detail-hint,
.lang-detail-status {
  color: #6b8078;
  font-size: 14px;
  margin: 0;
}

.lang-detail-status.is-error {
  color: #b42318;
}

.lang-doctor-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: min(70vh, 640px);
  overflow: auto;
}

.lang-doctor-list li + li {
  border-top: 1px solid #e8edeb;
}

.lang-doctor-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 4px;
  text-decoration: none;
  color: inherit;
}

.lang-doctor-link:hover strong {
  color: #3d6b5a;
}

.lang-doctor-meta {
  font-size: 12px;
  color: #6b8078;
}

@media (max-width: 900px) {
  .lang-split {
    grid-template-columns: 1fr;
  }
}

