/*
 * KPT Assets Register - shared list and form patterns.
 *
 * Loaded after kpt-theme.css. Everything here uses the CoreUI tokens the app
 * already ships; no new hues are introduced.
 */

/* ------------------------------------------------------------- page header */

.kpt-page-head {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.kpt-page-head .kpt-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

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

.kpt-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 35px;
  padding: 0 15px;
  border-radius: 0.25rem;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.kpt-btn .c-icon,
.kpt-btn i {
  width: 15px;
  height: 15px;
  font-size: 15px;
}

.kpt-btn-primary { background: #2eb85c; border-color: #2eb85c; color: #fff; font-weight: 600; }
.kpt-btn-primary:hover { background: #269b4d; border-color: #269b4d; color: #fff; text-decoration: none; }

.kpt-btn-secondary { background: #fff; border-color: #d8dbe0; color: #3c4b64; }
.kpt-btn-secondary:hover { background: #ebedef; border-color: #b1b7c1; color: #3c4b64; text-decoration: none; }

.kpt-btn-danger { background: #fff; border-color: #f3b7b7; color: #c33; }
.kpt-btn-danger:hover { background: #fdeaea; border-color: #e55353; color: #a52a2a; text-decoration: none; }

/* Compact icon-only action button used in list rows. */
.kpt-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  margin-left: 4px;
  border: 1px solid #d8dbe0;
  border-radius: 0.25rem;
  background: #fff;
  color: #4f5d73;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.kpt-icon-btn:hover { background: #ebedef; border-color: #b1b7c1; color: #3c4b64; text-decoration: none; }
.kpt-icon-btn.is-danger:hover { background: #fdeaea; border-color: #e55353; color: #c33; }
.kpt-icon-btn i { font-size: 14px; }

/* ----------------------------------------------------------------- toolbar */

.kpt-list-card {
  background: #fff;
  border: 1px solid #d8dbe0;
  border-radius: 0.25rem;
}

.kpt-toolbar {
  padding: 12px 14px;
  border-bottom: 1px solid #d8dbe0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kpt-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f6f7f9;
  border: 1px solid #d8dbe0;
  border-radius: 0.25rem;
  height: 34px;
  padding: 0 11px;
  min-width: 260px;
}

.kpt-search:focus-within {
  border-color: #321fdb;
  box-shadow: 0 0 0 2px rgba(50, 31, 219, 0.12);
}

.kpt-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: #3c4b64;
  font-family: inherit;
}

.kpt-search i { color: #768192; font-size: 15px; }

/* Filter chip - a plain link that carries the querystring. */
.kpt-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 11px;
  border: 1px solid #d8dbe0;
  border-radius: 0.25rem;
  background: #fff;
  color: #4f5d73;
  font-size: 12.5px;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.kpt-chip:hover { border-color: #768192; color: #4f5d73; text-decoration: none; }

.kpt-chip.is-on {
  border-color: #321fdb;
  background: #eceafb;
  color: #321fdb;
  font-weight: 600;
}

.kpt-toolbar-meta {
  margin-left: auto;
  font-size: 12.5px;
  color: #768192;
  font-variant-numeric: tabular-nums;
}

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

.kpt-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}

.kpt-table thead th {
  background: #f6f7f9;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #768192;
  border: 0;
  padding: 10px 12px;
  white-space: nowrap;
}

.kpt-table thead th a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kpt-table thead th a:hover { color: #321fdb; }
.kpt-table thead th.is-sorted { color: #321fdb; }

.kpt-table tbody td {
  padding: 9px 12px;
  border-top: 1px solid #ebedef;
  font-size: 13px;
  vertical-align: middle;
}

.kpt-table tbody tr:hover { background: #f6f7f9; }

.kpt-cell-title { font-size: 13px; font-weight: 500; line-height: 1.35; }
.kpt-cell-sub { font-size: 11px; color: #768192; font-variant-numeric: tabular-nums; }

.kpt-chip-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  background: #ebedef;
  color: #4f5d73;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.kpt-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #4f5d73;
  white-space: nowrap;
}

.kpt-status .kpt-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2eb85c;
  flex-shrink: 0;
}

.kpt-status.is-bad { color: #c33; }
.kpt-status.is-bad .kpt-dot { background: #e55353; }

.kpt-thumb {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 0.25rem;
  background: #f0f1f3;
  border: 1px solid #e3e5e8;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b1b7c1;
}

/* ---------------------------------------------------------- empty + footer */

.kpt-empty {
  padding: 46px 20px;
  text-align: center;
}

.kpt-empty .kpt-empty-title { font-size: 14px; font-weight: 600; margin-top: 10px; }
.kpt-empty .kpt-empty-body { font-size: 12.5px; color: #768192; margin-top: 3px; }
.kpt-empty i { font-size: 30px; color: #b1b7c1; }

.kpt-list-foot {
  border-top: 1px solid #d8dbe0;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kpt-range {
  font-size: 12.5px;
  color: #768192;
  font-variant-numeric: tabular-nums;
}

.kpt-list-foot .pagination {
  margin: 0 0 0 auto;
  font-size: 12.5px;
}

.kpt-list-foot .page-link {
  color: #4f5d73;
  border-color: #d8dbe0;
  padding: 4px 10px;
}

.kpt-list-foot .page-item.active .page-link {
  background: #321fdb;
  border-color: #321fdb;
  color: #fff;
}

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

.kpt-form-section {
  background: #fff;
  border: 1px solid #d8dbe0;
  border-radius: 0.25rem;
  margin-bottom: 16px;
}

.kpt-form-section > .kpt-section-head {
  padding: 13px 20px;
  border-bottom: 1px solid #d8dbe0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.kpt-section-head .kpt-section-title { font-size: 14px; font-weight: 600; }
.kpt-section-head .kpt-section-hint { font-size: 12px; color: #768192; }

.kpt-form-section > .kpt-section-body { padding: 18px 20px 4px; }

.kpt-form-section label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
}

.kpt-req { color: #e55353; }

.kpt-form-section .form-control,
.kpt-form-section .custom-select {
  height: 36px;
  font-size: 13px;
  border-color: #d8dbe0;
  border-radius: 0.25rem;
  color: #3c4b64;
}

.kpt-form-section textarea.form-control { height: auto; }

.kpt-form-section .form-control:focus {
  border-color: #321fdb;
  box-shadow: 0 0 0 2px rgba(50, 31, 219, 0.12);
}

.kpt-form-section .form-control.is-invalid {
  border-color: #e55353;
  background: #fdf6f6;
}

.kpt-form-section .invalid-feedback { font-size: 11px; color: #c33; }
.kpt-form-section .form-text { font-size: 11px; color: #768192; margin-top: 4px; }

.kpt-form-bar {
  background: #fff;
  border: 1px solid #d8dbe0;
  border-radius: 0.25rem;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.kpt-form-bar .kpt-form-note { font-size: 12px; color: #768192; }
.kpt-form-bar .kpt-actions { margin-left: auto; display: flex; gap: 8px; }

/* ----------------------------------------------------------------- notices */

.kpt-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 0.25rem;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12.5px;
}

.kpt-notice i { flex-shrink: 0; font-size: 16px; margin-top: 1px; }
.kpt-notice .kpt-notice-action { margin-left: auto; flex-shrink: 0; font-weight: 600; white-space: nowrap; }

.kpt-notice-warning {
  background: #fff8e6;
  border: 1px solid #f5d98f;
  color: #6b4e00;
}

.kpt-notice-warning i,
.kpt-notice-warning .kpt-notice-action { color: #9a6700; }

/* Assigns an officer from the list; dashed so it reads as a gap to fill. */
.kpt-assign {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  color: #768192;
  border: 1px dashed #c4c9d0;
  border-radius: 10px;
  padding: 2px 9px;
  text-decoration: none;
}

.kpt-assign:hover {
  background: #eceafb;
  border-color: #321fdb;
  border-style: solid;
  color: #321fdb;
  text-decoration: none;
}

/* ------------------------------------------------------------ report tiles */

/* One tile per report on /reports. Each is its own <form>, so the tile has to
   stretch to the row height and keep its button pinned to the bottom edge
   whatever the blurb above it runs to. */
.kpt-report-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid #d8dbe0;
  border-radius: 0.25rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.kpt-report-card:hover {
  border-color: var(--kpt-green);
  box-shadow: 0 1px 6px rgba(0, 128, 0, .10);
}

.kpt-report-card .kpt-report-body { padding: 16px 18px 4px; flex: 1 1 auto; }
.kpt-report-card .kpt-report-foot {
  padding: 12px 18px;
  border-top: 1px solid #ebedef;
  background: #fbfbfc;
  border-radius: 0 0 0.25rem 0.25rem;
}

.kpt-report-card .kpt-report-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #3c4b64;
  margin-bottom: 5px;
}

.kpt-report-card .kpt-report-desc {
  font-size: 12.5px;
  color: #768192;
  margin-bottom: 14px;
}

.kpt-report-card .form-group { margin-bottom: 12px; }
.kpt-report-card label { font-size: 11.5px; font-weight: 600; color: #768192; margin-bottom: 4px; }
.kpt-report-card .form-control { font-size: 13px; }

/* Bootstrap 4 has no gap utilities, so the tile rows space themselves. */
.kpt-report-grid { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.kpt-report-grid > [class*="col-"] { padding: 0 8px; margin-bottom: 16px; }

/* ------------------------------------------------------------- sign-in page */

.kpt-auth { width: 100%; max-width: 880px; margin: 0 auto; padding: 20px; }

.kpt-auth-card {
  display: flex;
  border-radius: 0.35rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 21, .12);
  background: #fff;
}

.kpt-auth-form { flex: 1 1 58%; padding: 38px 40px; }
.kpt-auth-form h1 { font-size: 24px; font-weight: 600; color: #3c4b64; margin-bottom: 2px; }
.kpt-auth-form .kpt-auth-sub { font-size: 13px; color: #768192; margin-bottom: 24px; }
.kpt-auth-form label { font-size: 11.5px; font-weight: 600; color: #768192; margin-bottom: 4px; }

/* The brand half. Hidden on small screens, where it is only decoration. */
.kpt-auth-brand {
  flex: 0 0 42%;
  background: var(--kpt-green);
  color: #fff;
  padding: 38px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.kpt-auth-brand img {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  padding: 4px;
  margin-bottom: 16px;
}

.kpt-auth-brand h2 { font-size: 19px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.kpt-auth-brand p { font-size: 12.5px; color: rgba(255, 255, 255, .78); margin: 0; }

@media (max-width: 767.98px) {
  .kpt-auth-card { flex-direction: column; }
  .kpt-auth-brand { flex: 0 0 auto; padding: 26px 24px; }
  .kpt-auth-brand img { width: 56px; height: 56px; margin-bottom: 10px; }
  .kpt-auth-form { padding: 28px 24px; }
}
