/* ======================================================================
   Imports
====================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

/* ======================================================================
   CSS Custom Properties (Theme Tokens)
   - Adjust these to restyle the app globally
====================================================================== */
:root {
  /* Layout widths */
  --sidebar-width: 212px;
  --rightbar-width: 280px;

  /* Colors */
  --color-text: #222;
  --color-text-muted: rgba(28, 28, 28, 0.4);
  --color-bg-body: #fdfcfa;
  --color-bg-card: #f7f9fb;
  --color-bg-card-alt: #f9fafc;
  --color-bg-chip: #e3f5ff;
  --color-bg-summary: #e8f4fe;
  --color-bg-input: rgba(28, 28, 28, 0.05); /* ~#1c1c1c0d */
  --color-bg-btn: #fafafa;
  --color-bg-btn-hover: #dcdcdc;
  --color-bg-btn-active: #c0c0c0;
  --color-bg-btn-dark: #1b1b1b;

  /* Shadows */
  --shadow-panel: rgba(0, 0, 0, 0.12) 0px 1px 3px,
    rgba(0, 0, 0, 0.24) 0px 1px 2px;
  --shadow-card: rgba(0, 0, 0, 0.24) 0px 3px 8px;
  --shadow-summary: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px;
  --shadow-chart: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px;
  --shadow-nav-active: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px,
    rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
  --shadow-avatar: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px,
    rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;

  /* Radii */
  --radius-card: 16px;
  --radius-form: 25px;
  --radius-pill: 14px;
  --radius-chip: 50%;

  /* Timings */
  --trans-fast: 0.15s ease-in;
  --trans-med: 0.3s ease-in-out;
}

/* ======================================================================
   Global Defaults
====================================================================== */
body {
  font-family: "Inter", sans-serif !important;
  font-size: 14px;
  color: var(--color-text);
  background-color: var(--color-bg-body);
}

.vh-100 {
  height: 100vh;
}

/* Utilities */
.mr-5px {
  margin-right: 5px;
}

/* ======================================================================
   AG Grid
====================================================================== */
.ag-grid {
  height: 100% !important;
  width: 100%;

}
.ag-grid-collapse {
  height: 22em !important;
  width: 100%;

}
.failed-cell {
  color: red !important;
  font-weight: bold;
}
.closed-cell {
  color: green !important;
  font-weight: bold;
}

/* ======================================================================
   Topbar / Sidebar / Rightbar Shell
====================================================================== */
.sidebar,
.topbar,
.rightbar {
  position: fixed;
  z-index: 301; /* or higher than 300 */
}

.sidebar::before,
.topbar::before,
.rightbar::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  box-shadow: var(--shadow-panel);
}

/* Sidebar (hidden by default) */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0; /* top/right/bottom/left */
  width: var(--sidebar-width);
  padding: 10px;
  font-size: 23px;
  transform: translateX(calc(-1 * var(--sidebar-width)));
  transition: all var(--trans-med);
  z-index: 201;
}
.sidebar.active {
  transform: translateX(0);
}

/* Rightbar (hidden by default) */
.rightbar {
  position: fixed;
  inset: 0 0 0 auto;
  width: var(--rightbar-width);
  padding: 10px;
  font-size: 23px;
  transform: translateX(var(--rightbar-width));
  transition: all var(--trans-med);
  z-index: 204;
}
.rightbar.active {
  transform: translateX(0);
}

/* Topbar base */
.topbar {
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  justify-content: space-between;
  background-color: #fdfcfa;
  transition: all var(--trans-med);
}

/* Content page + topbar shifting logic */
.content-page,
.topbar {
  margin-left: 0;
  margin-right: 0;
  left: 0;
  width: 100%;
  transition: all var(--trans-med);
}
.content-page {
  margin-top: 50px;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch; /* makes children fill width */
}
/* Sidebar open */
.content-page.active {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
}
.topbar.active {
  left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
}

/* Rightbar open */
.content-page.rightbar-active {
  margin-right: var(--rightbar-width);
  width: calc(100% - var(--rightbar-width));
}
.topbar.rightbar-active {
  left: 0;
  width: calc(100% - var(--rightbar-width));
}

/* Both open */
.content-page.active.rightbar-active {
  margin-left: var(--sidebar-width);
  margin-right: var(--rightbar-width);
  width: calc(100% - var(--sidebar-width) - var(--rightbar-width));
}
.topbar.active.rightbar-active {
  left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width) - var(--rightbar-width));
}

/* ======================================================================
   Navigation
====================================================================== */
.nav-link {
  color: black;
}

.nav-link.active {
  border-left: 4px solid black;
  background-color: #f4f4f4;
  color: black;
  font-weight: 500;
  margin-left: 1rem;
  box-shadow: var(--shadow-nav-active);
}

.navlink {
  margin-bottom: 5px;
  transition: all var(--trans-fast);
}

.nav-pills .nav-link {
  border-radius: var(--radius-pill);
}
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  color: black;
  background-color: var(--color-bg-input);
}

.sidelabel {
  margin: 5px 15px;
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-muted);
}

/* ======================================================================
   Notifications / Timeline Item (Reusable)
====================================================================== */
.alert-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 350px;
  z-index: 2000; /* floats above everything */
  box-shadow: 0px 4px 12px rgba(0,0,0,0.2);
  border-radius: 0.5rem;
}

.notif-button {
  --bs-btn-bg: var(--color-bg-btn);
  --bs-btn-hover-bg: var(--color-bg-btn-hover);
  --bs-btn-active-bg: var(--color-bg-btn-active);
  --bs-btn-border-color: unset !important;
  --bs-btn-hover-color: unset;
  --bs-btn-active-color: unset;
  --bs-btn-active-border-color: unset;

  height: 100%;
  width: 92%;
  color: var(--color-text);
  background-color: var(--color-bg-body);
  font-family: "Inter", sans-serif;
  font-weight: 500;

  display: flex;
  align-items: center;
  justify-content: flex-start !important;
  gap: 4px !important;
  padding-top: 4px;
  margin-top: 5px;
}

.icon-bg {
  background-color: var(--color-bg-chip);
  font-size: large;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-chip);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
  margin-top: 9px; /* adjust if vertical alignment off */
}
.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}
.subnotif {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.notif-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* ======================================================================
    Timeline
====================================================================== */
.timeline-wrapper {
  position: relative;
  margin-left: 15px;
  padding-left: 5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-left: 2px solid #e0e0e0;
}
.timeline-item {
  position: relative;
  max-width: 300px;
  width: 250px;
  height: 70px;
}

/* ======================================================================
    Form & Inputs
====================================================================== */
.form-container {
  display: flex;
  flex-direction: column;
  min-width: 430px;
  min-height: 375px;
  background-color: var(--color-bg-card);
  padding: 20px 40px;
  border-radius: var(--radius-form);
  box-shadow: var(--shadow-card);
  align-items: center;
}

.error-message {
  font-size: 18px;
  font-weight: 500;
  margin-top: 15px;
}
.date-picker {
  /* right: 25%; */
}
.dbc input:not([type="radio"]):not([type="checkbox"]) {
  background-color: unset !important;
}
@media (max-width: 768px) {
  .form-container {
    padding: 20px;
    box-shadow: none;
    border-radius: 10px;
  }
}

html body .dbc input:not([type="radio"]):not([type="checkbox"]) {
  background-color: unset !important;
}

.input-field {
  background-color: var(--color-bg-input);
  width: 350px;
  height: 50px;
  margin: 10px auto 20px auto;
}

input.form-control::placeholder {
  color: #999 !important;
  background-color: transparent !important;
  opacity: 1;
}

.button-wrapper {
  width: 350px;
  height: 50px;
  display: grid;
  place-items: center;
  margin: 48px auto 0 auto;
  background-color: var(--color-bg-btn-dark);
  --bs-btn-hover-color: unset;
  --bs-btn-hover-bg: unset;
  --bs-btn-hover-border-color: unset;
  --bs-btn-active-color: unset;
  --bs-btn-active-border-color: unset;
  --bs-btn-active-bg: var(--color-bg-btn-active);
}

/* ======================================================================
   Home Page Sections
====================================================================== */
.home-content {
  padding: 15px;
  width: 99%;
}
.custom-dropdown .dropdown-toggle {
  position: relative;
  margin-bottom: 10px;
  background-color: var(--color-bg-body);
  --bs-btn-active-bg: var(--color-bg-btn-active);
  --bs-btn-active-color: black;
  --bs-btn-border-color: unset;
  color: black;
  font-weight: 600;
  padding: 6px 12px;
  transition: background-color 0.3s ease;
}

.custom-dropdown .dropdown-toggle:hover {
  background-color: var(--color-bg-btn-hover);
}

.custom-dropdown .dropdown-menu {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.summary-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  justify-content: space-evenly; /* optional: use center to balance spacing */
  align-items: stretch;
}
.chart-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 1.5rem;
  justify-content: space-between;
}
.annotation-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem; /* spacing between items */
  min-width: 150px; /* keep readable width */
}

.annotation-item {
  font-size: 14px;
  line-height: 1.4;
}

.summary-card {
  background-color: var(--color-bg-summary);
  padding: 20px;
  border-radius: var(--radius-card);
  text-align: center;
  font-size: 16px;
  box-shadow: var(--shadow-summary);
  height: 125px;
  flex: 1 1 160px;
  /* max-width: 180px;*/
}
.sales-card {
  height: 140px;
  padding: 8px 20px;
}
.sum-title {
  font-size: clamp(12px, 1.5vw, 15px);
  font-weight: 600;
  color: var(--color-text);
  margin-top: 8px;
  margin-bottom: 4px;
  white-space: nowrap;
  text-align: left;
}

.sum-content {
  font-size: 24px;
  font-weight: 700;
  margin-top: 10px;
  color: var(--color-text);
  text-align: left;
}
.sum-button {
  position: relative;
  left: 42%;
  bottom: 16%;
}
.collapse-card {
  border-radius: 8px;
  border-width: 1px;
  border-color: rgba(0, 0, 0, 0.175);
  border-style: solid;
  padding: 10px 15px;
  min-height: 35vh;
}
.collapse-title {
  font-size: x-large;
  font-family: "Inter";
  font-weight: 700;
  margin-left: 6px;
}
.badge-container {
  display: flex;
  flex-wrap: wrap; /* allow wrapping to next line */
  gap: 0.3rem; /* spacing between badges */
  max-height: 22em; /* optional: cap height */
  overflow-y: auto; /* scroll if too many */
  padding: 5px;
  background: #f9fafc;
  border-radius: 10px;
}
.chart-title-pie {
  position: relative;
  font-size: clamp(13px, 1.5vw, 16px);
  font-weight: 600;
  color: var(--color-text);
  margin-top: 0px;
  margin-bottom: 15px;
  white-space: nowrap;
  text-align: left;
  z-index: 10;
}
.chart-title-bar {
  position: relative;
  font-size: clamp(13px, 1.5vw, 16px);
  font-weight: 600;
  color: var(--color-text);
  margin-top: 0px;
  margin-bottom: 0px;
  white-space: nowrap;
  text-align: left;
  z-index: 10;
}
.chart-title-vbar {
  position: relative;
  font-size: clamp(13px, 1.5vw, 16px);
  font-weight: 600;
  color: var(--color-text);
  margin-top: 0px;
  margin-bottom: 0px;
  white-space: nowrap;
  text-align: left;
  z-index: 10;
}
.chart-box {
  background-color: var(--color-bg-card-alt);
  padding: 10px;
  border-radius: var(--radius-card);
  height: 40vh;
  box-shadow: var(--shadow-chart);
  resize: vertical;
}
.chart-box-big {
  background-color: var(--color-bg-card-alt);
  padding: 10px;
  height: 400px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-chart);
  resize: vertical;
}
.chart-box-vbar {
  background-color: var(--color-bg-card-alt);
  padding: 10px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-chart);
  resize: vertical;
}
.graph {
  width: 100%;
  height: 100%;
  margin-top: -20px;
}

/* ======================================================================
   Profile Section
====================================================================== */
.user-portrait {
  --bs-btn-bg: var(--color-bg-btn);
  --bs-btn-hover-bg: var(--color-bg-btn-hover);
  --bs-btn-border-color: unset !important;

  height: 35px;
  width: 92%;
  margin-top: -5px;

  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.profile-picture {
  width: 25px;
  height: 25px;
  border-radius: var(--radius-chip);
  object-fit: cover;
  object-position: center;
  background-color: unset !important;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-avatar);
}

.user-col {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.username {
  font-size: 16px;
  font-weight: 500;
  color: #323232;
  white-space: nowrap;
  margin: 0 0 -1px 0;
}

.username2 {
  font-size: 15px;
  font-weight: bold;
  color: #323232;
  white-space: nowrap;
  margin-top: -6px;
  margin-bottom: -8px;
}

/* ======================================================================
   Containers, Cards, Graphs, Misc
====================================================================== */
.container-page {
  max-width: unset !important;
  padding: unset !important;
}

.card-body-style {
  overflow-x: hidden;
  width: 80vw;
  height: 90vh;
}

.graph-style {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  margin: 0.5rem;
}

.hr {
  margin: 10px -10px;
}

/* ======================================================================
   Bootstrap Button Overrides (global light/dark outline variants)
====================================================================== */
.btn.btn-outline-light,
.btn.btn-outline-dark {
  --bs-btn-border-color: unset !important;
  --bs-btn-hover-color: unset !important;
  --bs-btn-hover-bg: unset !important;
  --bs-btn-hover-border-color: unset !important;
}
