/* ===== ATNews admin – pro layer (load after admin-extras.css) ===== */

/* ---- Editor + live app preview ---- */
.editor-body {
  display: flex;
  gap: 26px;
  flex: 1;
  min-height: 0;
}
.editor-body .popup-form-scroll {
  flex: 1;
  min-width: 0;
}
.app-preview {
  display: none;
  width: 290px;
  flex-shrink: 0;
}
@media (min-width: 1100px) {
  #newsOverlay .popup {
    max-width: 1090px;
  }
  .app-preview {
    display: block;
  }
}
.preview-label {
  font: 700 10.5px var(--font-body);
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 2px 0 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.preview-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}
.phone {
  border: 8px solid #14181f;
  border-radius: 34px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(20, 24, 31, 0.22);
  position: sticky;
  top: 0;
}
.phone-bar {
  display: flex;
  justify-content: space-between;
  padding: 9px 18px 7px;
  font: 600 11px var(--font-body);
  color: var(--ink);
  background: #fff;
}
.pv-img {
  height: 160px;
  background: #e9e6dc center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b3ad9f;
  font-size: 26px;
}
.pv-body {
  padding: 14px 15px 16px;
}
.pv-cat {
  display: inline-block;
  font: 700 10px var(--font-body);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 3px 9px;
  border-radius: 100px;
}
.pv-title {
  font: 700 16px/1.4 var(--font-body);
  color: var(--ink);
  margin: 9px 0 6px;
  word-break: break-word;
}
.pv-title.ph,
.pv-sum.ph {
  color: #b3ad9f;
}
.pv-sum {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.pv-tags span {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--press-blue);
}
.pv-meta {
  font-size: 11px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  padding-top: 9px;
}
.draft-state {
  font-size: 11px;
  color: var(--ink-faint);
  margin-right: auto;
}

/* ---- Overview dashboard ---- */
.ov-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 960px) {
  .ov-grid {
    grid-template-columns: 1fr;
  }
}
.ov-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.ov-card h3 {
  font: 700 15px var(--font-display);
  margin: 0 0 14px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ov-card h3 i {
  color: var(--accent);
  font-size: 13px;
}
.bar-row {
  display: grid;
  grid-template-columns: 118px 1fr 34px;
  gap: 10px;
  align-items: center;
  margin: 9px 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
}
.bar-row:hover b {
  color: var(--accent);
}
.bar-row b {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}
.bar {
  height: 8px;
  border-radius: 99px;
  background: #efece3;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #e0675a);
  border-radius: 99px;
  transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bar-row em {
  font: 600 12px var(--font-mono);
  font-style: normal;
  text-align: right;
  color: var(--ink);
}
.lat-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f1efe9;
  cursor: pointer;
}
.lat-row:last-child {
  border-bottom: 0;
}
.lat-row:hover .lat-t {
  color: var(--accent);
}
.lat-img {
  width: 52px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  background: #e9e6dc;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b3ad9f;
  font-size: 13px;
}
.lat-t {
  font: 600 13px/1.35 var(--font-body);
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s;
}
.lat-m {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 2px;
}
.ov-note {
  font-size: 12.5px;
  color: var(--ink-faint);
  padding: 8px 0;
}
.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  font-size: 13px;
  border-bottom: 1px solid #f1efe9;
}
.rank-row:last-child {
  border-bottom: 0;
}
.rank-n {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  font: 700 11px var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rank-row b {
  flex: 1;
  font-weight: 600;
}

/* ---- Undo toast ---- */
.toast .undo-btn {
  margin-left: auto;
  border: 0;
  background: var(--ink);
  color: #fff;
  font: 600 11.5px var(--font-body);
  padding: 5px 12px;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
}
.toast .undo-btn:hover {
  background: var(--accent);
}
.toast.has-action i {
  color: var(--ink-soft);
}
tr.row-pending {
  display: none;
}

/* ---- Ctrl+K quick find ---- */
.cmdk-overlay {
  position: fixed;
  inset: 0;
  z-index: 30000;
  background: rgba(8, 12, 22, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  animation: ex-toast-in 0.15s ease both;
}
.cmdk {
  width: min(560px, 92vw);
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.cmdk input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
  font: 500 16px var(--font-body);
  outline: none;
  color: var(--ink);
}
.cmdk-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
}
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
}
.cmdk-item i {
  width: 18px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}
.cmdk-item span {
  margin-left: auto;
  font: 600 10.5px var(--font-body);
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.cmdk-item.sel {
  background: var(--accent-soft);
}
.cmdk-item.sel i {
  color: var(--accent);
}
.cmdk-empty {
  padding: 22px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}
.cmdk-foot {
  border-top: 1px solid var(--line);
  padding: 9px 16px;
  font-size: 11px;
  color: var(--ink-faint);
  background: #faf9f6;
  display: flex;
  gap: 16px;
}
.cmdk-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* ---- Fix: preview must stay inside the editor ---- */
.editor-body {
  align-items: stretch;
}
.app-preview {
  width: 262px;
  min-height: 0;
  align-self: stretch;
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.app-preview::-webkit-scrollbar {
  display: none;
}
.phone {
  position: static;
  border-width: 7px;
  border-radius: 30px;
}
.pv-img {
  height: 124px;
}
.pv-title {
  font-size: 15px;
  -webkit-line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pv-sum {
  -webkit-line-clamp: 3;
  font-size: 12px;
}
#newsOverlay .btn-row {
  position: relative;
  z-index: 2;
  background: #fff;
}

/* ---- Delete confirmation popup ---- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 25000;
  background: rgba(8, 12, 22, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: ex-toast-in 0.18s ease both;
}
.confirm-box {
  width: min(430px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 28px 26px 22px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--accent);
}
.confirm-ico {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.confirm-box h4 {
  font: 700 21px var(--font-display);
  margin: 0 0 6px;
  color: var(--ink);
}
.confirm-msg {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin: 0 0 14px;
}
.confirm-detail {
  background: #faf9f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: 600 13px/1.5 var(--font-body);
  color: var(--ink);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.confirm-warn {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin: 0 0 20px;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.confirm-actions .btn-cancel-modern,
.confirm-danger {
  min-width: 132px;
}
.confirm-danger {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font: 600 13px var(--font-body);
  cursor: pointer;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(192, 57, 43, 0.25);
  transition: background 0.15s;
}
.confirm-danger:hover {
  background: var(--accent-dark);
}
.confirm-actions button:focus-visible {
  outline: 3px solid rgba(47, 91, 234, 0.4);
  outline-offset: 2px;
}
tr.row-deleting {
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* ---- Website links ---- */
.site-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  border-radius: 100px;
  padding: 3px 12px;
  font: 600 11px var(--font-body);
  letter-spacing: 0;
  transition:
    background 0.15s,
    transform 0.1s;
}
.site-link:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}
.site-link i {
  font-size: 10px;
}
.footer-site {
  margin-left: auto;
  color: #8f99ae;
  text-decoration: none;
  font-size: 11px;
  white-space: nowrap;
  transition: color 0.15s;
}
.footer-site:hover {
  color: #fff;
}
.footer-site i {
  font-size: 9px;
  margin-left: 3px;
}
@media (max-width: 640px) {
  .site-link span {
    display: none;
  }
  .site-link {
    padding: 4px 9px;
  }
}

/* ---- Video thumbnails + lightbox ---- */
.thumb-wrap {
  position: relative;
  width: 84px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 8px;
}
.thumb-wrap.lat {
  width: 52px;
  height: 38px;
  border-radius: 6px;
}
.thumb-wrap[data-img],
.thumb-wrap[data-vid] {
  cursor: zoom-in;
}
.thumb-wrap .story-thumb {
  width: 100%;
  height: 100%;
  display: flex;
}
.thumb-wrap video.story-thumb {
  object-fit: cover;
  background: #14181f;
}
.thumb-wrap.lat .story-thumb {
  border-radius: 6px;
  font-size: 13px;
}
.play-badge {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(20, 24, 31, 0.72);
  color: #fff;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85);
}
.thumb-wrap.lat .play-badge {
  width: 16px;
  height: 16px;
  font-size: 6px;
  right: 3px;
  bottom: 3px;
}
.play-badge i {
  margin-left: 1px;
}
.pv-img {
  position: relative;
  overflow: hidden;
}
.pv-img video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.play-badge.big {
  width: 38px;
  height: 38px;
  font-size: 14px;
  right: 50%;
  bottom: 50%;
  transform: translate(50%, 50%);
}

.media-lb {
  position: fixed;
  inset: 0;
  z-index: 26000;
  background: rgba(8, 12, 22, 0.88);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  animation: ex-toast-in 0.18s ease both;
}
.media-stage {
  max-width: min(1000px, 94vw);
  max-height: 86vh;
  display: flex;
}
.media-stage img,
.media-stage video {
  max-width: 100%;
  max-height: 86vh;
  border-radius: 10px;
  background: #000;
  box-shadow: var(--shadow-lg);
}
.media-x {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}
.media-x:hover {
  background: var(--accent);
}

/* ---- Save error details dialog ---- */
.err-box {
  width: min(660px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}
.err-box .confirm-msg {
  margin-bottom: 4px;
}
.err-h {
  font: 700 10.5px var(--font-body);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 12px 0 0;
  text-align: left;
}
.err-pre {
  background: #14181f;
  color: #e8eaf0;
  border-radius: 8px;
  padding: 11px 14px;
  font: 12px/1.55 var(--font-mono);
  max-height: 170px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 6px 0 4px;
  text-align: left;
}
.err-box .confirm-actions {
  margin-top: 16px;
}
