:root {
  --digams-navy: #062f4f;
  --digams-navy-dark: #052741;
  --digams-orange: #f28c1b;
  --digams-orange-dark: #d87508;
  --primary-dark: #032b44;
  --primary-light: #0b4e72;
  --secondary: #ff8c00;
  --accent: #6c00ff;
  --light: #f8f9fa;
  --gray: #6c757d;
  --light-gray: #e9ecef;
  --border-radius: 12px;
  --box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

.app-header.navbar {
  background: var(--digams-navy);
  border-bottom: 0;
  min-height: 84px;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.digams-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.3px;
}

.digams-brand img {
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  object-fit: cover;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.app-header .nav-link {
  color: #fff;
  font-weight: 600;
}

.app-header .nav-link:hover,
.app-header .nav-link:focus {
  color: #ffd8a6;
}

/* Keep breadcrumbs, hide duplicate page heading */
.app-content-header {
  display: block;
}

.app-content-header h3 {
  display: none;
}

.app-content-header .row {
  justify-content: center;
}

.app-content-header .row .col-sm-6:last-child {
  text-align: center;
}

/* Breadcrumb styling */
.app-content-header .breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(6, 47, 79, 0.08);
  font-size: 0.85rem;
  color: #062f4f;
}

.app-content-header .breadcrumb a {
  color: #062f4f;
  text-decoration: none;
  font-weight: 600;
}

.app-content-header .breadcrumb a:hover {
  color: var(--digams-orange);
}

.app-content-header .breadcrumb i {
  color: #9aa7b4;
  font-size: 0.75rem;
}

.card-header {
  justify-content: center;
  text-align: center;
}

.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5 {
  margin: 0;
}

/* Center standalone page titles */
.page-title {
  text-align: center;
}

/* Navy form header */
.card-header {
  background: linear-gradient(135deg, var(--digams-navy), var(--digams-navy-dark));
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.card-header i {
  color: #ffd8a6;
}

.btn-primary {
  --bs-btn-bg: var(--digams-orange);
  --bs-btn-border-color: var(--digams-orange);
  --bs-btn-hover-bg: var(--digams-orange-dark);
  --bs-btn-hover-border-color: var(--digams-orange-dark);
  --bs-btn-active-bg: var(--digams-orange-dark);
  --bs-btn-active-border-color: var(--digams-orange-dark);
}

/* Keep all positive action buttons orange for consistency. */
.btn-warning,
.btn-info,
.btn-success {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--digams-orange);
  --bs-btn-border-color: var(--digams-orange);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--digams-orange-dark);
  --bs-btn-hover-border-color: var(--digams-orange-dark);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--digams-orange-dark);
  --bs-btn-active-border-color: var(--digams-orange-dark);
}

/* Cancel buttons remain gray. */
.btn-secondary {
  --bs-btn-bg: #6c757d;
  --bs-btn-border-color: #6c757d;
  --bs-btn-hover-bg: #5a6268;
  --bs-btn-hover-border-color: #5a6268;
  --bs-btn-active-bg: #545b62;
  --bs-btn-active-border-color: #545b62;
}

/* Delete/remove buttons remain red. */
.btn-danger {
  --bs-btn-bg: #dc3545;
  --bs-btn-border-color: #dc3545;
  --bs-btn-hover-bg: #bb2d3b;
  --bs-btn-hover-border-color: #b02a37;
  --bs-btn-active-bg: #b02a37;
  --bs-btn-active-border-color: #a52834;
}

.btn-outline-primary {
  --bs-btn-color: var(--digams-orange);
  --bs-btn-border-color: var(--digams-orange);
  --bs-btn-hover-bg: var(--digams-orange);
  --bs-btn-hover-border-color: var(--digams-orange);
  --bs-btn-active-bg: var(--digams-orange-dark);
  --bs-btn-active-border-color: var(--digams-orange-dark);
}

.sidebar-popup {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: none;
}

.sidebar-popup.is-open {
  display: block;
}

.sidebar-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 43, 68, 0.5);
  backdrop-filter: blur(2px);
}

.sidebar-popup__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1100px, 94vw);
  height: min(900px, calc(100vh - 6rem));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(3, 43, 68, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--digams-navy);
  color: #fff;
}

.sidebar-popup__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.sidebar-popup__close {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.sidebar-popup__close:hover,
.sidebar-popup__close:focus {
  background: rgba(255, 255, 255, 0.3);
}

.sidebar-popup__frame {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: #fff;
}

body.sidebar-popup-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .sidebar-popup__panel {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

/* AdminLTE sidebar theme (navy) */
.app-sidebar {
  --lte-sidebar-bg: var(--digams-navy);
  --lte-sidebar-color: #dfe9f3;
  --lte-sidebar-hover-color: #ffffff;
  --lte-sidebar-hover-bg: rgba(255, 255, 255, 0.08);
  --lte-sidebar-active-color: #ffffff;
  --lte-sidebar-menu-active-bg: rgba(255, 255, 255, 0.12);
  --lte-sidebar-submenu-bg: rgba(0, 0, 0, 0.12);
  --lte-sidebar-submenu-color: #c7d4e2;
  --lte-sidebar-submenu-hover-color: #ffffff;
  --lte-sidebar-submenu-hover-bg: rgba(255, 255, 255, 0.1);
  --lte-sidebar-submenu-active-color: #ffffff;
  --lte-sidebar-submenu-active-bg: rgba(255, 255, 255, 0.12);
}

.app-sidebar,
.app-sidebar.bg-body-secondary,
.app-sidebar .sidebar-wrapper {
  background-color: var(--digams-navy) !important;
}

.app-sidebar .sidebar-brand {
  background: var(--digams-navy-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar .brand-text,
.app-sidebar .nav-link,
.app-sidebar .nav-link .nav-icon,
.app-sidebar .nav-link p {
  color: var(--lte-sidebar-color);
}

.app-sidebar .nav-link:hover,
.app-sidebar .nav-link:focus {
  color: var(--lte-sidebar-hover-color);
  background: var(--lte-sidebar-hover-bg);
}

.app-sidebar .nav-link.active,
.app-sidebar .nav-link.active:hover {
  color: var(--lte-sidebar-active-color);
  background: var(--lte-sidebar-menu-active-bg);
}

.app-sidebar .sidebar-wrapper {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 84px);
}

.app-sidebar .sidebar-main-nav {
  flex: 1 1 auto;
}

.sidebar-profile {
  margin-top: auto;
  padding: 0.8rem 0.7rem 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-profile__identity {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-radius: 12px;
  padding: 0.55rem;
}

.sidebar-profile__identity:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-profile__avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  background: linear-gradient(
    135deg,
    var(--digams-orange),
    var(--digams-orange-dark)
  );
  color: #fff;
  font-weight: 700;
}

.sidebar-profile__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-profile__meta {
  min-width: 0;
}

.sidebar-profile__name {
  display: block;
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.2;
}

.sidebar-profile__email {
  display: block;
  color: #d0deea;
  font-size: 0.8rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile__links {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
}

.sidebar-profile__link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #dfe9f3;
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
}

.sidebar-profile__link i {
  color: #c7d4e2;
}

.sidebar-profile__link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-profile__link:hover i {
  color: #ffffff;
}

.sidebar-profile__link--signout,
.sidebar-profile__link--signout i {
  color: #ff9ca4;
}

.sidebar-profile__link--signout:hover {
  background: rgba(255, 156, 164, 0.14);
  color: #ffd3d7;
}

.sidebar-profile__link--signout:hover i {
  color: #ffd3d7;
}
