:root {
  --ub-navy: #17365d;
  --ub-navy-dark: #10263f;
  --ub-yellow: #f2c418;
  --ub-bg: #f4f6f9;
  --bs-primary: #17365d;
  --bs-primary-rgb: 23, 54, 93;
  --bs-link-color: #1f4f8a;
  --bs-link-color-rgb: 31, 79, 138;
  --bs-link-hover-color: #17365d;
}

body {
  background: var(--ub-bg);
  color: #1d2733;
}

.btn-primary {
  --bs-btn-bg: var(--ub-navy);
  --bs-btn-border-color: var(--ub-navy);
  --bs-btn-hover-bg: var(--ub-navy-dark);
  --bs-btn-hover-border-color: var(--ub-navy-dark);
  --bs-btn-active-bg: var(--ub-navy-dark);
  --bs-btn-active-border-color: var(--ub-navy-dark);
  --bs-btn-disabled-bg: var(--ub-navy);
  --bs-btn-disabled-border-color: var(--ub-navy);
}

.btn-outline-primary {
  --bs-btn-color: var(--ub-navy);
  --bs-btn-border-color: var(--ub-navy);
  --bs-btn-hover-bg: var(--ub-navy);
  --bs-btn-hover-border-color: var(--ub-navy);
  --bs-btn-active-bg: var(--ub-navy);
  --bs-btn-active-border-color: var(--ub-navy);
}

.pagination {
  --bs-pagination-active-bg: var(--ub-navy);
  --bs-pagination-active-border-color: var(--ub-navy);
  --bs-pagination-color: var(--ub-navy);
}

.form-control:focus,
.form-select:focus {
  border-color: #6b8db8;
  box-shadow: 0 0 0 0.2rem rgba(23, 54, 93, 0.15);
}

/* ------------------------------------------------------------------ layout */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
  /* Bootstrap's .offcanvas-lg sets a transparent background !important on wide screens. */
  background-color: var(--ub-navy) !important;
  color: #fff;
  display: flex;
  flex-direction: column;
}

@media (min-width: 992px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
  }
}

.sidebar.offcanvas-lg {
  --bs-offcanvas-bg: var(--ub-navy);
  --bs-offcanvas-color: #fff;
  --bs-offcanvas-width: 260px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1.1rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand img {
  width: 46px;
  height: 36px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  padding: 2px;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
}

.sidebar-nav {
  padding: 0.75rem 0.6rem;
  flex: 1;
  overflow-y: auto;
}

.nav-section {
  margin: 1rem 0.6rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ub-yellow);
}

.nav-item-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.45rem;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 0.93rem;
}

.nav-item-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item-link.active {
  background: rgba(242, 196, 24, 0.16);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--ub-yellow);
}

.sidebar-foot {
  padding: 1rem 1.1rem 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.content {
  flex: 1;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: #fff;
  border-bottom: 1px solid #e3e7ed;
  position: sticky;
  top: 0;
  z-index: 10;
}

.content-inner {
  padding: 1.5rem;
  max-width: 1400px;
}

@media (max-width: 575.98px) {
  .content-inner {
    padding: 1rem;
  }
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.crumb {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c7a8b;
}

.crumb a {
  color: inherit;
  text-decoration: none;
}

.crumb a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------ cards */
.card {
  border-color: #e3e7ed;
  box-shadow: 0 1px 2px rgba(16, 38, 63, 0.04);
}

.card-header {
  background: #fff;
}

.form-card {
  max-width: 760px;
}

.table > thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c7a8b;
  font-weight: 600;
  white-space: nowrap;
  background: #fafbfc;
}

.cell-wrap {
  min-width: 180px;
  max-width: 320px;
}

.stat-card {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  border-color: #b8c6d8;
  box-shadow: 0 4px 14px rgba(16, 38, 63, 0.08);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(242, 196, 24, 0.2);
  color: var(--ub-navy);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ub-navy);
}

.stat-label {
  color: #6c7a8b;
  margin-top: 0.3rem;
}

.client-preview {
  background: #f6f8fb;
  border: 1px solid #e3e7ed;
  border-radius: 0.5rem;
  padding: 0.75rem 0.9rem;
}

.search-sm {
  max-width: 260px;
}

/* ------------------------------------------------------------------ auth */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(160deg, #eef2f7 0%, #f8f9fb 60%);
}

.auth-page .alert {
  width: 100%;
  max-width: 400px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  width: 84px;
  height: auto;
}

.form-control[readonly] {
  background-color: #eef1f5;
  color: #17365d;
  font-weight: 600;
  cursor: default;
}

.media-preview {
  min-height: 140px;
  display: grid;
  place-items: center;
  border: 1px dashed #c9d2de;
  border-radius: 0.5rem;
  background: repeating-conic-gradient(#f4f6f9 0% 25%, #fff 0% 50%) 50% / 16px 16px;
  padding: 0.75rem;
}

.media-preview img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.row-skipped td {
  background: #fff6f6;
}

.nav-pills {
  --bs-nav-pills-link-active-bg: var(--ub-navy);
  --bs-nav-link-color: var(--ub-navy);
  --bs-nav-link-hover-color: var(--ub-navy-dark);
}
