:root {
  --aiz-primary: #0b3d5c;
  --aiz-primary-2: #0f5a86;
  --aiz-accent: #1f9d8a;
  --aiz-bg: #f4f7fb;
  --aiz-sidebar: #0b1f2e;
  --aiz-sidebar-text: #c9d6e2;
  --aiz-sidebar-active: #ffffff;
  --aiz-border: #e4eaf1;
  --aiz-radius: 0.75rem;
}

* {
  box-sizing: border-box;
}

body.app-body {
  background: var(--aiz-bg);
  color: #1a2430;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Sidebar */
.app-sidebar {
  width: 260px;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--aiz-sidebar) 0%, #102a3d 100%);
  color: var(--aiz-sidebar-text);
  position: sticky;
  top: 0;
  flex-shrink: 0;
}

@media (max-width: 991.98px) {
  .app-shell > .app-sidebar {
    display: none;
  }
  .offcanvas .app-sidebar {
    display: block;
    width: 100%;
    min-height: auto;
    border: 0 !important;
  }
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--aiz-primary-2), var(--aiz-accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.brand-title {
  color: #fff;
  font-weight: 600;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.72rem;
  color: #8ea3b5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6f879b;
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem;
  color: var(--aiz-sidebar-text);
  text-decoration: none;
  font-size: 0.92rem;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link i {
  font-size: 1.05rem;
  width: 1.25rem;
  text-align: center;
}

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

.sidebar-link.active {
  color: var(--aiz-sidebar-active);
  background: rgba(31, 157, 138, 0.18);
  border-left-color: var(--aiz-accent);
  font-weight: 600;
}

.sidebar-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Topbar / content */
.app-topbar {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
}

.topbar-sub {
  font-size: 0.75rem;
}

.app-content {
  max-width: 1400px;
}

.app-footer {
  background: transparent;
}

/* Cards */
.card {
  border-color: var(--aiz-border);
  border-radius: var(--aiz-radius);
  box-shadow: 0 1px 2px rgba(16, 42, 61, 0.04);
}

.stat-card .stat-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.55rem;
  background: rgba(11, 61, 92, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.btn-primary {
  background-color: var(--aiz-primary);
  border-color: var(--aiz-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--aiz-primary-2);
  border-color: var(--aiz-primary-2);
}

/* Login */
.login-page {
  background:
    radial-gradient(circle at top right, rgba(31, 157, 138, 0.18), transparent 40%),
    radial-gradient(circle at bottom left, rgba(15, 90, 134, 0.2), transparent 45%),
    var(--aiz-bg);
}

.login-card {
  max-width: 420px;
  border-radius: 1rem;
}

/* Detail definition lists */
.detail-dl dt {
  font-weight: 500;
  color: #5b6b7c;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}
.detail-dl dd {
  margin-bottom: 0.35rem;
  font-size: 0.925rem;
}

/* Activity timeline */
.timeline-item {
  position: relative;
  padding: 0 0 1rem 1rem;
  border-left: 2px solid var(--aiz-border);
  margin-left: 0.35rem;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -0.4rem;
  top: 0.25rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--aiz-accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--aiz-border);
}
.timeline-meta {
  margin-bottom: 0.25rem;
}

/* Pipeline board */
.pipeline-board {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  align-items: flex-start;
}
.pipeline-column {
  min-width: 220px;
  max-width: 240px;
  flex: 0 0 220px;
  background: #eef2f6;
  border-radius: var(--aiz-radius);
  border: 1px solid var(--aiz-border);
}
.pipeline-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--aiz-border);
  background: #fff;
  border-radius: var(--aiz-radius) var(--aiz-radius) 0 0;
  font-size: 0.85rem;
}
.pipeline-column-body {
  padding: 0.5rem;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}
.pipeline-card {
  border-color: var(--aiz-border);
  box-shadow: none;
}
.pipeline-card .card-body {
  font-size: 0.85rem;
}

.table-danger-subtle {
  --bs-table-bg: #fff5f5;
}
