:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-soft: #1e293b;
  --border-color: #334155;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --bg-body: #0f172a;
  --radius-lg: 12px;
  --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* Layout */

.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  color: #f7f9fc;
  min-height: 100vh;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.page-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.header-left {
  display: flex;
  flex-direction: column;
}

/* Buttons */

.btn-primary {
  border: none;
  outline: none;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn-history {
  border: none;
  outline: none;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  backdrop-filter: blur(8px);
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 14px;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
  margin-right: 8px;
  margin-bottom: 8px;
}

.btn-history:hover {
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(59, 130, 246, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
}

.btn-history:active {
  transform: translateY(0);
}

.btn-history .icon {
  font-size: 16px;
  margin-right: 8px;
  opacity: 0.9;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary .icon {
  font-size: 16px;
}

/* Card */

.card {
  background: #1e293b;
  border-radius: var(--radius-lg);
  padding: 16px 18px 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-color);
  flex: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

/* Search */

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-label {
  font-size: 13px;
  color: var(--text-muted);
}

#searchBox {
  border-radius: 999px;
  border: 1px solid var(--border-color);
  padding: 7px 12px;
  min-width: 240px;
  font-size: 13px;
  outline: none;
  background: #0f172a;
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}

#searchBox:focus {
  border-color: var(--primary);
  background: #1e293b;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

/* DataTables */

table.dataTable {
  border-collapse: separate !important;
  border-spacing: 0;
  width: 100%;
  font-size: 13px;
  color: var(--text-main);
}

#resultsTable thead th {
  background: var(--primary-soft);
  border-bottom: 1px solid var(--border-color) !important;
  padding: 10px 12px;
  font-weight: 600;
  color: #cbd5e1;
}

#resultsTable tbody td {
  padding: 9px 12px;
  border-top: 1px solid var(--border-color);
}

#resultsTable tbody tr:nth-child(odd) {
  background-color: #0f172a;
}

#resultsTable tbody tr:nth-child(even) {
  background-color: #1e293b;
}

#resultsTable tbody tr:hover {
  background-color: #334155;
}

.dataTables_wrapper .dataTables_paginate {
  margin-top: 10px;
  font-size: 12px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 999px !important;
  border: 1px solid transparent !important;
  padding: 3px 8px !important;
  margin: 0 2px !important;
  color: var(--text-main) !important;
  background: #1e293b !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

.dataTables_wrapper .dataTables_info {
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 12px;
}

.dataTables_wrapper .dataTables_length {
  font-size: 12px;
  color: var(--text-muted);
}

/* DataTables "Show X entries" – dark theme (match view design) */
.dataTables_wrapper .dataTables_length select {
  background-color: var(--bg-body); /* ista pozadina kao view */
  color: var(--text-main); /* BIJELA slova */
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 4px 8px;
  outline: none;
}

/* Opcije u dropdownu */
.dataTables_wrapper .dataTables_length select option {
  background-color: var(--bg-body); /* tamna pozadina */
  color: var(--text-main); /* bijeli tekst */
}

/* Hover nad opcijom */
.dataTables_wrapper .dataTables_length select option:hover {
  background-color: var(--primary); /* svijetlo / brand plava */
  color: #ffffff;
}

/* Trenutno odabrana opcija */
.dataTables_wrapper .dataTables_length select option:checked {
  background-color: rgba(78, 161, 255, 0.25); /* blaža plava */
  color: #ffffff;
}

/* Sakrij default DataTables search box */
.dataTables_wrapper .dataTables_filter {
  display: none !important;
}

/* Responsive */

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  #searchBox {
    width: 100%;
  }
}
