/*
 * FortiumClaw Approval Dashboard — custom styles
 * Brand: Fortium deep navy (#0d1b2a) + gold accent (#c9a84c)
 *
 * Deploy notes:
 *   nginx: proxy_pass http://localhost:8000 behind SSL termination
 *   certbot: certbot --nginx -d claw.fortiumpartners.com --non-interactive --agree-tos -m burke@fortiumpartners.com
 */

:root {
  --fortium-navy: #0d1b2a;
  --fortium-navy-light: #162436;
  --fortium-gold: #c9a84c;
  --fortium-gold-hover: #b8973d;
  --expiry-urgent: #3d1a1a;   /* < 2 hours — dark red tint */
  --expiry-warn: #3d3110;     /* < 6 hours — dark amber tint */
  --expiry-urgent-border: #dc3545;
  --expiry-warn-border: #ffc107;
}

body {
  background-color: var(--fortium-navy);
  color: #e8eaf0;
  font-family: "Inter", system-ui, sans-serif;
  min-height: 100vh;
}

/* --- Navbar --- */
.navbar-brand .brand-claw {
  color: var(--fortium-gold);
  font-weight: 700;
}

.navbar {
  background-color: var(--fortium-navy-light) !important;
  border-bottom: 2px solid var(--fortium-gold);
}

/* --- Tabs --- */
.nav-tabs {
  border-bottom: 2px solid #2a3a4a;
}

.nav-tabs .nav-link {
  color: #9aaabb;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.nav-tabs .nav-link:hover {
  color: #e8eaf0;
  border-bottom-color: #4a6a8a;
}

.nav-tabs .nav-link.active {
  background: transparent;
  color: var(--fortium-gold);
  border-bottom: 2px solid var(--fortium-gold);
}

/* --- Tables --- */
.table {
  --bs-table-bg: transparent;
  --bs-table-border-color: #2a3a4a;
  color: #e8eaf0;
  font-size: 0.875rem;
}

.table thead th {
  background-color: #162436;
  color: #9aaabb;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #2a3a4a;
}

.table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s;
}

.table tbody tr:hover {
  background-color: rgba(201, 168, 76, 0.08);
}

/* Expiry highlighting */
.row-expiry-urgent {
  background-color: var(--expiry-urgent) !important;
  border-left: 3px solid var(--expiry-urgent-border);
}

.row-expiry-warn {
  background-color: var(--expiry-warn) !important;
  border-left: 3px solid var(--expiry-warn-border);
}

/* Detail expansion row */
.detail-row td {
  background-color: #0a1520 !important;
  padding: 0 !important;
  cursor: default;
}

.detail-panel {
  padding: 1rem 1.25rem;
  border-top: 1px solid #2a3a4a;
}

.detail-panel pre {
  background-color: #050d14;
  border: 1px solid #2a3a4a;
  border-radius: 4px;
  padding: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.8rem;
  color: #a8d8a8;
  margin-bottom: 0;
}

/* --- Cards & panels --- */
.card {
  background-color: var(--fortium-navy-light);
  border: 1px solid #2a3a4a;
  border-radius: 6px;
}

.card-header {
  background-color: #1a2d40;
  border-bottom: 1px solid #2a3a4a;
  font-weight: 600;
  color: var(--fortium-gold);
}

/* --- Buttons --- */
.btn-gold {
  background-color: var(--fortium-gold);
  border-color: var(--fortium-gold);
  color: #0d1b2a;
  font-weight: 600;
}

.btn-gold:hover {
  background-color: var(--fortium-gold-hover);
  border-color: var(--fortium-gold-hover);
  color: #0d1b2a;
}

.btn-approve {
  background-color: #1a5c2e;
  border-color: #28a745;
  color: #a8e6bf;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
}

.btn-approve:hover {
  background-color: #28a745;
  color: #fff;
}

.btn-deny {
  background-color: #5c1a1a;
  border-color: #dc3545;
  color: #f5a0a8;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
}

.btn-deny:hover {
  background-color: #dc3545;
  color: #fff;
}

/* --- Badge --- */
.pending-badge {
  background-color: var(--fortium-gold);
  color: #0d1b2a;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.1rem 0.55rem;
  font-size: 0.75rem;
  vertical-align: middle;
}

/* --- Filter bar --- */
.filter-bar {
  background-color: #162436;
  border: 1px solid #2a3a4a;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.filter-bar .form-select,
.filter-bar .form-control {
  background-color: #0d1b2a;
  border-color: #2a3a4a;
  color: #e8eaf0;
  font-size: 0.875rem;
}

.filter-bar .form-select:focus,
.filter-bar .form-control:focus {
  background-color: #0d1b2a;
  border-color: var(--fortium-gold);
  color: #e8eaf0;
  box-shadow: 0 0 0 0.15rem rgba(201, 168, 76, 0.25);
}

/* --- Modal --- */
.modal-content {
  background-color: var(--fortium-navy-light);
  border: 1px solid #2a3a4a;
  color: #e8eaf0;
}

.modal-header {
  border-bottom: 1px solid #2a3a4a;
}

.modal-footer {
  border-top: 1px solid #2a3a4a;
}

.modal-content .form-control,
.modal-content .form-select {
  background-color: #0d1b2a;
  border-color: #2a3a4a;
  color: #e8eaf0;
}

.modal-content .form-control:focus {
  background-color: #0d1b2a;
  border-color: var(--fortium-gold);
  box-shadow: 0 0 0 0.15rem rgba(201, 168, 76, 0.25);
  color: #e8eaf0;
}

/* --- Toast container --- */
.toast-container {
  z-index: 9999;
}

.toast {
  background-color: #162436;
  border: 1px solid #2a3a4a;
  color: #e8eaf0;
  min-width: 280px;
}

.toast.toast-success {
  border-left: 4px solid #28a745;
}

.toast.toast-error {
  border-left: 4px solid #dc3545;
}

.toast-header {
  background-color: #1a2d40;
  color: #e8eaf0;
  border-bottom: 1px solid #2a3a4a;
}

/* --- Auth modal overlay --- */
#authModal .modal-dialog {
  max-width: 420px;
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #4a6a8a;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

/* --- Pagination --- */
.pagination .page-link {
  background-color: #162436;
  border-color: #2a3a4a;
  color: #9aaabb;
}

.pagination .page-link:hover {
  background-color: #1a2d40;
  color: var(--fortium-gold);
  border-color: #2a3a4a;
}

.pagination .page-item.active .page-link {
  background-color: var(--fortium-gold);
  border-color: var(--fortium-gold);
  color: #0d1b2a;
}

.pagination .page-item.disabled .page-link {
  background-color: #0d1b2a;
  color: #3a5a7a;
}

/* --- Bulk action bar --- */
.bulk-bar {
  display: none;
  background-color: #1a2d40;
  border: 1px solid var(--fortium-gold);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  align-items: center;
  gap: 0.75rem;
}

.bulk-bar.visible {
  display: flex;
}

/* --- Scrollbar styling (webkit) --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #0d1b2a;
}

::-webkit-scrollbar-thumb {
  background: #2a3a4a;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a5a7a;
}

/* --- Responsive tweaks --- */
@media (max-width: 768px) {
  .filter-bar .row > div {
    margin-bottom: 0.5rem;
  }

  .table-responsive {
    font-size: 0.8rem;
  }
}
