/* ISD Solutions — enterprise shell (sidebar / header / home)
   Extends Heroze chrome; does not replace layout JS class contracts. */

:root {
  --isd-shell-sidebar: #0b1220;
  --isd-shell-sidebar-elevated: #111827;
  --isd-shell-sidebar-border: rgba(148, 163, 184, 0.12);
  --isd-shell-sidebar-muted: #94a3b8;
  --isd-shell-sidebar-text: #e2e8f0;
  --isd-shell-sidebar-hover: rgba(255, 255, 255, 0.04);
  --isd-shell-accent: #dc2626;
  --isd-shell-accent-soft: rgba(220, 38, 38, 0.16);
  --isd-shell-header-h: var(--bs-app-header-height, 70px);
}

/* ——— Sidebar ——— */
.app-sidebar {
  background: linear-gradient(180deg, var(--isd-shell-sidebar) 0%, #0f172a 55%, #111827 100%) !important;
  border-inline-end: 1px solid var(--isd-shell-sidebar-border) !important;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.18);
  display: flex !important;
  flex-direction: column;
}

.app-sidebar-logo {
  border-bottom-color: var(--isd-shell-sidebar-border) !important;
  background: rgba(0, 0, 0, 0.18);
  padding-inline: 1.1rem !important;
  gap: 0.65rem;
  flex-shrink: 0;
}

.isd-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  width: 100%;
}

.isd-sidebar-brand__logo {
  max-height: 32px !important;
  width: auto;
  max-width: 148px;
}

.isd-sidebar-brand__text {
  min-width: 0;
  line-height: 1.15;
}

.isd-sidebar-brand__tag {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--isd-shell-sidebar-muted);
  white-space: nowrap;
}

.app-sidebar-menu .menu-title {
  color: #64748b !important;
  letter-spacing: 0.12em;
  font-size: 0.65rem !important;
  padding: 1.1rem 1.35rem 0.55rem !important;
}

.app-sidebar .side-menu__item {
  margin: 0.12rem 0.7rem;
  padding: 0.62rem 0.75rem !important;
  border-radius: 0.55rem;
  color: #e2e8f0 !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.app-sidebar .side-menu__item .side_menu_icon,
.app-sidebar .side-menu__item .side_menu_icon i {
  width: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8 !important;
  font-size: 1.05rem;
}

.app-sidebar .side-menu__item .side-menu__label {
  font-size: 0.84rem;
  font-weight: 500;
  color: #e2e8f0 !important;
}

.app-sidebar .side-menu__item .side-menu__angle {
  color: #94a3b8 !important;
  font-size: 1rem;
}

.app-sidebar .side-menu__item:hover {
  background: var(--isd-shell-sidebar-hover) !important;
  color: #ffffff !important;
}

.app-sidebar .side-menu__item:hover .side-menu__label {
  color: #ffffff !important;
}

.app-sidebar .side-menu__item:hover .side_menu_icon,
.app-sidebar .side-menu__item:hover .side_menu_icon i,
.app-sidebar .side-menu__item.active .side_menu_icon,
.app-sidebar .side-menu__item.active .side_menu_icon i,
.app-sidebar .side-menu__item.open-menu .side_menu_icon,
.app-sidebar .side-menu__item.open-menu .side_menu_icon i {
  color: #fecaca !important;
}

.app-sidebar .side-menu__item.active,
.app-sidebar .side-menu__item.open-menu {
  background: var(--isd-shell-accent-soft) !important;
  color: #ffffff !important;
  box-shadow: inset 3px 0 0 var(--isd-shell-accent);
}

.app-sidebar .side-menu__item.active .side-menu__label,
.app-sidebar .side-menu__item.open-menu .side-menu__label {
  color: #ffffff !important;
}

.app-sidebar .side-menu__item:hover::before,
.app-sidebar .slide-menu .side-menu__item::before {
  display: none !important;
}

.app-sidebar .slide-menu {
  background: rgba(0, 0, 0, 0.18);
  margin: 0.15rem 0.7rem 0.45rem;
  border-radius: 0.55rem;
  padding: 0.25rem 0 !important;
}

.app-sidebar .slide-menu::after {
  display: none !important;
}

.app-sidebar .slide-menu .side-menu__item {
  margin: 0.05rem 0.35rem;
  padding: 0.45rem 0.7rem 0.45rem 1rem !important;
  font-size: 0.8rem;
  color: #cbd5e1 !important;
}

.app-sidebar .slide-menu .side-menu__item .side-menu__label,
.app-sidebar .slide-menu .side-menu__item {
  color: #cbd5e1 !important;
}

.app-sidebar .slide-menu .side-menu__item.active,
.app-sidebar .slide-menu .side-menu__item:hover {
  background: rgba(220, 38, 38, 0.14) !important;
  color: #ffffff !important;
  box-shadow: none;
}

.app-sidebar .slide-menu .side-menu__item.active .side-menu__label,
.app-sidebar .slide-menu .side-menu__item:hover .side-menu__label {
  color: #ffffff !important;
}

.isd-sidebar-foot {
  position: relative;
  flex-shrink: 0;
  z-index: 5;
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--isd-shell-sidebar-border);
  background: rgba(0, 0, 0, 0.28);
}

.isd-sidebar-foot__meta {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.isd-sidebar-foot__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #f8fafc !important;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(248, 250, 252, 0.35);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.isd-sidebar-foot__link i {
  font-size: 0.85rem;
  color: #fca5a5;
}

.isd-sidebar-foot__link:hover,
.isd-sidebar-foot__link:focus {
  color: #fecaca !important;
  border-bottom-color: #fecaca;
}

.app-sidebar-menu {
  position: relative !important;
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  overflow-y: auto;
  padding-bottom: 0.5rem;
  padding-top: 0.35rem;
}

.small-screen-sidebar .offcanvas-header {
  background: var(--isd-shell-sidebar);
  border-bottom-color: var(--isd-shell-sidebar-border) !important;
}

.small-screen-sidebar .btn-close {
  color: #e2e8f0;
  opacity: 0.85;
}

/* ——— Header / Navbar ——— */
.app-header {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #e8edf5 !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04) !important;
}

.isd-header-brand {
  display: none;
  align-items: baseline;
  gap: 0.45rem;
  line-height: 1.1;
}

@media (min-width: 992px) {
  .isd-header-brand {
    display: flex;
  }
}

.isd-header-brand__name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.isd-header-brand__sep {
  color: #cbd5e1;
  font-weight: 300;
}

.isd-header-brand__module {
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
}

.isd-header-chip {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
}

@media (min-width: 768px) {
  .isd-header-chip {
    display: inline-flex;
  }
}

.isd-header-chip i {
  color: var(--isd-shell-accent);
  font-size: 0.9rem;
}

.isd-header-user {
  display: inline-flex !important;
  align-items: center;
  gap: 0.65rem;
  padding: 0.28rem 0.55rem 0.28rem 0.28rem !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  border-radius: 999px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.isd-header-user:hover,
.isd-header-user:focus,
.isd-header-user.show {
  border-color: #fecaca !important;
  background: #fff !important;
}

.isd-header-user .avatar-item {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #dc2626, #b91c1c) !important;
  font-size: 0.78rem;
  font-weight: 700;
}

.isd-header-user__meta {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
  min-width: 0;
}

@media (min-width: 768px) {
  .isd-header-user__meta {
    display: flex;
  }
}

.isd-header-user__name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f172a;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.isd-header-user__role {
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 500;
}

.isd-header-dropdown {
  min-width: 240px;
  padding: 0.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.isd-header-dropdown .dropdown-header {
  font-size: 0.72rem;
  color: #64748b;
  white-space: normal;
  word-break: break-all;
}

.isd-header-dropdown .dropdown-item {
  border-radius: 0.45rem;
  font-size: 0.84rem;
  padding: 0.5rem 0.7rem;
}

.isd-header-dropdown .dropdown-item i {
  color: #64748b;
}

.app-header .btn.sidebar-toggle,
.app-header .btn.small-screen-toggle {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 0.55rem;
}

.app-header .btn.sidebar-toggle:hover,
.app-header .btn.small-screen-toggle:hover {
  border-color: #fecaca;
  color: var(--isd-shell-accent);
}

/* ——— Home workspace ——— */
.isd-home {
  max-width: 1100px;
  margin: 0 auto;
}

.isd-home__hero {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  padding: 1.75rem 1.75rem 1.6rem;
  background:
    radial-gradient(1200px 280px at 10% -20%, rgba(220, 38, 38, 0.22), transparent 55%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #0f172a 100%);
  color: #f8fafc;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.isd-home__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fca5a5;
  margin-bottom: 0.65rem;
}

.isd-home__title {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
  color: #fff;
}

.isd-home__lead {
  margin: 0;
  max-width: 42rem;
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.55;
}

.isd-home__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

.isd-home__meta strong {
  color: #e2e8f0;
  font-weight: 600;
}

.isd-home__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.isd-home-card {
  grid-column: span 12;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
}

@media (min-width: 768px) {
  .isd-home-card {
    grid-column: span 6;
  }
}

@media (min-width: 1200px) {
  .isd-home-card.isd-home-card--wide {
    grid-column: span 6;
  }
}

.isd-home-card:hover {
  transform: translateY(-2px);
  border-color: #fecaca;
  box-shadow: 0 14px 32px rgba(220, 38, 38, 0.1);
  color: inherit;
}

.isd-home-card__body {
  padding: 1.2rem 1.25rem 1.1rem;
  flex: 1;
}

.isd-home-card__icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fef2f2;
  color: #dc2626;
  font-size: 1.2rem;
  margin-bottom: 0.85rem;
}

.isd-home-card__title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.35rem;
}

.isd-home-card__desc {
  margin: 0;
  font-size: 0.86rem;
  color: #64748b;
  line-height: 1.5;
}

.isd-home-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
  font-size: 0.78rem;
  font-weight: 600;
  color: #dc2626;
}

.isd-home-card__foot i {
  transition: transform 0.15s ease;
}

.isd-home-card:hover .isd-home-card__foot i {
  transform: translateX(3px);
}

.isd-home-empty {
  grid-column: span 12;
  border: 1px dashed #cbd5e1;
  border-radius: 0.9rem;
  padding: 1.5rem;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.9rem;
}

.isd-header-user.dropdown-toggle::after {
  margin-left: 0.15rem;
  color: #94a3b8;
}

/* Minimized sidebar: hide brand text / foot label gracefully */
:root[data-main-layout=small-icon] .isd-sidebar-brand__text,
:root[data-toggled=close] .isd-sidebar-brand__text,
:root[data-toggled=close] .isd-sidebar-foot__meta,
:root[data-toggled=close] .isd-sidebar-foot__link span {
  display: none;
}

:root[data-toggled=close] .isd-sidebar-foot {
  padding: 0.65rem;
  text-align: center;
}

:root[data-toggled=close] .app-sidebar-menu {
  height: auto !important;
}

/* Admin dashboard stat cards */
.isd-admin-stat .card-body {
  padding: 1.15rem 1.2rem;
}

.isd-admin-stat__icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fef2f2;
  color: #dc2626;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.isd-admin-stat__label {
  letter-spacing: 0.04em;
  font-size: 0.68rem !important;
  font-weight: 600;
}

.isd-admin-stat__value {
  font-size: 1.85rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.15;
  margin: 0.15rem 0 0.35rem;
}

.isd-admin-stat__link {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #dc2626;
  text-decoration: none;
}

.isd-admin-stat__link:hover {
  color: #b91c1c;
}
