/* ============================================================
   Janox — Custom Styles
   ============================================================ */

:root {
  --bs-primary: #1B3A5C;
  --bs-primary-rgb: 27, 58, 92;
  --bs-body-bg: #F4F6F8;
  --bs-body-color: #212529;
  --bs-link-color: #2E5984;
  --bs-link-hover-color: #1B3A5C;
  --bs-border-color: #DEE2E6;

  --jnx-sidebar-bg: #0F2A43;
  --jnx-sidebar-width: 250px;
  --jnx-text-secondary: #5C6B7A;
  --jnx-bg-soft: #DCE6F0;
  --jnx-success: #0E7C66;
  --jnx-warning: #B4530A;
  --jnx-danger: #B3261E;
  --jnx-info: #2E5984;
}

/* --- Global ------------------------------------------------------- */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* --- Sidebar ------------------------------------------------------ */
.jnx-sidebar {
  width: var(--jnx-sidebar-width);
  background-color: var(--jnx-sidebar-bg);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  transition: transform 0.3s ease;
}

.jnx-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.7);
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  border-radius: 0.375rem;
  margin: 0.1rem 0.75rem;
}

.jnx-sidebar .nav-link:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.jnx-sidebar .nav-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.15);
}

.jnx-sidebar .nav-link .bi {
  width: 1.25rem;
  margin-right: 0.5rem;
  text-align: center;
}

.jnx-sidebar-brand {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1.25rem 1.25rem 1rem;
}

.jnx-sidebar-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
  padding: 1rem 1.25rem 0.35rem;
}

/* --- Sidebar submenu (2nd level) ---------------------------------- */
.jnx-submenu {
  padding-left: 0.5rem;
}

.jnx-submenu .nav-link {
  font-size: 0.85rem;
  padding: 0.4rem 1.25rem 0.4rem 2.25rem;
  color: rgba(255, 255, 255, 0.6);
}

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

.jnx-submenu .nav-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.12);
}

/* Chevron rotation on collapse toggle */
.jnx-chevron {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.nav-link[aria-expanded="true"] .jnx-chevron {
  transform: rotate(180deg);
}

/* --- Main content area -------------------------------------------- */
.jnx-main {
  margin-left: var(--jnx-sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Topbar ------------------------------------------------------- */
.jnx-topbar {
  background-color: #fff;
  border-bottom: 1px solid var(--bs-border-color);
  padding: 0.65rem 1.5rem;
}

.jnx-topbar .jnx-user-info {
  font-size: 0.875rem;
  color: var(--jnx-text-secondary);
}

.jnx-topbar .jnx-user-name {
  font-weight: 600;
  color: var(--bs-body-color);
}

/* --- Page content ------------------------------------------------- */
.jnx-content {
  flex: 1;
  padding: 1.5rem;
}

/* --- Footer ------------------------------------------------------- */
.jnx-footer {
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  color: var(--jnx-text-secondary);
  border-top: 1px solid var(--bs-border-color);
  background-color: #fff;
}

/* --- Cards -------------------------------------------------------- */
.card {
  border: 1px solid var(--bs-border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* --- Buttons with Janox palette ----------------------------------- */
.btn-primary {
  --bs-btn-bg: #1B3A5C;
  --bs-btn-border-color: #1B3A5C;
  --bs-btn-hover-bg: #2E5984;
  --bs-btn-hover-border-color: #2E5984;
  --bs-btn-active-bg: #163250;
  --bs-btn-active-border-color: #163250;
}

.btn-success {
  --bs-btn-bg: #0E7C66;
  --bs-btn-border-color: #0E7C66;
  --bs-btn-hover-bg: #0a6654;
  --bs-btn-hover-border-color: #0a6654;
}

.btn-danger {
  --bs-btn-bg: #B3261E;
  --bs-btn-border-color: #B3261E;
  --bs-btn-hover-bg: #962018;
  --bs-btn-hover-border-color: #962018;
}

.btn-warning {
  --bs-btn-bg: #B4530A;
  --bs-btn-border-color: #B4530A;
  --bs-btn-hover-bg: #964508;
  --bs-btn-hover-border-color: #964508;
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
}

.btn-info {
  --bs-btn-bg: #2E5984;
  --bs-btn-border-color: #2E5984;
  --bs-btn-hover-bg: #1B3A5C;
  --bs-btn-hover-border-color: #1B3A5C;
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
}

/* --- Auth layout -------------------------------------------------- */
.jnx-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bs-body-bg);
}

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

.jnx-auth-brand {
  color: var(--bs-primary);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: 0.5px;
}

/* --- Alerts ------------------------------------------------------- */
.jnx-alert-container {
  margin-bottom: 1rem;
}

/* --- Offcanvas sidebar (mobile) ----------------------------------- */
@media (max-width: 991.98px) {
  .jnx-sidebar {
    position: fixed;
    transform: translateX(-100%);
  }

  .jnx-sidebar.show {
    transform: translateX(0);
  }

  .jnx-main {
    margin-left: 0;
  }
}
