/* ===========================================================================
   GAPTECH content styling
   Load after style.css, sidenav.css and topbar.css. Everything is scoped to
   main, so the side nav and top bar are untouched.
   =========================================================================== */

:root {
  --c-navy:   #0D4F72;
  --c-blue:   #1890D0;
  --c-green:  #8CC63F;
  --c-ink:    #1C2430;
  --c-body:   #4A5568;
  --c-muted:  #8793A3;
  --c-line:   #E4EBF2;
  --c-soft:   #F6F9FC;
  --c-card:   0 1px 2px rgba(13,79,114,.04), 0 6px 20px rgba(13,79,114,.06);
}

main {
  color: var(--c-body);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- headings */

main h1 {
  margin: 4px 0 6px;
  font-size: 25px; font-weight: 700; letter-spacing: -.5px;
  color: var(--c-ink); line-height: 1.2;
}
main h2 {
  margin: 34px 0 14px;
  font-size: 16px; font-weight: 650; letter-spacing: -.2px;
  color: var(--c-ink);
  display: flex; align-items: center; gap: 10px;
}
main h2::after {
  content: ""; flex: 1 1 auto; height: 1px; background: var(--c-line);
}

main > .hint,
main > p.hint {
  margin: 0 0 22px;
  font-size: 13.5px; color: var(--c-muted); line-height: 1.55;
}

main p.error {
  margin: 0 0 18px; padding: 11px 15px;
  background: #FDF1F1; border-left: 3px solid #E81820; border-radius: 0 7px 7px 0;
  color: #93131A; font-size: 13.5px;
}

/* ------------------------------------------------------------- search card */

main .searchbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 18px; padding: 14px;
  background: #fff; border: 1px solid var(--c-line);
  border-radius: 14px; box-shadow: var(--c-card);
}
main .searchbar input[type="text"],
main .searchbar input:not([type]) {
  flex: 1 1 280px; min-width: 0; margin: 0;
  padding: 10px 14px; font-size: 14px;
  border: 1px solid var(--c-line); border-radius: 9px;
  background: var(--c-soft); color: var(--c-ink);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
main .searchbar input:focus {
  outline: none; background: #fff;
  border-color: var(--c-blue); box-shadow: 0 0 0 3px rgba(24,144,208,.14);
}

/* ------------------------------------------------------------------ buttons */

main .button,
main button[type="submit"],
main .searchbar button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 17px; border: 1px solid transparent; border-radius: 9px;
  background: var(--c-navy); color: #fff;
  font-size: 13.5px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, box-shadow .15s ease, transform .06s ease;
}
main .button:hover,
main button[type="submit"]:hover { background: #0A4260; box-shadow: 0 3px 10px rgba(13,79,114,.22); }
main .button:active,
main button[type="submit"]:active { transform: translateY(1px); }

main .button.secondary {
  background: #fff; color: var(--c-navy); border-color: var(--c-line);
}
main .button.secondary:hover { background: var(--c-soft); border-color: #CBDCEA; box-shadow: none; }

main .button.danger,
main button.danger { background: #C3121A; }
main .button.danger:hover,
main button.danger:hover { background: #A50F16; }

/* -------------------------------------------------------------------- chips */

main .filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }

main .chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--c-line);
  color: var(--c-body); font-size: 13px; font-weight: 500;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
main .chip:hover { border-color: #BFD5E6; color: var(--c-navy); background: var(--c-soft); }

main .chip-on {
  background: linear-gradient(135deg, var(--c-blue), var(--c-navy));
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(13,79,114,.22);
}

main .chip-count {
  min-width: 20px; padding: 1px 6px; border-radius: 999px;
  background: var(--c-soft); color: var(--c-muted);
  font-size: 11px; font-weight: 700; text-align: center;
}
main .chip-on .chip-count { background: rgba(255,255,255,.22); color: #fff; }

/* ------------------------------------------------------------------- tables */

main table {
  width: 100%; margin: 0 0 18px;
  border-collapse: separate; border-spacing: 0;
  background: #fff; border: 1px solid var(--c-line);
  border-radius: 14px; overflow: hidden;
  box-shadow: var(--c-card);
  font-size: 13.5px;
}

main table th {
  padding: 13px 16px; text-align: left;
  background: linear-gradient(180deg, #14547A, #0D4F72);
  color: #fff; font-size: 11px; font-weight: 700;
  letter-spacing: .7px; text-transform: uppercase;
  white-space: nowrap; border: 0;
}

main table td {
  padding: 13px 16px; border: 0;
  border-top: 1px solid #EDF2F7; color: var(--c-body); vertical-align: middle;
}
main table tr:first-child td { border-top: 0; }
main table tbody tr:hover td,
main table tr:hover td { background: #F8FBFE; }

/* first column reads as a reference number */
main table td:first-child { color: var(--c-ink); font-weight: 600; }

main table a { color: var(--c-blue); text-decoration: none; font-weight: 600; }
main table a:hover { color: var(--c-navy); text-decoration: underline; }

main table code {
  padding: 2px 7px; border-radius: 5px;
  background: var(--c-soft); border: 1px solid var(--c-line);
  font-size: 12px; color: var(--c-ink); letter-spacing: .3px;
}

/* ---- status cells get a dot, no markup change needed ---- */
main td[class*="status-"] { font-weight: 600; white-space: nowrap; }
main td[class*="status-"]::before {
  content: ""; display: inline-block;
  width: 7px; height: 7px; margin-right: 8px; border-radius: 50%;
  background: currentColor; vertical-align: 1px;
}
main td.status-valid       { color: #1E7B34; }
main td.status-expired     { color: #B06A00; }
main td.status-pending     { color: #8A5A00; }
main td.status-superseded  { color: #6B7280; }
main td.status-voided,
main td.status-rejected    { color: #C3121A; }

/* ------------------------------------------------------------------- pager */

main .pager {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin: 0 0 28px; padding: 12px 16px;
  background: #fff; border: 1px solid var(--c-line);
  border-radius: 12px; box-shadow: var(--c-card);
  font-size: 13px; color: var(--c-muted);
}
main .pager .per-page { margin: 0; }
main .pager label { display: flex; align-items: center; gap: 8px; margin: 0;
                    font-size: 13px; color: var(--c-muted); }
main .pager select {
  padding: 6px 10px; border: 1px solid var(--c-line); border-radius: 8px;
  background: #fff; font: inherit; font-size: 13px; color: var(--c-ink);
}
main .pager-info { margin: 0 auto; }
main .pager-buttons { display: flex; align-items: center; gap: 8px; }
main .pager-page { padding: 0 6px; color: var(--c-body); font-weight: 600; }
main .pager .button { padding: 7px 13px; font-size: 12.5px; }

/* ------------------------------------------------------------------- forms */

main form:not(.searchbar):not(.per-page) label {
  display: block; margin: 0 0 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--c-muted);
}
main form:not(.searchbar) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
main form:not(.searchbar) select,
main form:not(.searchbar) textarea {
  display: block; width: 100%; margin-top: 6px; box-sizing: border-box;
  padding: 10px 13px; border: 1px solid var(--c-line); border-radius: 9px;
  background: #fff; font: inherit; font-size: 14px; font-weight: 400;
  text-transform: none; letter-spacing: 0; color: var(--c-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
main form input:focus, main form select:focus, main form textarea:focus {
  outline: none; border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(24,144,208,.14);
}
main .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; }

/* --------------------------------------------------------- detail tables */

main table.details th {
  background: var(--c-soft); color: var(--c-muted);
  border-right: 1px solid var(--c-line);
  text-transform: uppercase; font-size: 10.5px;
}
main table.details td { color: var(--c-ink); }

/* ------------------------------------------------------------- stat tiles */

main .stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 22px; }
main .stat {
  min-width: 164px; padding: 16px 20px;
  background: #fff; border: 1px solid var(--c-line);
  border-radius: 14px; box-shadow: var(--c-card);
  display: flex; flex-direction: column; gap: 3px;
}
main .stat-num { font-size: 27px; font-weight: 700; color: var(--c-navy); line-height: 1.05; }
main .stat-label { font-size: 11.5px; color: var(--c-muted); }
main .stat-link { text-decoration: none; border-left: 3px solid var(--c-green); }
main .stat-link:hover { background: var(--c-soft); }
main .stat-link .stat-num { color: #8A5A00; }

/* ----------------------------------------------------------------- mobile */

@media (max-width: 640px) {
  main h1 { font-size: 21px; }
  main .searchbar { padding: 12px; }
  main .pager { gap: 12px; }
  main .pager-info { margin: 0; }
}

@media print {
  main table { box-shadow: none; }
  main .searchbar, main .filters, main .pager, main .actions { display: none !important; }
}

.pw-wrap { position: relative; display: block; margin-top: 6px; }
.pw-wrap > input { margin-top: 0 !important; padding-right: 42px !important; width: 100%; }

.pw-wrap > button.pw-eye {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 30px; height: 30px; min-width: 0; padding: 0; margin: 0;
  display: flex; align-items: center; justify-content: center;
  background: none !important; border: 0 !important; box-shadow: none !important;
  border-radius: 6px; color: #8793A3; cursor: pointer;
}
.pw-wrap > button.pw-eye:hover { background: #F2F7FB !important; color: #0D4F72; }
.pw-wrap > button.pw-eye svg { width: 17px; height: 17px; display: block; }


.dash { display: block; text-align: center; color: #A8B4C2; }

.modal .modal-meta {
  white-space: pre-line; line-height: 1.5;
  margin: 0 0 14px; padding: 12px 14px;
  background: #F4F9FD; border-left: 3px solid #1890D0;
  border-radius: 0 8px 8px 0;
  font-size: 13px; color: #27303D;
}