/* ============================================================
   FACTLINE — Admin (관리자) page styles
   Dark theme via [data-theme="dark"] tokens (in tokens.css).
   Layout: fixed header + fixed sidebar + scrollable main + sliding panel.
   ============================================================ */

.page-admin {
  background: var(--bg-white);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* =========================================================
   Header — dark-mode overrides for the components.css header
   (only kick in when data-theme=dark, so index/report unaffected)
   ========================================================= */
[data-theme="dark"] .site-header {
  background: rgba(26, 26, 31, 0.85);
  border-bottom: 1px solid var(--border-light);
}
[data-theme="dark"] .site-header.is-scrolled {
  background: rgba(26, 26, 31, 0.94);
}
[data-theme="dark"] .nav-primary a:not(.btn-ghost) {
  color: var(--text-secondary);
}
[data-theme="dark"] .nav-primary a:not(.btn-ghost):hover {
  color: #FFFFFF;
}
[data-theme="dark"] .nav-primary a[aria-current="page"] {
  color: #FFFFFF;
}
[data-theme="dark"] .nav-toggle:hover { background: var(--bg-card); }
[data-theme="dark"] .nav-toggle-bar,
[data-theme="dark"] .nav-toggle-bar::before,
[data-theme="dark"] .nav-toggle-bar::after {
  background: var(--text-secondary);
}
[data-theme="dark"] .nav-mobile {
  background: rgba(26, 26, 31, 0.98);
}
[data-theme="dark"] .nav-mobile-list a {
  color: #FFFFFF;
  border-bottom-color: var(--border-light);
}

/* ---- Admin profile chip in header ---- */
.admin-profile {
  position: relative;
  margin-left: 8px;
}

.admin-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.admin-profile-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-default);
}

.admin-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  color: #FFFFFF;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-name { white-space: nowrap; }
.admin-caret { color: var(--text-tertiary); flex-shrink: 0; }

.admin-profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 150;
  display: flex;
  flex-direction: column;
}

.admin-profile-menu a,
.admin-profile-menu button {
  display: block;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background 160ms ease, color 160ms ease;
}

.admin-profile-menu a:hover,
.admin-profile-menu button:hover {
  background: var(--bg-card);
  color: #FFFFFF;
}

.admin-profile-logout {
  color: #F87171 !important;
  border-top: 1px solid var(--border-light) !important;
  margin-top: 4px;
  padding-top: 14px !important;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
}

/* =========================================================
   Sidebar
   ========================================================= */
.admin-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 240px;
  height: calc(100vh - var(--header-height));
  background: var(--bg-soft);
  border-right: 1px solid var(--border-light);
  padding: 24px 16px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-label {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  padding: 0 12px;
  margin-bottom: 16px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 180ms ease, color 180ms ease;
}

.sidebar-item:hover {
  background: var(--bg-card);
  color: #FFFFFF;
}

.sidebar-item.is-active {
  background: rgba(124, 58, 237, 0.18);
  color: var(--purple-300);
}

.sidebar-item.is-active::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--purple-500);
  border-radius: 0 2px 2px 0;
}

.sidebar-icon {
  color: currentColor;
  flex-shrink: 0;
}

.sidebar-badge {
  margin-left: auto;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--purple-500);
  color: #FFFFFF;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item-danger { color: #F87171; }
.sidebar-item-danger:hover { background: rgba(239, 68, 68, 0.12); color: #FCA5A5; }

/* Sidebar scrim (mobile drawer) */
.sidebar-scrim {
  position: fixed;
  inset: var(--header-height) 0 0 0;
  background: rgba(0, 0, 0, 0.5);
  border: 0;
  z-index: 75;
  cursor: pointer;
}

/* =========================================================
   Main
   ========================================================= */
.admin-main {
  margin-left: 240px;
  padding: 32px 40px 64px;
  min-height: calc(100vh - var(--header-height));
}

/* ---- Page head ---- */
.admin-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.admin-eyebrow {
  display: inline-block;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--purple-300);
}

.admin-page-title {
  margin-top: 10px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #FFFFFF;
}

.admin-page-sub {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
}

.admin-page-actions {
  display: inline-flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ---- Admin-scoped button variants (smaller, dark-friendly) ---- */
.btn-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 200ms ease, background 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
  white-space: nowrap;
}

.btn-admin-primary {
  background: var(--gradient-accent);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}
.btn-admin-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

.btn-admin-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn-admin-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--purple-500);
  color: #FFFFFF;
}

/* =========================================================
   KPI cards
   ========================================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.kpi-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  transition: border-color 200ms ease, transform 200ms ease;
}

.kpi-card:hover {
  border-color: var(--purple-500);
  transform: translateY(-2px);
}

.kpi-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.kpi-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

.kpi-value {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.kpi-trend {
  font-size: 12px;
  font-weight: 500;
}

.kpi-trend-up      { color: #4ADE80; }
.kpi-trend-down    { color: #F87171; }
.kpi-trend-neutral { color: var(--text-tertiary); }

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(124, 58, 237, 0.18);
  color: var(--purple-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* =========================================================
   Filter bar
   ========================================================= */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.filter-chip:hover {
  border-color: var(--purple-500);
  color: #FFFFFF;
}

.filter-chip.is-active {
  background: var(--purple-600);
  border-color: var(--purple-600);
  color: #FFFFFF;
}

.filter-count {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.filter-chip:not(.is-active) .filter-count {
  color: var(--text-tertiary);
}

/* ---- Tools (search + sort) ---- */
.filter-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.filter-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 240px;
  height: 40px;
  padding: 0 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  transition: border-color 180ms ease;
}

.filter-search:focus-within {
  border-color: var(--purple-500);
  color: var(--text-secondary);
}

.filter-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
}

.filter-search input::placeholder { color: var(--text-tertiary); }

.filter-sort {
  position: relative;
}

.filter-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 180ms ease;
}

.filter-sort-btn:hover { border-color: var(--purple-500); }

.filter-sort-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.filter-sort-menu button {
  display: block;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background 160ms ease, color 160ms ease;
}

.filter-sort-menu button:hover { background: var(--bg-card); color: #FFFFFF; }
.filter-sort-menu button.is-active { color: var(--purple-300); }

/* =========================================================
   Report table
   ========================================================= */
.report-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.report-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.report-table thead th {
  position: sticky;
  top: 0;
  height: 52px;
  padding: 0 16px;
  background: var(--bg-elevated);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.report-table thead th.col-check    { width: 48px; padding-left: 24px; }
.report-table thead th.col-code     { width: 140px; }
.report-table thead th.col-title    { width: auto; }
.report-table thead th.col-type     { width: 110px; }
.report-table thead th.col-reporter { width: 130px; }
.report-table thead th.col-date     { width: 110px; }
.report-table thead th.col-status   { width: 110px; }
.report-table thead th.col-action   { width: 110px; padding-right: 24px; text-align: right; }

.report-table tbody tr {
  cursor: pointer;
  transition: background 180ms ease;
}

.report-table tbody tr:hover {
  background: var(--bg-elevated);
}

.report-table tbody tr.is-highlight {
  background: rgba(239, 68, 68, 0.06);
}

.report-table tbody td {
  height: 72px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  font-size: 14px;
  color: var(--text-primary);
}

.report-table tbody tr:last-child td { border-bottom: none; }

.report-table td.col-check { padding-left: 24px; }
.report-table td.col-code  {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.report-table td.col-title {
  font-weight: 500;
  padding-right: 16px;
}

/* Inner span lets the line-clamp ellipsis live on a block while the td
   itself stays vertically centred — `display: -webkit-box` on the td
   would override `vertical-align: middle` and push text to the top. */
.report-table td.col-title .cell-clip {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.report-table td.col-reporter {
  font-size: 13px;
  color: var(--text-secondary);
}

.report-table td.col-date {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

.report-table td.col-action {
  padding-right: 24px;
  text-align: right;
}

/* ---- Row checkbox (matches consent box style) ---- */
.row-check {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.row-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.row-check-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-default);
  background: var(--bg-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.row-check input:checked + .row-check-box {
  background: var(--purple-600);
  border-color: var(--purple-600);
  color: #FFFFFF;
}

/* ---- Status & type chips ---- */
.status-chip,
.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.status-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}

.status-chip[data-status="received"] { background: rgba(126, 126, 146, 0.20); color: var(--text-secondary); }
.status-chip[data-status="review"]   { background: rgba(124, 58, 237, 0.20); color: var(--purple-300); }
.status-chip[data-status="done"]     { background: rgba(34, 197, 94, 0.18);  color: #4ADE80; }
.status-chip[data-status="reject"]   { background: rgba(239, 68, 68, 0.18);  color: #F87171; }
.status-chip[data-status="private"]  { background: rgba(168, 85, 247, 0.18); color: #C084FC; }

.type-chip[data-type="가짜뉴스"] { background: rgba(168, 85, 247, 0.18); color: #D8B4FE; }
.type-chip[data-type="허위사실"] { background: rgba(59, 130, 246, 0.18); color: #93C5FD; }
.type-chip[data-type="명예훼손"] { background: rgba(245, 158, 11, 0.18); color: #FCD34D; }
.type-chip[data-type="기타"]     { background: rgba(126, 126, 146, 0.20); color: var(--text-secondary); }

/* ---- Action button on each row ---- */
.row-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-300);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: color 180ms ease, background 180ms ease;
}

.row-action:hover {
  color: var(--purple-500);
  background: rgba(124, 58, 237, 0.10);
}

/* =========================================================
   Pagination
   ========================================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-tertiary);
}

.pagination-info strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.pagination-list {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pagination-list li { display: inline-flex; }

.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.pagination-btn:hover:not(:disabled):not(.is-active) {
  background: var(--bg-card);
  color: #FFFFFF;
}

.pagination-btn.is-active {
  background: var(--purple-600);
  color: #FFFFFF;
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination-arrow { color: var(--text-tertiary); }

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* =========================================================
   Slide panel — report detail
   ========================================================= */
.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
}

.panel-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.report-panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  height: calc(100vh - var(--header-height));
  width: 400px;
  max-width: 100vw;
  background: var(--bg-soft);
  border-left: 1px solid var(--border-light);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.4);
  z-index: 120;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 400ms cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}

.report-panel.is-open {
  transform: translateX(0);
}

.panel-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-light);
  z-index: 1;
}

.panel-code {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.panel-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 180ms ease, color 180ms ease;
}

.panel-close:hover {
  background: var(--bg-card);
  color: #FFFFFF;
}

.panel-body {
  padding: 0 24px 32px;
  overflow-y: auto;
  flex: 1;
}

.panel-title {
  margin-top: 16px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.panel-meta {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-meta-date {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

/* ---- Panel cards (reporter, content, urls, thumbs) ---- */
.panel-card {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.panel-card-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.panel-card-content {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.panel-card-sub {
  margin-top: 4px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.panel-card-text {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
}

.panel-url-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel-url {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 12.5px;
  color: var(--text-secondary);
  transition: color 180ms ease, background 180ms ease;
  word-break: break-all;
}

.panel-url:hover {
  background: var(--bg-card);
  color: var(--purple-300);
}

.panel-url svg { flex-shrink: 0; color: var(--text-tertiary); }
.panel-url:hover svg { color: var(--purple-300); }

.panel-thumb-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.panel-thumb {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}

/* placeholder gradients so thumbs read as distinct images, not real photos */
.panel-thumb-1 { background: linear-gradient(135deg, #3A2470 0%, #1F1240 100%); }
.panel-thumb-2 { background: linear-gradient(135deg, #1E2342 0%, #0F1226 100%); }
.panel-thumb-3 { background: linear-gradient(135deg, #2A2A33 0%, #45455A 100%); }
.panel-thumb-4 { background: linear-gradient(135deg, #3D2475 0%, #6B4EFF 100%); }

/* ---- Panel form fields ---- */
.panel-field { margin-top: 20px; }

.panel-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.panel-select-wrap {
  position: relative;
}

.panel-select {
  width: 100%;
  height: 44px;
  padding: 0 36px 0 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 180ms ease;
}

.panel-select:hover { border-color: var(--purple-500); }
.panel-select:focus { outline: none; border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18); }

.panel-select-caret {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.panel-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.panel-textarea::placeholder { color: var(--text-tertiary); }
.panel-textarea:focus {
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

/* ---- Checkboxes inside panel ---- */
.panel-check {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13.5px;
  color: var(--text-primary);
}

.panel-check-inline {
  margin-top: 0;
  margin-right: 16px;
}

.panel-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.panel-check-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-default);
  background: var(--bg-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
  flex-shrink: 0;
}

.panel-check input:checked + .panel-check-box {
  background: var(--purple-600);
  border-color: var(--purple-600);
  color: #FFFFFF;
}

.panel-notify {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 0;
}

.panel-actions {
  margin-top: 28px;
  display: flex;
  gap: 8px;
}

.panel-actions .btn-admin { flex: 1; }
.panel-submit { height: 48px; font-size: 15px; }

/* =========================================================
   Demo modal — shown when a [data-demo] sidebar item is clicked
   ========================================================= */
.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: demo-modal-fade 200ms ease;
}

@keyframes demo-modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.demo-modal-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 36px 32px 28px;
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  overflow: hidden;
  animation: demo-modal-rise 240ms cubic-bezier(.2,.8,.2,1);
}

@keyframes demo-modal-rise {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.demo-modal-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gradient-accent);
}

.demo-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.demo-modal-desc {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.demo-modal-close {
  margin-top: 24px;
  width: 100%;
}

/* =========================================================
   Page-load fade-in
   ========================================================= */
.admin-main,
.admin-sidebar {
  opacity: 0;
  animation: admin-fade-in 240ms ease 80ms forwards;
}

@keyframes admin-fade-in {
  to { opacity: 1; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1280px) {
  .filter-search { width: 200px; }
  .kpi-value { font-size: 28px; }
}

@media (max-width: 1024px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 280ms cubic-bezier(.2,.8,.2,1);
  }
  .admin-sidebar.is-open { transform: translateX(0); }

  .admin-main {
    margin-left: 0;
    padding: 24px 20px 48px;
  }

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

  .admin-page-actions {
    width: 100%;
    justify-content: stretch;
  }
  .admin-page-actions .btn-admin { flex: 1; }

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

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .filter-tools {
    width: 100%;
    justify-content: space-between;
  }
  .filter-search { width: auto; flex: 1; }

  /* Table → card layout for compact widths */
  .report-table thead { display: none; }
  .report-table,
  .report-table tbody,
  .report-table tr,
  .report-table td {
    display: block;
    width: 100%;
  }
  .report-table tbody tr {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    height: auto;
  }
  .report-table tbody td {
    height: auto;
    padding: 4px 0;
    border-bottom: none;
  }
  .report-table tbody td.col-check    { display: none; }
  .report-table tbody td.col-code     {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 11.5px;
    letter-spacing: 0.04em;
  }
  .report-table tbody td.col-title    { font-size: 15px; font-weight: 600; padding: 6px 0; }
  .report-table tbody td.col-type,
  .report-table tbody td.col-reporter,
  .report-table tbody td.col-date,
  .report-table tbody td.col-status {
    display: inline-block;
    margin-right: 12px;
    padding: 2px 0;
  }
  .report-table tbody td.col-action {
    text-align: left;
    padding: 8px 0 0;
  }

  .report-panel { width: 360px; }

  .admin-profile-btn .admin-name { display: none; }
  .admin-profile-btn { padding: 4px; }
}

@media (max-width: 768px) {
  .nav-primary { display: none; }
  .nav-toggle  { display: inline-flex; }

  .admin-page-title { font-size: 26px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi-card { padding: 18px; }
  .kpi-icon { width: 32px; height: 32px; }

  .report-panel { width: 100%; }
  .pagination { justify-content: center; }
  .pagination-info { width: 100%; text-align: center; }
}
