/* ==========================================================================
   ProfitTracker Pro - Dispute Defense Admin Panel Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&family=Outfit:wght@600;700;800&display=swap');

:root {
  --admin-bg: #030d0a;
  --admin-sidebar: #061914;
  --admin-card: rgba(8, 28, 22, 0.85);
  --admin-card-header: rgba(14, 43, 35, 0.7);
  --border-color: rgba(52, 211, 153, 0.18);
  --border-active: #10b981;

  --emerald: #10b981;
  --emerald-light: #34d399;
  --emerald-dark: #04291f;

  --text-main: #f1f5f9;
  --text-sub: #94a3b8;
  --text-muted: #64748b;

  --status-paid: #10b981;
  --status-open: #f59e0b;
  --status-delivered: #38bdf8;
  --status-disputed: #ef4444;

  --font-sans: 'Plus Jakarta Sans', sans-serif;
  --font-head: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--admin-bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 270px;
  background: var(--admin-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #10b981, #064e3b);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.sidebar-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.sidebar-title span {
  color: var(--emerald-light);
}

.defense-badge {
  display: inline-block;
  font-size: 0.65rem;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.sidebar-menu {
  list-style: none;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  overflow-y: auto;
}

.menu-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding: 12px 12px 6px;
  font-weight: 700;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-sub);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-item:hover {
  background: rgba(16, 185, 129, 0.1);
  color: #fff;
}

.sidebar-item.active {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.05) 100%);
  color: var(--emerald-light);
  border-left: 3px solid var(--emerald);
}

.sidebar-item .item-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Main Area */
.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(circle at 80% 10%, rgba(16, 185, 129, 0.06) 0%, transparent 40%);
}

.topbar {
  height: 68px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(6, 25, 20, 0.7);
  backdrop-filter: blur(12px);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-admin-primary {
  background: var(--emerald);
  color: #03120d;
}

.btn-admin-primary:hover {
  background: var(--emerald-light);
}

.btn-admin-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-admin-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--emerald-light);
}

.btn-admin-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-admin-danger:hover {
  background: rgba(239, 68, 68, 0.4);
}

/* Content Area */
.content-body {
  flex-grow: 1;
  padding: 28px;
  overflow-y: auto;
}

/* Stats Metric Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--admin-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--emerald), transparent);
}

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.stat-value {
  font-family: var(--font-head);
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  margin-top: 6px;
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--emerald-light);
  margin-top: 4px;
}

/* Panels & Tables */
.panel {
  background: var(--admin-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 28px;
}

.panel-header {
  padding: 18px 24px;
  background: var(--admin-card-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-desc {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-top: 2px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.admin-table th {
  background: rgba(4, 15, 12, 0.6);
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
}

.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(16, 185, 129, 0.04);
}

/* Badges and Tags */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-completed, .status-active, .status-paid, .status-delivered {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-open, .status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.code-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: #6ee7b7;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
}

.copy-btn:hover {
  color: #fff;
}

/* Tab View System */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Dispute Pack Dossier Box */
.dispute-box {
  background: #051410;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #cbd5e1;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.sidebar-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid var(--border-color);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

.defense-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.admin-mobile-toggle {
  display: none;
}

/* Responsive Tablet & Mobile for Admin Panel */
@media (max-width: 992px) {
  .admin-mobile-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 30px rgba(0,0,0,0.85);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .defense-feature-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .content-body {
    padding: 18px 14px;
  }

  .topbar {
    padding: 12px 18px;
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .topbar-actions {
    flex-wrap: wrap;
    gap: 10px;
  }
}

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

  .topbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .topbar-title {
    font-size: 1rem;
    line-height: 1.25;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    font-size: 0.72rem;
  }

  .admin-table {
    min-width: 620px;
  }

  .admin-table th, .admin-table td {
    padding: 10px 10px;
    font-size: 0.78rem;
  }

  .content-body {
    padding: 14px 10px;
  }

  .panel {
    border-radius: 10px;
  }

  .panel-header {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .panel-header .btn-admin {
    width: 100%;
    justify-content: center;
  }
}


