/* Wardogs2 — Oil Deals Tracker */
:root {
  --bg-dark: #0a0e17;
  --bg-card: #111827;
  --bg-sidebar: #0d1221;
  --accent: #f97316;
  --accent-dim: #c2410c;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --border: #1e293b;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --info: #3b82f6;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.logo {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.logo-image {
  max-width: 200px;
  max-height: 90px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.nav-links {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}

.nav-links li a {
  display: block;
  padding: 10px 20px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}

.nav-links li a:hover,
.nav-links li.active a {
  color: var(--accent);
  background: rgba(249,115,22,0.08);
  border-left: 3px solid var(--accent);
}

.nav-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
}

/* Main content */
.content {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.topbar h1 { font-size: 22px; font-weight: 700; }

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

.search-box input {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 13px;
  width: 240px;
  outline: none;
}

.search-box input:focus { border-color: var(--accent); }

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-dim); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  margin-bottom: 8px;
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.stat-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-size: 28px; font-weight: 700; margin: 4px 0; }
.stat-change { font-size: 12px; }
.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

/* Dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  padding: 0 28px 28px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.card.wide { grid-column: 1 / -1; }

.card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Table */
.table-container { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(30,41,59,0.5);
}

tr:hover td { background: rgba(249,115,22,0.04); }

.empty-state {
  text-align: center;
  padding: 40px 20px !important;
  color: var(--text-dim);
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-seized, .badge-stuck, .badge-unable-to-discharge { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-shadow-fleet, .badge-sanctioned { background: rgba(234,179,8,0.15); color: var(--warning); }
.badge-ais-anomalies, .badge-waiting, .badge-no-buyer, .badge-sanction-backlog { background: rgba(59,130,246,0.15); color: var(--info); }
.badge-resolved { background: rgba(34,197,94,0.15); color: var(--success); }

/* Pipeline mini */
.pipeline-mini { display: flex; gap: 8px; }

.pipeline-stage {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  background: var(--bg-dark);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.stage-label { display: block; font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.stage-count { display: block; font-size: 20px; font-weight: 700; color: var(--accent); }

/* Quick actions */
.quick-actions { display: flex; flex-direction: column; }

/* Deals page */
.deals-filters {
  display: flex;
  gap: 10px;
  padding: 16px 28px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(249,115,22,0.08);
}

/* Detail modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px;
}

.modal h2 { margin-bottom: 16px; }

.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.detail-item label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.detail-item span { font-size: 14px; font-weight: 500; }

/* Responsive */
/* Enhanced vessel modal styling */
.vessel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.vessel-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--accent);
}

.vessel-details-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-section {
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 20px;
  border-left: 4px solid var(--accent);
}

.detail-section h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.notes-content {
  background: rgba(249,115,22,0.05);
  padding: 16px;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

.notes-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Sort indicators */
th[data-sort]:hover {
  background: rgba(249,115,22,0.1);
}

th.sort-asc::after {
  content: ' ↑';
  color: var(--accent);
}

th.sort-desc::after {
  content: ' ↓';
  color: var(--accent);
}

/* Flag badges */
.flag-badge {
  background: var(--bg-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
}

/* Enhanced table styling */
.table-container {
  max-height: 600px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.deals-table {
  position: relative;
}

.deals-table thead {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 10;
}

.deals-table tbody tr:hover {
  background: rgba(249,115,22,0.05);
  cursor: pointer;
}

/* Enhanced badges */
.badge {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Success notification */
.success-msg {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Enhanced responsive design */
@media (max-width: 1600px) {
  .logo-image {
    max-width: 180px;
    max-height: 80px;
  }
}

@media (max-width: 1200px) {
  .logo-image {
    max-width: 160px;
    max-height: 70px;
  }
  
  .vessel-details-grid {
    gap: 16px;
  }
  
  .detail-section {
    padding: 16px;
  }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  
  .logo-image {
    max-width: 140px;
    max-height: 60px;
  }
  
  .vessel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
  }
  
  .topbar {
    flex-direction: column;
    gap: 12px;
  }
  
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .search-box input {
    width: 200px;
  }
}