/*!
 * Theme: Default
 * Package: NioBoard
 * Version: 1.0.0
 * Updated: 10.21.2022
 * Author: Softnio
 * Author URI: http://themeforest.net/user/softnio
**/

/* ==========================================================================
   Campus Connect brand theme
   ==========================================================================
   The token declarations that used to live here -- the whole --cc-*, --nav-*
   and --bs-* set, in a light block and a dark block -- have moved to the one
   place they are now defined for all four portals:

     packages/ui/src/tokens/tokens.css            (--cc-*, --nav-*, --ds-*)
     packages/ui/src/tokens/bootstrap-bridge.css  (--bs-* -> var(--cc-*))

   Both are imported by this app's src/main.tsx. What remains below is only the
   NioBoard-specific selectors that CONSUME those tokens, which is the part that
   was genuinely per-app. Phase 5 deletes this file along with the template.
   ========================================================================== */

body.dark .card,
body.dark .nk-content .card {
  background-color: var(--cc-surface);
  border-color: var(--cc-border);
  color: var(--cc-text);
}

body.dark .card-inner > .card-title-group,
body.dark .card-inner > .title {
  border-bottom-color: var(--cc-border);
  color: var(--cc-navy);
}

body.dark .card-inner > .card-title-group .card-title .title {
  color: var(--cc-navy);
}

body.dark .nk-tb-list thead th,
body.dark .table thead th {
  background-color: var(--cc-surface2);
  color: var(--cc-text2);
  border-bottom-color: var(--cc-border);
}

body.dark .form-control,
body.dark .form-select {
  background-color: var(--cc-surface);
  border-color: var(--cc-border);
  color: var(--cc-text);
}

body.dark .nav-tabs {
  --bs-nav-tabs-border-color: var(--cc-border);
  --bs-nav-tabs-link-hover-border-color: var(--cc-border) var(--cc-border) var(--cc-border);
  --bs-nav-tabs-link-active-color: var(--cc-text);
  --bs-nav-tabs-link-active-bg: var(--cc-surface);
  --bs-nav-tabs-link-active-border-color: var(--cc-border) var(--cc-border) var(--cc-surface);
}

body.dark .nk-header .page-title,
body.dark #nk-page-title-slot .page-title {
  color: var(--cc-navy);
}

body.dark .nk-header.nk-header-fixed > .container-fluid,
body.dark .nk-header > .container-fluid {
  border-bottom-color: var(--cc-border);
  background-color: var(--cc-surface);
}

body.dark .nk-footer-copyright {
  color: var(--cc-text3);
}

body.dark .notification-item {
  border-bottom-color: var(--cc-border);
}

body.dark .notification-item:hover {
  background-color: var(--cc-surface2);
}

body.dark .notification-subject {
  color: var(--cc-text);
}

body.dark .notification-subject.is-unread {
  color: var(--cc-navy);
}

body.dark .dropdown-menu {
  background-color: var(--cc-surface);
  border-color: var(--cc-border);
  color: var(--cc-text);
}

body {
  background-color: var(--cc-bg);
  color: var(--cc-text);
  transition: background-color .15s ease, color .15s ease;
}

/* Headings ---------------------------------------------------------------- */

h1, .h1, h2, .h2 {
  font-family: var(--bs-font-display);
  font-weight: 800;
  color: var(--cc-navy);
}

h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
  font-family: var(--bs-font-display);
  font-weight: 700;
  color: var(--cc-text);
}

.overline-title,
.overline-title-alt {
  font-family: var(--bs-font-display);
  font-weight: 700;
  color: var(--cc-accent);
}

.is-theme .overline-title,
.is-dark .overline-title {
  color: #f8f8f9;
}

/* Font de-leak -----------------------------------------------------------------
   Same fix as crm-admin-react: a handful of selectors in this app's copy of style.css were
   hand-pinned to a different face, bypassing the :root token above. Re-point them
   so every surface resolves to Public Sans consistently. */
.form-control,
.form-select,
.e-grid,
.nk-nav-link,
.nk-footer-copyright,
.breadcrumb-item {
  font-family: var(--bs-font-sans-serif);
}

.btn {
  --bs-btn-font-family: var(--bs-font-sans-serif);
  font-weight: 600;
}

.title {
  font-family: var(--bs-font-display);
  font-weight: 700;
}

/* Page title + breadcrumb in the header band --------------------------------------
   This app reports its title through PageTitleContext into a plain <h1 class="page-title">
   in the header band (not a portaled slot like crm-admin-react), so the selector differs, but
   the type treatment matches, and <Breadcrumb> now renders directly below it in the same band
   (its own inline styles set color/size -- see Breadcrumb.tsx -- so there's nothing to target
   here for it). */
.nk-header .page-title {
  font-family: var(--bs-font-display);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--cc-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Buttons ------------------------------------------------------------------ */

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: #A21D23;
  --bs-btn-border-color: #A21D23;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #7A1319;
  --bs-btn-hover-border-color: #7A1319;
  --bs-btn-focus-shadow-rgb: 162, 29, 35;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #7A1319;
  --bs-btn-active-border-color: #7A1319;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #A21D23;
  --bs-btn-disabled-border-color: #A21D23;
  border-radius: 8px;
}

.btn-outline-primary {
  --bs-btn-color: #A21D23;
  --bs-btn-border-color: #A21D23;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #A21D23;
  --bs-btn-hover-border-color: #A21D23;
  --bs-btn-focus-shadow-rgb: 162, 29, 35;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #A21D23;
  --bs-btn-active-border-color: #A21D23;
  --bs-btn-disabled-color: #A21D23;
  --bs-btn-disabled-border-color: #A21D23;
  border-radius: 8px;
}

.btn-soft.btn-primary,
.btn-soft.btn-hover-primary:hover {
  --bs-btn-color: #A21D23;
  --bs-btn-bg: #FBE7EB;
  --bs-btn-border-color: transparent;
}

.btn-soft.btn-outline-primary {
  --bs-btn-color: #A21D23;
  --bs-btn-border-color: #A21D23;
}

.btn-color-primary {
  color: #A21D23;
}

.btn-outline-secondary,
.btn-outline-danger,
.btn.btn-sm {
  border-radius: 8px;
}

/* Form controls -------------------------------------------------------------- */

.form-check-input:checked {
  background-color: #A21D23;
  border-color: #A21D23;
}

.form-control,
.form-select {
  border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(162, 29, 35, 0.65);
  box-shadow: 0 0 5px 0px rgba(162, 29, 35, 0.2);
}

/* Cards ---------------------------------------------------------------------- */

.card-inner {
  padding: 1.5rem;
}

.card {
  --bs-card-spacer-y: 1.5rem;
  --bs-card-spacer-x: 1.5rem;
  border-color: var(--cc-border);
  border-radius: 12px;
  box-shadow: var(--cc-shadow);
}

@media (max-width: 575.98px) {
  .card {
    --bs-card-spacer-y: 1.125rem;
    --bs-card-spacer-x: 1.125rem;
  }
}

.card .card-title .title {
  font-size: 1.0625rem;
  line-height: 1.4;
}

.card-title-group {
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--cc-border);
}

.card-inner > .title {
  font-family: var(--bs-font-display);
  font-weight: 700;
  color: var(--cc-navy);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--cc-border);
}

.card-inner:has(> .card-amount) > .card-title-group {
  padding-bottom: 0;
  margin-bottom: 0.5rem;
  border-bottom: 0;
}

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

/* The table bleeds to the card edge so striped rows read as full-width bands, while the
   first/last cells stay aligned with the card's 1.5rem content inset. */
.card .table-responsive {
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  width: auto;
}

.card .table {
  margin-bottom: 0;
}

.card .table > :not(caption) > * > * {
  padding: 0.875rem 1rem;
  vertical-align: middle;
}

.card .table > :not(caption) > * > *:first-child {
  padding-left: 1.5rem;
}

.card .table > :not(caption) > * > *:last-child {
  padding-right: 1.5rem;
}

.nk-tb-list thead th,
.table thead th,
.card .table > thead > tr > th {
  font-family: var(--bs-font-sans-serif);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--cc-text3);
  background-color: var(--cc-surface2);
  border-bottom: 1px solid var(--cc-border);
  white-space: nowrap;
}

.card .table > tbody > tr > td {
  color: var(--cc-text);
}

.table-responsive {
  margin-inline: -0.25rem;
  padding-inline: 0.25rem;
}

.card-inner > div > .table-responsive > .table:last-child,
.card-inner > .table-responsive > .table:last-child {
  margin-bottom: 0;
}

/* Empty/loading states align with the card body inset instead of indenting past it. */
.card-inner .p-3.text-muted {
  padding: 0.5rem 0 !important;
}

/* Forms ------------------------------------------------------------------------ */

.card-inner .form-label {
  font-family: var(--bs-font-sans-serif);
  font-weight: 700;
  font-size: 0.71875rem;
  letter-spacing: 0.02em;
  color: var(--cc-text2);
  margin-bottom: 0.375rem;
}

.nk-block + .nk-block,
.row.g-gs + .row.g-gs {
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .col-md-2-4 {
    flex: 0 0 20%;
    max-width: 20%;
  }
}

/* Breadcrumbs ----------------------------------------------------------------- */

.breadcrumb a:hover {
  text-decoration: underline !important;
}

/* Notifications dropdown ------------------------------------------------------- */

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid var(--cc-border);
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item:hover {
  background-color: var(--cc-surface2);
}

.notification-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background-color: var(--cc-accent);
}

.notification-dot.is-read {
  background-color: transparent;
}

.notification-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.notification-subject {
  color: var(--cc-text);
  line-height: 1.4;
}

.notification-subject.is-unread {
  font-weight: 600;
  color: var(--cc-navy);
}

/* Sidebar / header dark surfaces ---------------------------------------------- */

.nk-sidebar.is-theme {
  background-color: #1E426C;
}

.nk-header.is-theme {
  background-color: #1E426C;
}

/* The navy brand block and the sidebar under it are one continuous surface. The base header
   border/shadow spans the full header width, which drew a light seam across that navy block --
   move the divider onto the white toolbar half only, and close the dead space above the first
   menu item so the menu reads as part of the same panel. */
.nk-header {
  border-bottom: 0;
  box-shadow: none;
}

.nk-header > .container-fluid {
  border-bottom: 1px solid var(--cc-border);
  background-color: var(--cc-surface);
  /* Line the header title up with the content column below it: the container's own gutter plus
     the horizontal inset .nk-content adds, matched on the same breakpoint. */
  padding-left: calc(var(--bs-gutter-x, 1.75rem) * 0.5 + 0.5rem);
}

@media (min-width: 576px) {
  .nk-header > .container-fluid {
    padding-left: calc(var(--bs-gutter-x, 1.75rem) * 0.5 + 1rem);
  }
}

.is-theme .nk-menu {
  padding-top: 8px;
}

.is-theme .nk-menu .nk-menu-sub .active > .nk-menu-link {
  color: #fff;
  opacity: 1;
}

.is-theme .nk-nav .nk-nav-link.active {
  color: #fff;
}

/* Sidebar menu structure -- matches the CRM/Agent Portal's rounded, solid-block active/hover
   state. The base NioBoard CSS styles ".active > .nk-menu-link" (active on a parent <li>), but
   the NavLink here puts the "active" class on the link itself, so it never matched -- items
   rendered with no active indicator at all. */
.is-theme .nk-menu {
  padding-left: 12px;
  padding-right: 12px;
}

.is-theme .nk-menu-item {
  margin-bottom: 4px;
}

.is-theme .nk-menu-link {
  border-radius: 8px;
  padding: 0.625rem 1rem;
  font-family: var(--bs-font-sans-serif);
  font-size: 13.5px;
  font-weight: 600;
}

.is-theme .nk-menu-link::after {
  display: none;
}

.is-theme .nk-menu-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.is-theme .nk-menu-link.active {
  background-color: #A21D23;
  color: #fff;
  font-weight: 700;
}

.is-theme .nk-menu-link.active:hover {
  background-color: #7A1319;
}

.is-theme .nk-menu-link.active .icon {
  color: #fff;
}

/* MUI DataGrid (DataCard.tsx) -- brought in line with the same palette/type as the rest of the
   app rather than left on MUI's own defaults. Kept even after the DataTable rebuild in case any
   future page still reaches for the raw MUI component directly. */
.MuiDataGrid-root {
  font-family: var(--bs-font-sans-serif) !important;
  --unstable_DataGrid-radius: 10px;
}

.MuiDataGrid-columnHeaders {
  background-color: #F8FAFC !important;
}

.MuiDataGrid-columnHeaderTitle {
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8B99AA !important;
}

body.dark .MuiDataGrid-columnHeaders {
  background-color: var(--cc-surface2) !important;
}

body.dark .MuiDataGrid-root {
  background-color: var(--cc-surface);
  color: var(--cc-text);
  border-color: var(--cc-border) !important;
}

body.dark .MuiDataGrid-cell {
  border-bottom-color: var(--cc-border) !important;
  color: var(--cc-text);
}

body.dark .MuiDataGrid-row:hover {
  background-color: var(--cc-surface2) !important;
}

body.dark .MuiDataGrid-footerContainer,
body.dark .MuiDataGrid-toolbarContainer,
body.dark .MuiDataGrid-overlay {
  background-color: var(--cc-surface);
  border-color: var(--cc-border) !important;
  color: var(--cc-text);
}

body.dark .MuiDataGrid-columnSeparator {
  color: var(--cc-border) !important;
}

body.dark .MuiTablePagination-root,
body.dark .MuiDataGrid-selectedRowCount {
  color: var(--cc-text2) !important;
}

body.dark .MuiInputBase-root,
body.dark .MuiButtonBase-root {
  color: var(--cc-text) !important;
}

.nk-mega-nav {
  display: flex;
  align-items: stretch;
  height: 44px !important;
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.nk-mega-item {
  position: static;
  display: flex;
  align-items: stretch;
}

.nk-mega-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  height: 100%;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--nav-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease, border-color .15s ease;
}

.nk-mega-trigger:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
  text-decoration: none;
}

.nk-mega-trigger.active {
  color: #ffffff;
  border-bottom-color: #ffffff;
  text-decoration: none;
}

.cui-shell #nk-page-title-slot .page-title,
.cui-shell .page-title {
  color: #ffffff;
  font-family: var(--bs-font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  line-height: 1.15;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
