/* ==========================================================================
   Kolkata Today CMS — admin-dashboard.css
   Dense dashboard widgets: tiles, cards, charts, activity feed
   Append or link after admin.css
   ========================================================================== */

/* ─── Header ──────────────────────────────────────────────── */
.kt-dash-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.kt-dash-head h1 {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 700;
}
.kt-dash-head p {
  margin: 0;
  font-size: 14px;
}
.kt-dash-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ─── Stat tiles ──────────────────────────────────────────── */
.kt-dash-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.kt-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--kt-admin-border);
  border-radius: 8px;
  color: var(--kt-admin-text);
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  position: relative;
  overflow: hidden;
}
.kt-tile::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--tile-color, #888);
}
.kt-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  border-color: var(--tile-color, var(--kt-admin-border-strong));
  text-decoration: none;
}
.kt-tile-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--tile-bg, #f0f3f6);
  border-radius: 8px;
  flex-shrink: 0;
}
.kt-tile-body { flex: 1; min-width: 0; }
.kt-tile-num {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--kt-admin-text);
}
.kt-tile-label {
  font-size: 12px;
  color: var(--kt-admin-muted);
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Color variants */
.kt-tile-blue   { --tile-color: #3a8efb; --tile-bg: #e7f1fe; }
.kt-tile-gray   { --tile-color: #6c757d; --tile-bg: #eceef0; }
.kt-tile-amber  { --tile-color: #f39c12; --tile-bg: #fdf2d8; }
.kt-tile-green  { --tile-color: #27ae60; --tile-bg: #e0f3e6; }
.kt-tile-purple { --tile-color: #8e44ad; --tile-bg: #f1e4f6; }
.kt-tile-pink   { --tile-color: #e91e63; --tile-bg: #fce0e8; }
.kt-tile-orange { --tile-color: #e67e22; --tile-bg: #fbe9d7; }
.kt-tile-teal   { --tile-color: #16a085; --tile-bg: #d9f0ea; }
.kt-tile-red    { --tile-color: var(--kt-admin-red); --tile-bg: #fce8e6; }

/* ─── Dashboard grid (main + sidebar) ─────────────────────── */
.kt-dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 320px;
  gap: 20px;
  align-items: start;
}
.kt-dash-main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.kt-dash-side { display: flex; flex-direction: column; gap: 20px; }
.kt-dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ─── Generic card ───────────────────────────────────────── */
.kt-card {
  background: #fff;
  border: 1px solid var(--kt-admin-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.kt-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--kt-admin-border);
  background: #fafbfc;
  gap: 12px;
}
.kt-card-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--kt-admin-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.kt-card-count {
  background: var(--kt-admin-red);
  color: #fff;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.kt-card-more {
  font-size: 12px;
  color: var(--kt-admin-red);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.kt-card-more:hover { text-decoration: underline; }
.kt-card-body { padding: 14px 18px; }
.kt-card-body-flush { padding: 0; }

/* ─── Empty state ────────────────────────────────────────── */
.kt-empty-state {
  text-align: center;
  padding: 24px 12px;
  color: var(--kt-admin-muted);
  font-size: 13px;
}
.kt-empty-icon {
  font-size: 28px;
  color: #27ae60;
  margin-bottom: 8px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e0f3e6;
  border-radius: 50%;
}
.kt-empty-state p { margin: 8px 0 0; }

/* ─── Comment queue ──────────────────────────────────────── */
.kt-comment-queue {
  list-style: none;
  margin: 0;
  padding: 0;
}
.kt-comment-queue li {
  padding: 14px 0;
  border-bottom: 1px solid var(--kt-admin-border);
}
.kt-comment-queue li:first-child { padding-top: 0; }
.kt-comment-queue li:last-child { padding-bottom: 0; border-bottom: 0; }
.kt-comment-meta {
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--kt-admin-text);
}
.kt-comment-meta strong { font-weight: 600; }
.kt-comment-meta a {
  color: var(--kt-admin-red);
  text-decoration: none;
  font-weight: 500;
}
.kt-comment-meta a:hover { text-decoration: underline; }
.kt-comment-ago {
  color: var(--kt-admin-muted);
  font-size: 11px;
  float: right;
}
.kt-comment-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--kt-admin-text);
  margin-bottom: 10px;
  padding: 10px 12px;
  background: #fafbfc;
  border-left: 3px solid var(--kt-admin-border-strong);
  border-radius: 3px;
}
.kt-comment-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.kt-comment-actions .kt-linkbtn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
}
.kt-btn-approve {
  background: #e0f3e6 !important;
  color: #155724 !important;
  border-color: #bce0c5 !important;
}
.kt-btn-approve:hover {
  background: #c8e9d2 !important;
}

/* ─── Simple list (drafts, scheduled) ────────────────────── */
.kt-simple-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.kt-simple-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--kt-admin-border);
}
.kt-simple-list li:first-child { padding-top: 0; }
.kt-simple-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.kt-simple-list a {
  display: block;
  font-size: 13px;
  color: var(--kt-admin-text);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 2px;
}
.kt-simple-list a:hover {
  color: var(--kt-admin-red);
  text-decoration: none;
}
.kt-simple-meta {
  font-size: 11px;
  color: var(--kt-admin-muted);
}

/* ─── Table inside dashboard cards ───────────────────────── */
.kt-table-dash {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.kt-table-dash th {
  background: #fafbfc;
  font-size: 10px;
}
.kt-table-dash td, .kt-table-dash th {
  padding: 9px 14px;
}
.kt-table-dash td.num {
  font-variant-numeric: tabular-nums;
  color: var(--kt-admin-muted);
}
.kt-table-dash td.muted { color: var(--kt-admin-muted); font-size: 12px; }
.kt-col-title { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Category bar chart ─────────────────────────────────── */
.kt-cat-chart {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kt-cat-chart li { }
.kt-cat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
  font-size: 12px;
}
.kt-cat-name {
  color: var(--kt-admin-text);
  text-decoration: none;
  font-weight: 500;
}
.kt-cat-name:hover { color: var(--kt-admin-red); text-decoration: none; }
.kt-cat-count {
  font-variant-numeric: tabular-nums;
  color: var(--kt-admin-muted);
  font-weight: 600;
  font-size: 11px;
}
.kt-cat-bar {
  height: 6px;
  background: #eef1f4;
  border-radius: 3px;
  overflow: hidden;
}
.kt-cat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--kt-admin-red), #e67e22);
  border-radius: 3px;
  transition: width .4s ease;
}

/* ─── Popular posts list ─────────────────────────────────── */
.kt-popular-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: pop;
}
.kt-popular-list li {
  position: relative;
  padding: 8px 0 8px 28px;
  border-bottom: 1px solid var(--kt-admin-border);
  counter-increment: pop;
}
.kt-popular-list li::before {
  content: counter(pop);
  position: absolute;
  left: 0;
  top: 10px;
  width: 20px;
  height: 20px;
  background: var(--kt-admin-red);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}
.kt-popular-list li:first-child { padding-top: 0; }
.kt-popular-list li:first-child::before { top: 2px; }
.kt-popular-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.kt-popular-title {
  display: block;
  font-size: 13px;
  color: var(--kt-admin-text);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 3px;
}
.kt-popular-title:hover { color: var(--kt-admin-red); text-decoration: none; }
.kt-popular-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
}
.kt-popular-views { color: var(--kt-admin-text); font-weight: 600; }

/* ─── At a glance (quick stats sidebar) ──────────────────── */
.kt-quick-stats,
.kt-system-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.kt-quick-stats li,
.kt-system-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--kt-admin-border);
  font-size: 13px;
}
.kt-quick-stats li:first-child,
.kt-system-list li:first-child { padding-top: 0; }
.kt-quick-stats li:last-child,
.kt-system-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.kt-quick-stats span,
.kt-system-list span {
  color: var(--kt-admin-muted);
  font-size: 12px;
}
.kt-quick-stats strong,
.kt-system-list strong {
  font-weight: 700;
  color: var(--kt-admin-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.kt-warn { color: #b07820 !important; }

/* Status dots */
.kt-dot-green,
.kt-dot-amber,
.kt-dot-red {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kt-dot-green { background: #27ae60; }
.kt-dot-amber { background: #f39c12; }
.kt-dot-red   { background: var(--kt-admin-red); }

/* ─── Activity feed ──────────────────────────────────────── */
.kt-activity {
  list-style: none;
  margin: 0;
  padding: 0;
}
.kt-activity li {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--kt-admin-border);
}
.kt-activity li:first-child { padding-top: 0; }
.kt-activity li:last-child { padding-bottom: 0; border-bottom: 0; }
.kt-activity-icon {
  font-size: 18px;
  width: 32px;
  height: 32px;
  background: #f0f3f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kt-activity-body { flex: 1; min-width: 0; }
.kt-activity-body a {
  display: block;
  font-size: 13px;
  color: var(--kt-admin-text);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kt-activity-body a:hover { color: var(--kt-admin-red); text-decoration: none; }
.kt-activity-meta { font-size: 11px; color: var(--kt-admin-muted); }

/* ─── Quick links ────────────────────────────────────────── */
.kt-quick-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.kt-quick-links li {
  border-bottom: 1px solid var(--kt-admin-border);
}
.kt-quick-links li:last-child { border-bottom: 0; }
.kt-quick-links a {
  display: block;
  padding: 9px 0;
  font-size: 13px;
  color: var(--kt-admin-text);
  text-decoration: none;
  font-weight: 500;
  transition: color .12s, padding-left .15s;
}
.kt-quick-links a:hover {
  color: var(--kt-admin-red);
  padding-left: 4px;
  text-decoration: none;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1400px) {
  .kt-dash-tiles { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1200px) {
  .kt-dash-grid { grid-template-columns: 1fr; }
  .kt-dash-side { flex-direction: row; flex-wrap: wrap; }
  .kt-dash-side > .kt-card { flex: 1 1 calc(50% - 10px); min-width: 280px; }
}
@media (max-width: 900px) {
  .kt-dash-tiles { grid-template-columns: repeat(2, 1fr); }
  .kt-dash-row { grid-template-columns: 1fr; }
  .kt-dash-side { flex-direction: column; }
  .kt-dash-side > .kt-card { flex: 1; min-width: auto; }
}
@media (max-width: 600px) {
  .kt-dash-head { flex-direction: column; align-items: flex-start; }
  .kt-dash-head-actions { width: 100%; }
  .kt-tile-num { font-size: 20px; }
  .kt-col-title { max-width: 180px; }
}
