/* ═══════════════════════════════════════════════════════════════
   JoyNet Panel — Custom Styles
   Stack: Bootstrap 5 dark theme + these overrides
═══════════════════════════════════════════════════════════════ */

/* ─── Base ──────────────────────────────────────────────────── */
:root {
  --jn-primary:   #0d6efd;
  --jn-success:   #198754;
  --jn-danger:    #dc3545;
  --jn-warning:   #ffc107;
  --jn-card-bg:   #161b22;
  --jn-border:    rgba(255, 255, 255, 0.08);
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  background-color: #0d1117;
  color: #e6edf3;
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #161b22; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* ─── Navbar ────────────────────────────────────────────────── */
.navbar {
  background-color: #161b22 !important;
  border-bottom-color: #30363d !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

/* ─── Stat cards ────────────────────────────────────────────── */
.stat-card {
  border-radius: 12px;
  transition: transform 0.15s, box-shadow 0.15s;
  background-color: var(--jn-card-bg) !important;
  border-color: #30363d !important;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  border-radius: 12px !important;
  border-color: #30363d !important;
  background-color: var(--jn-card-bg) !important;
}

.card-header {
  background-color: rgba(255,255,255,0.02) !important;
  border-bottom-color: #30363d !important;
  padding: 1rem 1.25rem;
}

.card-footer {
  background-color: rgba(255,255,255,0.02) !important;
  border-top-color: #30363d !important;
  padding: 0.5rem 1.25rem;
}

/* ─── Tables ────────────────────────────────────────────────── */
.table {
  --bs-table-bg: transparent;
  --bs-table-border-color: #21262d;
  margin-bottom: 0;
}

.table-dark {
  --bs-table-bg: transparent;
}

.table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #8b949e;
  border-bottom: 2px solid #21262d !important;
  padding: 0.75rem 0.75rem;
  white-space: nowrap;
  background-color: rgba(255,255,255,0.03) !important;
  color: #8b949e !important;
}

.table tbody tr {
  border-bottom: 1px solid #21262d;
  transition: background-color 0.1s;
}

.table-hover tbody tr:hover {
  background-color: rgba(255,255,255,0.04) !important;
  cursor: pointer;
}

.table td {
  padding: 0.75rem;
  vertical-align: middle;
}

/* ─── Modals ────────────────────────────────────────────────── */
.modal-content {
  border-radius: 12px !important;
  border-color: #30363d !important;
  background-color: #161b22 !important;
}

.modal-header {
  border-bottom-color: #30363d !important;
}

.modal-footer {
  border-top-color: #30363d !important;
}

/* ─── Forms ─────────────────────────────────────────────────── */
.form-control,
.form-select,
.input-group-text {
  background-color: #0d1117 !important;
  border-color: #30363d !important;
  color: #e6edf3 !important;
  border-radius: 8px !important;
}

.form-control:focus,
.form-select:focus {
  background-color: #0d1117 !important;
  border-color: #388bfd !important;
  color: #e6edf3 !important;
  box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.15) !important;
}

.form-control::placeholder { color: #484f58; }

.form-control[readonly] {
  opacity: 0.7;
}

.input-group > .form-control {
  border-radius: 0 !important;
}

.input-group > .form-control:last-child {
  border-radius: 0 8px 8px 0 !important;
}

.input-group > .input-group-text:first-child {
  border-radius: 8px 0 0 8px !important;
}

.input-group > .btn:last-child {
  border-radius: 0 8px 8px 0 !important;
}

/* ─── Tabs ──────────────────────────────────────────────────── */
.nav-tabs {
  border-bottom-color: #30363d !important;
}

.nav-tabs .nav-link {
  color: #8b949e;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 1.25rem;
  border-radius: 0 !important;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s;
}

.nav-tabs .nav-link:hover {
  color: #e6edf3;
  border-color: transparent;
  background-color: rgba(255,255,255,0.05);
}

.nav-tabs .nav-link.active {
  background-color: transparent !important;
  color: var(--jn-primary) !important;
  border-bottom: 2px solid var(--jn-primary) !important;
  border-color: transparent transparent var(--jn-primary) !important;
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  border-radius: 8px !important;
  font-weight: 500;
  transition: all 0.15s;
}

.btn-sm { padding: 0.3rem 0.75rem !important; }

.btn-outline-primary { border-color: #388bfd !important; color: #388bfd !important; }
.btn-outline-primary:hover { background-color: rgba(56, 139, 253, 0.12) !important; }

.btn-outline-secondary { border-color: #484f58 !important; color: #8b949e !important; }
.btn-outline-secondary:hover { background-color: rgba(255,255,255,0.05) !important; color: #e6edf3 !important; }

.btn-outline-danger { border-color: #f85149 !important; color: #f85149 !important; }
.btn-outline-danger:hover { background-color: rgba(248, 81, 73, 0.12) !important; }

/* ─── Badges ────────────────────────────────────────────────── */
.badge {
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 6px !important;
  padding: 0.3em 0.6em !important;
}

/* ─── Toast ─────────────────────────────────────────────────── */
.toast {
  border-radius: 10px !important;
  min-width: 280px;
}

/* ─── Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tab-pane.active { animation: fadeIn 0.2s ease; }

/* ─── Form label sizing ─────────────────────────────────────── */
.form-label-sm {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

/* ─── Opacity helper ────────────────────────────────────────── */
tr.opacity-50 td { opacity: 0.55; }

/* ─── Responsive tweaks ─────────────────────────────────────── */
@media (max-width: 768px) {
  .container-fluid { padding: 1rem; }
  .stat-value { font-size: 1.5rem; }
  .table { font-size: 0.85rem; }
}
