/* EA Global styles — system-wide */
:root {
  --ea-navy:   #20253a;
  --ea-pink:   #e600a0;
  --ea-teal:   #05545a;
  --ea-green:  #16C851;
  --ea-red:    #de0a26;
  --bg-grey:   rgb(236, 235, 235);
  --bg-darker: rgb(216, 215, 215);
}

body {
  font-family: Arial, sans-serif;
  font-size: 14px;
  margin: 0;
}

/* ── Utility buttons ──────────────────────────────────────────────────────── */
.bt-blue   { background-color: var(--ea-navy);  color:#fff; border:none; padding:.5rem 1rem; font-size:15px; border-radius:5px; cursor:pointer; }
.bt-pink   { background-color: var(--ea-pink);  color:#fff; border:none; padding:.5rem 1rem; font-size:15px; border-radius:5px; cursor:pointer; }
.bt-teal   { background-color: var(--ea-teal);  color:#fff; border:none; padding:.5rem 1rem; font-size:15px; border-radius:5px; cursor:pointer; }
.bt-green  { background-color: #5dd9be;          color:#fff; border:none; padding:.5rem 1rem; font-size:15px; border-radius:5px; cursor:pointer; }
.bt-red    { background-color: var(--ea-red);   color:#fff; border:none; padding:.5rem 1rem; font-size:15px; border-radius:5px; cursor:pointer; }

.grey-bc   { background-color: var(--bg-grey); }
.darker-bc { background-color: var(--bg-darker); }

/* ── Toast alerts ────────────────────────────────────────────────────────── */
.alert {
  position: fixed; bottom: 20px; left: 20px;
  padding: 15px 30px; background: rgba(50,205,50,.85); color:#fff;
  border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,.2);
  z-index: 1000; font-size: 15px; display: none;
}
.alert_error {
  position: fixed; bottom: 20px; left: 20px;
  padding: 15px 30px; background: rgba(255,0,0,.85); color:#fff;
  border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,.2);
  z-index: 1000; font-size: 15px; display: none;
}

/* ── Form / table helpers ─────────────────────────────────────────────────── */
.invalid-field { border: 2px solid red !important; background: #ffd0d0; }

.form-group { margin-bottom: 15px; }

table { width:100%; border-collapse:collapse; margin-top:10px; white-space:nowrap; }
table, th, td { border: 1px solid #ddd; }
th, td { padding: 10px; text-align: left; }
th { background-color: var(--ea-pink); color: #fff; }

.table-responsive {
  overflow-x: auto;
  scrollbar-width: auto;
}
.table-responsive::-webkit-scrollbar       { height: 8px; }
.table-responsive::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; }
.table-responsive::-webkit-scrollbar-track { background: #f1f1f1; }

/* ── Filter form ─────────────────────────────────────────────────────────── */
.filter-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.filter-select {
  width: 100%;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #333;
  background: #fff;
  transition: border-color .2s;
}
.filter-select:focus {
  border-color: #05545a;
  outline: none;
  box-shadow: 0 0 0 3px rgba(5,84,90,.1);
}

/* ── Filter clear button ──────────────────────────────────────────────────── */
.filter-wrap { display:flex; align-items:center; gap:4px; }
.filter-wrap .filter-select { flex:1; min-width:0; }
.filter-clear {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: none;
  border: 1.5px solid #ddd;
  border-radius: 50%;
  color: #bbb;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: default;
  pointer-events: none;
  opacity: 0.4;
  transition: opacity .15s, color .15s, border-color .15s;
}
.filter-clear.active {
  color: #e600a0;
  border-color: #e600a0;
  cursor: pointer;
  pointer-events: auto;
  opacity: 1;
}
.filter-clear.active:hover { background: #fff0fa; }

/* ── DataTables layout ────────────────────────────────────────────────────── */
.dt-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
/* Push search to the far right */
.dt-top .dataTables_filter { margin-left: auto; }

.dt-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
}

/* Export buttons */
.dt-buttons .btn {
  background: #05545a;
  color: #fff !important;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.dt-buttons .btn:hover { background: #033b40; color: #fff !important; }

/* Search input */
div.dataTables_filter input {
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  min-width: 200px;
}

/* Entries length dropdown — wide enough that the arrow doesn't overlap text */
div.dataTables_length select {
  border: 1.5px solid #ddd;
  border-radius: 6px;
  padding: 4px 28px 4px 8px;
  font-size: 13px;
  min-width: 80px;
}

/* Compact table — fixed layout so columns stay within the card width */
#dataTable {
  table-layout: fixed;
  width: 100% !important;
}
#dataTable td,
#dataTable th {
  font-size: 12px;
  padding: 5px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
/* Name columns wrap instead of truncating */
#dataTable td:nth-child(1),
#dataTable td:nth-child(2),
#dataTable td:nth-child(6) {
  white-space: normal;
  word-break: break-word;
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.search-form { display:flex; gap:10px; flex-grow:1; }
.search-form input { padding:8px; width:250px; border:1px solid #ccc; border-radius:5px; }
.search-form button { background:var(--ea-navy); color:#fff; border:none; padding:8px 12px; cursor:pointer; border-radius:5px; }
.search-form button:hover { background:#d5f4f7; color:#000; }

.delete-btn { background:var(--ea-red); color:#fff; border:none; padding:5px 10px; cursor:pointer; border-radius:5px; font-size:13px; }
.delete-btn:hover { background:#b52a37; }

@media (max-width:768px) {
  .top-bar { flex-direction:column; gap:10px; }
  .search-form { width:100%; }
  .search-form input { width:100%; }
}
