/* Yango x Mereq Dark Theme */
:root {
  --yango-orange: #FC3F1D;
  --yango-orange-hover: #e0361a;
  --bg-primary: #141414;
  --bg-card: #1f1f1f;
  --bg-secondary: #292929;
  --border-color: #2f2f2f;
  --text-primary: #ffffff;
  --text-muted: #8a8a8a;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container-fluid {
  flex: 1;
}

/* ── Navbar ── */
.yango-nav {
  background: var(--bg-primary) !important;
  border-bottom: 1px solid #262626;
  padding: 0.6rem 1rem;
}

.yango-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.yango-wordmark {
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: 22px;
  color: var(--yango-orange);
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: -1px;
}

.yango-separator {
  color: rgba(255,255,255,0.2);
  font-size: 18px;
}

.yango-partner {
  color: var(--text-primary);
  font-size: 14px;
  letter-spacing: -0.3px;
  line-height: 1;
}

/* ── Drivers toolbar ── */
.drivers-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-count {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 2px 10px;
  border-radius: 20px;
}

.toolbar-search {
  flex: 0 1 380px;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.search-input-wrap input {
  padding-left: 38px;
  padding-right: 36px;
  height: 40px;
  font-size: 14px;
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px;
  line-height: 1;
}

.search-clear:hover {
  color: var(--text-primary);
}

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  margin-bottom: 0;
}

.filter-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 4px 28px 4px 10px;
  font-size: 13px;
  height: 32px;
  cursor: pointer;
  appearance: auto;
}

.filter-select:focus {
  border-color: var(--yango-orange);
  outline: none;
  box-shadow: 0 0 0 2px rgba(252,63,29,0.2);
}

.filter-dates {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-date {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 13px;
  height: 32px;
  width: 140px;
}

.filter-date:focus {
  border-color: var(--yango-orange);
  outline: none;
  box-shadow: 0 0 0 2px rgba(252,63,29,0.2);
}

.filter-date-sep {
  color: var(--text-muted);
  font-size: 13px;
}

.filter-clear {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  margin-left: auto;
  white-space: nowrap;
}

.filter-clear:hover {
  color: var(--yango-orange);
}

/* ── Sort links ── */
.sort-link {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.sort-link:hover {
  color: var(--text-primary);
}

.sort-icon {
  font-size: 11px;
  opacity: 0.4;
}

.sort-icon.active {
  opacity: 1;
  color: var(--yango-orange);
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.3;
}

/* ── Pagination bar ── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}

.pagination {
  gap: 4px;
}

.page-link {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
  border-radius: 8px !important;
  min-width: 36px;
  text-align: center;
  font-size: 13px;
  padding: 6px 10px;
}

.page-link:hover {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--yango-orange);
}

.page-item.active .page-link {
  background-color: var(--yango-orange);
  border-color: var(--yango-orange);
  color: #fff;
}

.page-item.disabled .page-link {
  background-color: transparent;
  border-color: var(--border-color);
  color: #444;
}

.page-item + .page-item {
  margin-left: 0;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.card-header {
  background: var(--bg-secondary) !important;
  border-bottom: 1px solid var(--border-color);
  border-radius: 16px 16px 0 0 !important;
  color: var(--text-primary);
}

.card-body {
  color: var(--text-primary);
}

/* ── Tables ── */
.table {
  color: var(--text-primary);
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(252,63,29,0.06);
  margin-bottom: 0;
}

.table thead th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 12px;
  background: var(--bg-card);
}

.table td {
  border-color: var(--border-color);
  vertical-align: middle;
  padding: 10px 12px;
  font-size: 14px;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-borderless td, .table-borderless th {
  border: none;
}

.table-dark {
  --bs-table-bg: var(--bg-secondary);
  --bs-table-color: var(--text-primary);
  --bs-table-border-color: var(--border-color);
}

/* ── Buttons ── */
.btn-primary {
  background-color: var(--yango-orange);
  border-color: var(--yango-orange);
  border-radius: 12px;
  font-weight: 500;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--yango-orange-hover);
  border-color: var(--yango-orange-hover);
}

.btn-outline-primary {
  color: var(--yango-orange);
  border-color: rgba(252,63,29,0.3);
  border-radius: 8px;
}

.btn-outline-primary:hover {
  background-color: var(--yango-orange);
  border-color: var(--yango-orange);
  color: #fff;
}

.btn-outline-secondary {
  color: var(--text-muted);
  border-color: var(--border-color);
  border-radius: 10px;
}

.btn-outline-secondary:hover {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

/* ── Forms ── */
.form-control, .form-select {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 12px;
  height: 48px;
}

.form-control:focus, .form-select:focus {
  background-color: var(--bg-secondary);
  border-color: var(--yango-orange);
  color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(252,63,29,0.25);
}

.form-control::placeholder {
  color: rgba(255,255,255,0.2);
}

.form-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-text {
  color: var(--text-muted);
}

.input-group-text {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-muted);
}

/* ── Badges ── */
.badge.bg-success { background-color: #22c55e !important; }
.badge.bg-warning { background-color: var(--yango-orange) !important; color: #fff !important; }
.badge.bg-info { background-color: #3b82f6 !important; }
.badge.bg-secondary { background-color: var(--bg-secondary) !important; color: var(--text-muted) !important; border: 1px solid var(--border-color); }
.badge.bg-danger { background-color: #ef4444 !important; }

/* ── Alerts ── */
.alert-danger {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.2);
  color: #fca5a5;
}

.alert-success {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.2);
  color: #86efac;
}

.alert-info {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.2);
  color: #93c5fd;
}

.btn-close {
  filter: invert(1);
}

/* ── Footer ── */
.yango-footer {
  background: var(--bg-primary) !important;
  border-top: 1px solid #262626 !important;
  color: var(--text-muted);
}

/* ── Login card ── */
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  max-width: 420px;
}

.login-logo {
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: 36px;
  color: var(--yango-orange);
  text-transform: uppercase;
  letter-spacing: -1.5px;
}

/* ── Text utilities ── */
.text-muted {
  color: var(--text-muted) !important;
}

code {
  color: var(--yango-orange);
  background: rgba(252,63,29,0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

a {
  color: var(--yango-orange);
}

a:hover {
  color: var(--yango-orange-hover);
}

/* ── Anti-download: document previews ── */
.doc-preview-container {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
  border-radius: 12px;
}

.doc-preview-img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: none;
}

.doc-preview-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 10;
}

.doc-preview-container * {
  user-select: none;
  -webkit-user-select: none;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Print protection ── */
@media print {
  body * {
    display: none !important;
  }
  body::after {
    content: 'Printing is not allowed.';
    display: block !important;
    font-size: 24px;
    text-align: center;
    padding: 100px;
    color: #000;
  }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .drivers-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-search {
    flex: 1 1 100%;
  }
  .filter-bar {
    gap: 8px;
    padding: 10px 12px;
  }
  .filter-group {
    flex: 1 1 calc(50% - 8px);
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .filter-select, .filter-date {
    width: 100%;
  }
  .filter-clear {
    flex: 1 1 100%;
    text-align: center;
    margin-left: 0;
  }
  .pagination-bar {
    flex-direction: column;
    align-items: center;
  }
}
