:root {
  --kb-blue: #006FFF;       /* UCRM active/accent blue */
  --kb-blue-fill: #00A0DF;  /* UCRM primary button fill */
  --kb-border: #EFEFF0;
  --kb-text: #1a1a1a;
  --kb-muted: #6b7280;
  --kb-sidenav-width: 60px;
  --kb-topbar-height: 56px;
}

body {
  font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: #f6f7f9;
  color: var(--kb-text);
}

a {
  color: var(--kb-blue);
}

/* ---- App shell: icon sidebar + top bar, matching UCRM's layout ---- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidenav {
  width: var(--kb-sidenav-width);
  flex: 0 0 var(--kb-sidenav-width);
  background: #fff;
  border-right: 1px solid var(--kb-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  position: sticky;
  top: 0;
  min-height: 100vh;
  z-index: 1030;
  /* deliberately no overflow:auto here - Bootstrap's dropend flyouts are
     positioned relative to this container, so overflow would clip them.
     Explicit z-index (matching Bootstrap's own navbar convention) keeps
     the sidenav's own stacking context above .app-main's cards, which
     are position:relative and would otherwise paint over the flyouts. */
}

.app-sidenav__brand {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  text-decoration: none;
  flex-shrink: 0;
}

.app-sidenav__brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-sidenav__list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.app-sidenav__list li {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
  position: relative;
}

.app-sidenav__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #5a6472;
  font-size: 1.15rem;
  text-decoration: none;
}

.app-sidenav__icon:hover,
.app-sidenav__icon.active {
  background: rgba(0, 111, 255, 0.1);
  color: var(--kb-blue);
}

.app-sidenav__icon.dropdown-toggle::after {
  display: none;
}

.app-flyout {
  border: 1px solid var(--kb-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
  border-radius: 6px;
  font-size: .9rem;
}

.app-flyout .dropdown-item {
  padding: .5rem 1rem;
}

.app-flyout .dropdown-item:hover {
  background: rgba(0, 111, 255, 0.08);
  color: var(--kb-blue);
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  height: var(--kb-topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--kb-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-topbar__title {
  font-weight: 700;
  color: var(--kb-text);
}

.app-topbar__user {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .9rem;
  color: var(--kb-muted);
  background: none;
  border: none;
}

.app-topbar__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--kb-blue);
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.app-content {
  padding: 24px;
  flex: 1;
}

/* ---- Bootstrap component overrides to match UCRM's look ---- */

.btn-primary {
  background-color: var(--kb-blue-fill) !important;
  border-color: var(--kb-blue-fill) !important;
  font-weight: 700;
  border-radius: 4px;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #008fc9 !important;
  border-color: #008fc9 !important;
}

.btn {
  border-radius: 4px;
}

.card {
  margin-bottom: 1rem;
  border: 1px solid var(--kb-border);
  border-radius: 6px;
  box-shadow: none;
}

.card-header {
  background: #fff;
  border-bottom: 1px solid var(--kb-border);
  font-weight: 700;
}

table td, table th {
  vertical-align: middle;
}

table thead th {
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .03em;
  color: var(--kb-muted) !important;
  font-weight: 700;
  border-bottom: 1px solid var(--kb-border) !important;
  background: #fff !important;
}

table td {
  border-bottom: 1px solid var(--kb-border) !important;
  font-size: .9rem;
}

.nav-tabs .nav-link.active {
  color: var(--kb-blue);
  border-bottom: 2px solid var(--kb-blue);
  border-top: none;
  border-left: none;
  border-right: none;
  font-weight: 700;
}

.badge-low-stock {
  background-color: #dc3545;
}
