/* ═══════════════════════════════════════
   SECTION CARD
═══════════════════════════════════════ */
.card {
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--radius2); overflow: hidden;
}
.card-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.card-title { font-size: 14px; font-weight: 600; letter-spacing: -0.02em; flex: 1; }
.card-sub { font-size: 12px; color: var(--txt3); font-family: var(--mono); }
.card-body { padding: 20px; }
.card-actions { display: flex; gap: 6px; margin-left: auto; }

/* ═══════════════════════════════════════
   REVIEW TABLE
═══════════════════════════════════════ */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-family: var(--mono); color: var(--txt3);
  letter-spacing: 0.06em; border-bottom: 1px solid var(--line);
  white-space: nowrap; font-weight: 400;
}
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(255,255,255,0.02); }
.tbl-text { font-size: 13px; color: var(--txt); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.tbl-text:hover { color: var(--acc2); }
.tbl-meta { font-size: 11px; color: var(--txt3); }
.tbl-platform { display: flex; align-items: center; gap: 6px; }

/* Score pill */
.score-pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
  font-family: var(--mono);
}

/* Tag */
.tag {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 500; margin: 1px;
}

/* Status badge */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 6px; font-size: 11px;
}
.status-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }

/* ═══════════════════════════════════════
   MODALS
═══════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 16px; width: 480px; max-width: 95vw;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-title { font-size: 16px; font-weight: 700; flex: 1; }
.modal-close { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--txt2); display: flex; align-items: center; justify-content: center; }
.modal-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.modal-body { padding: 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

/* ═══════════════════════════════════════
   DETAIL PANEL BUTTONS
═══════════════════════════════════════ */
.dp-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.dp-btn {
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; cursor: pointer; font-family: var(--sans);
  transition: all 0.15s; border: 1px solid var(--line);
  background: transparent; color: var(--txt2);
}
.dp-btn:hover { background: var(--bg3); color: var(--txt); }
.dp-btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.dp-btn.primary:hover { background: #2d5ce0; }
.dp-btn.danger { border-color: rgba(255,64,64,0.3); color: var(--red); }
.dp-btn.danger:hover { background: rgba(255,64,64,0.1); }

/* ═══════════════════════════════════════
   TOGGLE SWITCH
═══════════════════════════════════════ */
.toggle { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--bg4); border-radius: 11px;
  transition: background 0.2s; cursor: pointer;
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle-thumb {
  position: absolute; width: 16px; height: 16px;
  background: white; border-radius: 50%; top: 3px; left: 3px;
  transition: transform 0.2s; pointer-events: none;
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(16px); }

/* ═══════════════════════════════════════
   LOADING / SKELETON
═══════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ═══════════════════════════════════════
   PROGRESS
═══════════════════════════════════════ */
.progress-bar { height: 4px; background: var(--bg4); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }

/* ═══════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════ */
.empty-state { padding: 48px 24px; text-align: center; }
.empty-icon { font-size: 36px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-desc { font-size: 13px; color: var(--txt3); max-width: 280px; margin: 0 auto 20px; }

/* ═══════════════════════════════════════
   TOOLTIP
═══════════════════════════════════════ */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--bg4); color: var(--txt); font-size: 11px;
  padding: 4px 8px; border-radius: 5px; white-space: nowrap;
  pointer-events: none; border: 1px solid var(--line2); z-index: 100;
}

/* Mobile card lists */
.mobile-only { display: none; }
.mobile-cards-wrap { display: none; }
.m-card-list { display: flex; flex-direction: column; gap: 12px; }
.m-card {
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px;
}
.m-card-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.m-card-meta { font-size: 12px; color: var(--txt3); display: flex; gap: 8px; flex-wrap: wrap; }
.m-card-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.m-card-actions { display:flex; gap:6px; margin-top:10px; flex-wrap:wrap; }
.m-pill {
  padding: 3px 8px; border-radius: 999px; font-size: 11px; font-family: var(--mono);
  border: 1px solid var(--line2); color: var(--txt2);
}
.reason-badge {
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 6px; border-radius:6px; font-size:10px;
  background:var(--bg4); border:1px solid var(--line2); color:var(--txt2);
}
.review-reasons { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:6px; }
.review-priority-high { box-shadow: inset 4px 0 0 var(--red); }
.review-priority-med { box-shadow: inset 4px 0 0 var(--amber); }
.review-priority-low { box-shadow: inset 4px 0 0 var(--green); }

@media (max-width: 640px) {
  .card-head { padding: 14px 16px; flex-wrap: wrap; }
  .card-body { padding: 16px; }
  .tbl th, .tbl td { padding: 10px 10px; }
  .tbl-text { max-width: 140px; font-size: 12px; }
  .score-pill { font-size: 11px; }
  .modal { width: 100%; max-width: 92vw; }
  .modal-head { padding: 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px; flex-wrap: wrap; }
  .tbl { min-width: 620px; }
  .mobile-only { display: block; }
  .mobile-hide { display: none; }
}

.tbl-compact th, .tbl-compact td { padding: 10px 8px; }
.tbl-compact .tbl-text { max-width: 520px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.tbl { width: 100%; table-layout: fixed; }
.tbl-compact th:nth-child(1), .tbl-compact td:nth-child(1) { width: 40px; }
.tbl-compact th:nth-child(2), .tbl-compact td:nth-child(2) { width: 52%; }
.tbl-compact th:nth-child(3), .tbl-compact td:nth-child(3) { width: 18%; }
.tbl-compact th:nth-child(4), .tbl-compact td:nth-child(4) { width: 12%; }
.tbl-compact th:nth-child(5), .tbl-compact td:nth-child(5) { width: 10%; }
.tbl-compact th:nth-child(6), .tbl-compact td:nth-child(6) { width: 8%; }

.tbl-wrap { max-width: 1200px; margin: 0 auto; }

/* ═══════════════════════════════════════
   PREMIUM CUSTOM SLIDER
═══════════════════════════════════════ */
.range-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
  margin: 16px 0;
}
.range-slider:focus { outline: none; }
.range-slider::-webkit-slider-runnable-track {
  width: 100%; height: 6px; cursor: pointer;
  background: var(--line2); border-radius: 4px;
  transition: all 0.2s;
}
.range-slider::-webkit-slider-thumb {
  height: 20px; width: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, white, #f2f2f7);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3), inset 0 1px 1px rgba(255,255,255,0.8);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  margin-top: -7px;
  border: 1px solid var(--line2);
  transition: transform 0.15s ease-out;
}
.range-slider::-webkit-slider-thumb:hover { transform: scale(1.1); box-shadow: 0 4px 12px rgba(61,108,255,0.4); border-color: var(--accent); }
.range-slider:focus::-webkit-slider-runnable-track { background: var(--bg4); }

/* ═══════════════════════════════════════
   PREMIUM INBOX TABS
═══════════════════════════════════════ */
.inbox-tabs {
  display: flex; gap: 8px;
  background: transparent;
  padding: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.inbox-tab {
  flex: 1; padding: 8px 12px;
  font-size: 13px; font-weight: 500;
  background: var(--bg3); border: 1px solid var(--line);
  color: var(--txt3); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; transition: all 0.2s ease;
  height: 38px;
}
.inbox-tab:hover { border-color: var(--line2); color: var(--txt); }
.inbox-tab.active {
  background: var(--bg4); color: var(--txt);
  border-color: var(--acc2);
  box-shadow: none;
  font-weight: 600;
}
.inbox-tab .nav-badge {
  padding: 2px 6px; border-radius: 12px; font-size: 11px; font-family: var(--mono);
}
.inbox-tab[data-tab="urgent"].active { border-color: var(--red); color: #ff8a8a; }
.inbox-tab[data-tab="pending"].active { border-color: var(--amber); color: #ffca58; }
.inbox-tab[data-tab="resolved"].active { border-color: var(--green); color: #5ceb96; }

/* Push Notification Simulation */
.push-toast {
  position: fixed; top: 24px; right: 24px; width: 320px;
  background: var(--bg4); border-left: 4px solid var(--red);
  border-radius: 12px; padding: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  display: flex; gap: 12px; 
  transform: translateX(120%); transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  z-index: 10001; border-top: 1px solid var(--line2); border-right: 1px solid var(--line2);
}
.push-toast.active { transform: translateX(0); }
.push-icon { width:40px; height:40px; border-radius:10px; background:rgba(255,64,64,0.1); display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:20px; }
.push-body { flex:1; }
.push-title { font-size:13px; font-weight:700; color:var(--txt); margin-bottom:4px; }
.push-text { font-size:12px; color:var(--txt2); line-height:1.4; }

.hint-note {
  font-size:11px; color:var(--txt3);
  background: var(--bg3);
  border: 1px dashed var(--line2);
  padding: 8px 10px; border-radius: 8px;
}

/* Global Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 10, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.loading-card {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 14px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.loading-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
}
.loading-sub {
  font-size: 11px;
  color: var(--txt3);
}
.loading-spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--bg4);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

/* Mobile Card Layout Toggle */
.mobile-cards-wrap { display: none; margin-top: 12px; }

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .tbl-wrap { display: none; }
  .mobile-cards-wrap { display: block; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
