/* ==========================================================================
   Naviteo admin — design layer on top of Vuexy (Bootstrap 5.3).
   Loaded after vendor/css/core.css + css/demo.css. Overrides only design
   tokens and our own component classes; never edits the Vuexy source.
   ========================================================================== */

:root {
  /* Brand action colour stays Vuexy purple (compiled into buttons/badges). */
  --nv-brand: #7367f0;
  --nv-brand-rgb: 115, 103, 240;
  /* Fresh secondary accent used in our own components (nav rail, headers,
     stat-card icons, focus rings) — gives the redesign its own identity
     without fighting Bootstrap's compiled .btn-primary. */
  --nv-accent: #00c2cb;
  --nv-accent-rgb: 0, 194, 203;

  --nv-radius: 0.75rem;
  --nv-radius-sm: 0.5rem;
  --nv-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --nv-shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
  --nv-border: 1px solid rgba(16, 24, 40, 0.08);
}

/* Cooler, calmer page surface. */
html:not([data-bs-theme="dark"]) {
  --bs-body-bg: #f5f6fb;
  --bs-body-bg-rgb: 245, 246, 251;
}

/* ------------------------------------------------------------------ Cards */
.card {
  border: var(--nv-border);
  border-radius: var(--nv-radius);
  box-shadow: var(--nv-shadow-sm);
}
.card .card-header {
  border-bottom: var(--nv-border);
  padding-block: 1rem;
}
.card-title { font-weight: 600; letter-spacing: -0.01em; }

/* ------------------------------------------------------- Page header band */
.nv-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
}
.nv-page-header__title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}
.nv-page-header__subtitle {
  color: var(--bs-secondary-color);
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}
.nv-page-header__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.nv-breadcrumb {
  font-size: 0.8125rem;
  margin-bottom: 0.35rem;
}
.nv-breadcrumb .breadcrumb { margin: 0; }
.nv-breadcrumb a { color: var(--bs-secondary-color); text-decoration: none; }
.nv-breadcrumb a:hover { color: var(--nv-brand); }

/* --------------------------------------------------------------- Sidebar */
.menu-vertical .menu-header {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  opacity: 0.85;
  padding-top: 1.1rem;
  padding-bottom: 0.2rem;
}
.menu-vertical .menu-header:first-of-type { padding-top: 0.4rem; }

.menu-vertical .menu-item > .menu-link {
  border-radius: var(--nv-radius-sm);
  margin-inline: 0.65rem;
  font-weight: 500;
}
.menu-vertical .menu-item.active > .menu-link {
  position: relative;
  font-weight: 600;
}
/* Replace Vuexy's flat active with a softer tint + inset accent rail.
   box-shadow (not ::before) avoids Vuexy's own .menu-link::before rule. */
.layout-menu .menu-inner > .menu-item.active > .menu-link {
  background: rgba(var(--nv-brand-rgb), 0.12);
  color: var(--nv-brand);
  box-shadow: inset 3px 0 0 var(--nv-brand);
}
.layout-menu .menu-inner > .menu-item.active > .menu-link .menu-icon { color: var(--nv-brand); }
.menu-vertical .menu-item:not(.active) > .menu-link:hover {
  background: rgba(var(--nv-brand-rgb), 0.06);
}
.app-brand-text { letter-spacing: -0.02em; }

/* ---------------------------------------------------------------- Tables */
.table > thead > tr > th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

/* DataTables 2 zeroes the Bootstrap row/col gutters inside .dt-container, so
   table rows, the "Showing …" info and the pager would otherwise sit flush
   against the card's left edge. Re-introduce a consistent gutter and align
   the outer table cells with the controls above. */
.card-datatable .dt-container { padding-inline: 1.5rem; padding-bottom: 1.25rem; }
.card-datatable .dt-container > .row { margin-inline: 0; }
.card-datatable table.table > thead > tr > th:first-child,
.card-datatable table.table > tbody > tr > td:first-child { padding-left: 0; }
.card-datatable table.table > thead > tr > th:last-child,
.card-datatable table.table > tbody > tr > td:last-child { padding-right: 0; }
.table > tbody > tr { transition: background-color 0.12s ease; }
.card-datatable .table { margin-bottom: 0; }
td .text-body-secondary.small { font-size: 0.78rem; }

/* Soften all label badges into pill chips. */
.badge[class*="bg-label-"] {
  border-radius: 50rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.32em 0.7em;
}

/* ------------------------------------------------------------ Row actions */
.nv-row-actions {
  display: inline-flex;
  gap: 0.15rem;
  justify-content: flex-end;
  white-space: nowrap;
}
.nv-row-actions .btn { --bs-btn-padding-x: 0.45rem; }
.nv-row-actions form { display: inline; margin: 0; }

/* ------------------------------------------------------------- Stat cards */
.nv-stat { height: 100%; }
.nv-stat--link {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.nv-stat--link:hover {
  transform: translateY(-3px);
  box-shadow: var(--nv-shadow-md);
  border-color: rgba(var(--nv-brand-rgb), 0.35);
}
.nv-stat .stretched-link::after { border-radius: var(--nv-radius); }
.nv-stat__value { font-size: 1.7rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.nv-stat__label { color: var(--bs-secondary-color); font-size: 0.85rem; }
.nv-stat__icon .avatar-initial { font-size: 1.25rem; }

/* ------------------------------------------------------------ Filter bar */
.nv-filterbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; }
.nv-filterbar .nv-filterbar__field { min-width: 12rem; flex: 0 1 auto; }
.nv-filterbar .form-label { font-size: 0.75rem; margin-bottom: 0.2rem; color: var(--bs-secondary-color); }
.nv-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.nv-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(var(--nv-brand-rgb), 0.1);
  color: var(--nv-brand);
  border-radius: 50rem;
  padding: 0.2rem 0.4rem 0.2rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
}
.nv-chip a { color: inherit; display: inline-flex; opacity: 0.75; }
.nv-chip a:hover { opacity: 1; }

/* ----------------------------------------------------------- Empty state */
.nv-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--bs-secondary-color);
}
.nv-empty__icon {
  font-size: 2.5rem;
  color: var(--bs-secondary-color);
  opacity: 0.45;
  margin-bottom: 0.5rem;
}
.nv-empty__title { font-weight: 600; color: var(--bs-heading-color); margin-bottom: 0.25rem; }

/* ------------------------------------------------------- Form sections */
.nv-form-section + .nv-form-section { margin-top: 1.5rem; }
.nv-form-section__head { margin-bottom: 1rem; }
.nv-form-section__title { font-size: 0.95rem; font-weight: 600; margin: 0; }
.nv-form-section__subtitle { color: var(--bs-secondary-color); font-size: 0.82rem; margin: 0.15rem 0 0; }

/* Sticky save bar at the bottom of forms. */
.nv-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  padding: 0.85rem 1.25rem;
  margin-top: 1.5rem;
  background: rgba(var(--bs-body-bg-rgb), 0.85);
  backdrop-filter: blur(8px);
  border: var(--nv-border);
  border-radius: var(--nv-radius);
  box-shadow: var(--nv-shadow-md);
}
.nv-form-actions .nv-form-actions__spacer { margin-right: auto; }

/* Focus ring uses the accent for a fresh feel. */
.form-control:focus,
.form-select:focus {
  border-color: rgba(var(--nv-accent-rgb), 0.6);
  box-shadow: 0 0 0 0.15rem rgba(var(--nv-accent-rgb), 0.18);
}

/* ------------------------------------------------------------- Navbar */
.layout-navbar .nv-navbar-title { font-weight: 600; }

/* Toast/flash container spacing handled inline; just round them. */
.nv-toasts .alert { border-radius: var(--nv-radius-sm); border: var(--nv-border); }
