/* DT CMS Backend Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --radius: 10px;
  --transition: .2s ease;
  font-family: 'Inter', sans-serif;
}

/* ── DARK THEME (default) ───────────────────────────────── */
[data-bs-theme="dark"] {
  --bg: #0f1117;
  --bg2: #161b27;
  --bg3: #1e2535;
  --sidebar-bg: #13192a;
  --topbar-bg: rgba(19,25,42,.95);
  --border: #2a3348;
  --text: #e2e8f0;
  --text-muted: #7a8899;
  --nav-hover: rgba(99,179,237,.08);
  --nav-active: rgba(99,179,237,.15);
  --nav-active-text: #63b3ed;
  --brand-text: #fff;
  --card-bg: #1e2535;
  --input-bg: #161b27;
}

/* ── LIGHT THEME ────────────────────────────────────────── */
[data-bs-theme="light"] {
  --bg: #f0f4f8;
  --bg2: #fff;
  --bg3: #f8fafc;
  --sidebar-bg: #1a2035;
  --topbar-bg: rgba(255,255,255,.95);
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --nav-hover: rgba(255,255,255,.08);
  --nav-active: rgba(255,255,255,.15);
  --nav-active-text: #fff;
  --brand-text: #fff;
  --card-bg: #fff;
  --input-bg: #f8fafc;
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); display: flex; min-height: 100vh; font-size: 14px; }
a { color: inherit; text-decoration: none; }

/* ── SIDEBAR ───────────────────────────────────────────── */
.dt-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  scrollbar-width: thin;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-text);
  border-bottom: 1px solid rgba(255,255,255,.07);
  letter-spacing: -.3px;
}
.sidebar-brand .bi { font-size: 22px; }
.sidebar-nav { padding: 12px 0 20px; }
.nav-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 14px 20px 6px;
}
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.65);
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  font-size: 13.5px;
}
.sidebar-nav .nav-link:hover { background: var(--nav-hover); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--nav-active); color: var(--nav-active-text); font-weight: 600; }
.sidebar-nav .nav-link .bi { font-size: 15px; width: 16px; flex-shrink: 0; }
.sidebar-nav .nav-link .badge { margin-left: auto; }

/* ── MAIN ───────────────────────────────────────────────── */
.dt-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin var(--transition);
}

/* ── TOPBAR ─────────────────────────────────────────────── */
.dt-topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 99;
  backdrop-filter: blur(12px);
}
.topbar-title { font-weight: 600; font-size: 15px; }

/* ── CONTENT ─────────────────────────────────────────────── */
.dt-content { padding: 24px; flex: 1; }

/* ── CARDS ───────────────────────────────────────────────── */
.dt-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.dt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.dt-card-title { font-weight: 600; font-size: 15px; }

/* ── STAT CARDS ──────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-card .stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.stat-card .stat-value { font-size: 26px; font-weight: 700; }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ── TABLE ───────────────────────────────────────────────── */
.dt-table { width: 100%; border-collapse: collapse; }
.dt-table th, .dt-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.dt-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); font-weight: 600; }
.dt-table tbody tr:hover { background: rgba(99,179,237,.04); }
.dt-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-control, .form-select {
  background: var(--input-bg) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.form-control:focus, .form-select:focus {
  box-shadow: 0 0 0 3px rgba(99,179,237,.2) !important;
  border-color: #63b3ed !important;
}
.form-label { font-weight: 500; font-size: 13px; margin-bottom: 5px; }

/* ── EDITOR ──────────────────────────────────────────────── */
#quill-editor { min-height: 320px; background: var(--input-bg); color: var(--text); border-radius: 0 0 8px 8px; }
.ql-toolbar { background: var(--bg3); border-color: var(--border) !important; border-radius: 8px 8px 0 0; }
.ql-container { border-color: var(--border) !important; }
[data-bs-theme="dark"] .ql-snow .ql-stroke { stroke: var(--text-muted); }
[data-bs-theme="dark"] .ql-snow .ql-fill { fill: var(--text-muted); }
[data-bs-theme="dark"] .ql-snow .ql-picker { color: var(--text-muted); }

/* ── MEDIA GRID ──────────────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.media-item {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition);
  position: relative;
}
.media-item:hover { border-color: #63b3ed; }
.media-item img, .media-item video { width: 100%; height: 110px; object-fit: cover; display: block; }
.media-item .media-name { padding: 6px 8px; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-item .media-actions { position: absolute; top: 6px; right: 6px; display: none; }
.media-item:hover .media-actions { display: flex; gap: 4px; }

/* ── LOGIN PAGE ──────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .bi { font-size: 42px; color: #63b3ed; }
.login-logo h1 { font-size: 22px; font-weight: 700; margin-top: 8px; }

/* ── BADGES / STATUS ─────────────────────────────────────── */
.status-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-published { background: rgba(72,187,120,.15); color: #48bb78; }
.status-draft { background: rgba(160,174,192,.15); color: #a0aec0; }
.status-pending { background: rgba(246,173,85,.15); color: #f6ad55; }
.status-active { background: rgba(72,187,120,.15); color: #48bb78; }
.status-inactive { background: rgba(245,101,101,.15); color: #f56565; }

/* ── SIDEBAR COLLAPSED ───────────────────────────────────── */
body.sidebar-collapsed .dt-sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .dt-main { margin-left: 0; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .dt-sidebar { transform: translateX(-100%); }
  .dt-main { margin-left: 0; }
  body.sidebar-open .dt-sidebar { transform: translateX(0); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── MISC ─────────────────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 20px; font-weight: 700; }
.btn-icon { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; background: rgba(99,179,237,.1); color: #63b3ed; border: 1px solid rgba(99,179,237,.25); border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 500; }
.tag-chip button { background: none; border: none; color: inherit; padding: 0; cursor: pointer; line-height: 1; }

/* ── SEARCH RESULTS ──────────────────────────────────────────────── */
.search-result-item {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  text-decoration: none;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(99,179,237,.08); color: var(--text); }
