/* =========================================================
   COLORS
========================================================= */
.text-primary { color:#305BA2;} .text-secondary { color:#6c757d;}
.text-success { color:#198754;} .text-danger { color:#dc3545;}
.text-warning { color:#ffc107;} .text-info { color:#0dcaf0;}
.text-light { color:#f8f9fa;} .text-dark { color:#212529;}

.bg-primary { background:#3B71CB; color:#fff;}
.bg-secondary { background:#6c757d; color:#fff;}
.bg-success { background:#198754; color:#fff;}
.bg-danger { background:#dc3545; color:#fff;}
.bg-warning { background:#FFE69C; color:#212529;}
.bg-info { background:#0dcaf0; color:#212529;}
.bg-light { background:#f8f9fa; color:#212529;}
.bg-dark { background:#212529; color:#fff;}

.border-primary { border-color:#3B71CB; }
.border-secondary { border-color:#6c757d; }
.border-success { border-color:#198754; }
.border-danger { border-color:#dc3545; }
.border-warning { border-color:#ffc107; }
.border-info { border-color:#0dcaf0; }
.border-light { border-color:#f8f9fa; }
.border-dark { border-color:#212529; }

/* =========================================================
   BUTTONS
========================================================= */
.btn {
  display:inline-block;
  padding:0.375rem 0.75rem;
  border-radius:0.375rem;
  border:1px solid transparent;
  font-size:1rem; line-height:1.5; cursor:pointer;
  text-align:center; text-decoration:none;
  transition: all 0.15s ease-in-out;
}
/*
.btn:hover, .btn:focus { filter: brightness(0.9); text-decoration:none; }
.btn:active { transform: scale(0.98); filter: brightness(0.85); }
*/
.btn:disabled, .btn.disabled { opacity:0.65; cursor:not-allowed; pointer-events:none; }

/* Button variants */
.btn-primary { background:#3B71CB; color:#fff; border-color:#3B71CB; }
.btn-secondary { background:#6c757d; color:#fff; border-color:#6c757d; }
.btn-success { background:#198754; color:#fff; border-color:#198754; }
.btn-danger { background:#dc3545; color:#fff; border-color:#dc3545; }
.btn-warning { background:#ffc107; color:#212529; border-color:#ffc107; }
.btn-info { background:#0dcaf0; color:#212529; border-color:#0dcaf0; }
.btn-light { background:#f8f9fa; color:#212529; border-color:#f8f9fa; }
.btn-dark { background:#212529; color:#fff; border-color:#212529; }

/* Outline variants */
.btn-outline-primary{
  background: transparent;
  color: #305BA2;
  border: 1px solid #305BA2;
}
.btn-outline-primary:hover{
  background: rgba(59,113,203,.10);
  color: #305BA2;
}

.btn-outline-secondary { background:transparent; color:#6c757d; border:1px solid #6c757d; }
.btn-outline-success { background:transparent; color:#198754; border:1px solid #198754; }
.btn-outline-danger { background:transparent; color:#dc3545; border:1px solid #dc3545; }
.btn-outline-warning { background:transparent; color:#ffc107; border:1px solid #ffc107; }
.btn-outline-info { background:transparent; color:#0dcaf0; border:1px solid #0dcaf0; }
.btn-outline-light { background:transparent; color:#f8f9fa; border:1px solid #f8f9fa; }
.btn-outline-dark { background:transparent; color:#212529; border:1px solid #212529; }

.btn-outline-primary:hover { color: #ffffff; }

/* Small buttons */
.btn-sm {
  padding: 0.25rem 0.4rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

/* =========================================================
   CHECKBOX
========================================================= */

.form-check-input {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.form-check-input:focus {
  box-shadow: 0 0 0 .15rem rgba(13,110,253,.25);
}

.form-check-label {
  cursor: pointer;
  user-select: none;
}

/* =========================================================
   ALERTS
========================================================= */
.alert {
  padding:0.75rem 1rem;
  border-radius:0.375rem;
  margin-bottom:1rem;
  transition: all 0.2s ease-in-out;
}
.alert-primary { background:#4B98F7; color:#084298; }
.alert-secondary { background:#e2e3e5; color:#41464b; }
.alert-success { background:#d1e7dd; color:#0f5132; }
.alert-danger { background:#f8d7da; color:#842029; }
.alert-warning { background:#fff3cd; color:#664d03; }
.alert-info { background:#cff4fc; color:#055160; }
.alert-light { background:#fefefe; color:#636464; }
.alert-dark { background:#d3d3d4; color:#1b1b1b; }

.alert:hover { filter: brightness(0.95); }

/* =========================================================
   BADGES
========================================================= */
.badge { display:inline-block; padding:0.35em 0.65em; font-size:0.75em; border-radius:0.375rem; background:#6c757d; color:#fff; transition: all 0.15s ease-in-out; }
.badge:hover { filter: brightness(0.9); cursor:pointer; }
.badge.active { box-shadow: inset 0 0.15rem 0.25rem rgba(0,0,0,0.2); }
.badge-primary { background:#305BA2; } .badge-secondary { background:#6c757d; }
.badge-success { background:#A3CFBB; } .badge-danger { background:#dc3545; }
.badge-warning { background:#FFE69C; color:#212529; } .badge-info { background:#0dcaf0; color:#212529; }
.badge-light { background:#f8f9fa; color:#212529; } .badge-dark { background:#212529; }

/* =========================================================
   CARDS
========================================================= */
.card {
  border:1px solid #ddd;
  border-radius:0.5rem;
  overflow: visible;        /* let dropdowns escape */
  background:#fff;
  transition: all 0.15s ease-in-out;
  position: relative;          /* <-- add this */
}

/* Card that has an open dropdown should be on top of siblings */
.card-select-open {
  z-index: 999;
}

.card-body {
  padding:1rem;
}
.card-title {
  margin-bottom:0.5rem;
  font-weight:600;
}
.card:hover {
  /* transform: translateY(-2px); */
  box-shadow:0 2px 8px rgba(0,0,0,0.1);
}

/* CARD HEADER & FOOTER */
.card-header {
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
  font-weight: 600;
  font-size: 1rem;
}

.card-footer {
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-top: 1px solid #ddd;
  font-size: 0.9rem;
}

/* Rounded corners should remain smooth */
.card-header:first-child {
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.card-footer:last-child {
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

/* Optional: contextual header background colors (Bootstrap-style) */
.card-header.bg-primary,
.card-footer.bg-primary {
  background: #4B98F7; color: #fff; border-color: #4B98F7;
}

.card-header.bg-secondary,
.card-footer.bg-secondary {
  background: #6c757d; color: #fff; border-color: #5c636a;
}

.card-header.bg-success,
.card-footer.bg-success {
  background: #198754; color: #fff; border-color: #157347;
}

.card-header.bg-danger,
.card-footer.bg-danger {
  background: #dc3545; color: #fff; border-color: #bb2d3b;
}

.card-header.bg-warning,
.card-footer.bg-warning {
  background: #ffc107; color:#212529; border-color:#ffca2c;
}

.card-header.bg-info,
.card-footer.bg-info {
  background: #0dcaf0; color:#212529; border-color:#31d2f2;
}

.card-header.bg-dark,
.card-footer.bg-dark {
  background: #212529; color:#fff; border-color:#1c1f23;
}

/* =========================================================
   FORMS
========================================================= */
.form-control {
  width: 100%;
  padding: 0.375rem 0.75rem;
 /* border: 1px solid #ced4da;*/
  border-radius: 0.375rem;
  box-sizing: border-box;
  transition: all 0.15s ease-in-out;
  height: 40px;
  border: 1px solid #DADAF2;
  
}

.form-control:focus {
  outline: none;
  border-color: #4B98F7!important;
  /*box-shadow: 0 0 0 0.15rem rgba(13,110,253,0.25);*/
}


/* Remove default number input spinners */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield; /* Firefox */
}

.disabled-sheet-input {
    opacity: 0.5;
    cursor: not-allowed;
}

.sheet-price:disabled + .step-btn,
.sheet-price:disabled ~ .step-btn {
    opacity: 0.4;
    pointer-events: none;
}

/* =========================================================
   INPUT GROUPS — Bootstrap-style clone
========================================================= */

.input-group {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
}

/* Base styling for addons and buttons inside group */
.input-group-text,
.input-group > .btn {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: #495057;
  text-align: center;
  white-space: nowrap;
  background-color: #e9ecef;
  border: 1px solid #ced4da;
}

/* Inputs/selects inside the group */
.input-group > .form-control,
.input-group > .form-select {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  margin-bottom: 0;
  border: 1px solid #ced4da;
}

/* Only outermost elements get rounded corners */
.input-group > :first-child {
  border-top-left-radius: 0.375rem;
  border-bottom-left-radius: 0.375rem;
}

.input-group > :last-child {
  border-top-right-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
}

/* Middle elements are square */
.input-group > :not(:first-child):not(:last-child) {
  border-radius: 0;
}

/* Also guard specifically for our spinner groups */
.input-group .form-control + .input-group-text {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}


/* If a form-control is followed by an addon, flatten its right corners */
.input-group .form-control + .input-group-text {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* When buttons follow an input, ensure the input's right side is square */
.input-group .form-control:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}


/* Overlap borders by 1px so there are no double borders */
.input-group > :not(:first-child) {
  margin-left: -1px;
}

/* Focused input should sit visually on top */
.input-group > .form-control:focus {
  position: relative;
  z-index: 2;
}

/* Optional: small buttons if you use .btn-sm inside groups */
.input-group > .btn.btn-sm {
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
}

/* Clickable +/- "segments" */
.spinner-btn {
  cursor: pointer;
  user-select: none;
}

/* =========================================================
   Bootstrap-Select Style Dropdown
========================================================= */

.bs-select {
  position: relative;
  width: 100%;
  z-index: 10;  /* above normal content */
}

/* When open, float above neighboring content/cards */
.bs-select.open {
  z-index: 1000;
}

.bs-select-btn {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid #ced4da;
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 1rem;
  color: #212529;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease-in-out;
}

.bs-select-btn:hover {
  border-color: #b5bdc8;
}

.bs-select-btn:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.15rem rgba(13,110,253,0.25);
}

/* caret container (we're using an inline SVG inside) */
.bs-select-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* animate SVG chevron on open/close */
.bs-select-caret svg {
  transition: transform 0.15s ease;
}

.bs-select.open .bs-select-caret svg {
  transform: rotate(180deg);
}

/* dropdown menu */
.bs-select-menu {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  max-height: 240px;
  overflow-y: auto;
  display: none;
  z-index: 1100;  /* above the button itself */
}

.bs-select.open .bs-select-menu {
  display: block;
}

.bs-select-option {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.1s ease;
}

.bs-select-option:hover {
  background: #f1f3f5;
}

.bs-select-option.active {
  background: #e7f1ff;
  color: #084298;
  font-weight: 600;
}


/* =========================================================
   COLLAPSE
========================================================= */
.collapse { display:none; transition: all 0.3s ease-in-out; }
.collapse.show { display:block; }

/* =========================================================
   MODALS
========================================================= */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-dialog {
  margin: auto;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal.show .modal-dialog {
  transform: translateY(0);
}

.modal-content {
  background: #fff;
  padding: 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease-in-out;
}

.modal-close {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
}

/* =========================================================
   DROPDOWN MENU (Header)
========================================================= */
.dropdown{ position: relative; }

/* MENU (always in DOM for animation) */
.dropdown-menu{
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;

  min-width: 180px;
  max-width: calc(100vw - 16px);
  z-index: 2000;

  background: #fff;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 0.375rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 0.5rem 0;

  /* ✅ hidden but animatable */
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;

  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

/* SHOW (supports different JS patterns) */
.dropdown.show .dropdown-menu,
.dropdown.open .dropdown-menu,
.dropdown [aria-expanded="true"] + .dropdown-menu{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;

  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}

/* Menu items */
.dropdown-item{
  display:block;
  padding:0.45rem 1rem;
  font-size:0.9rem;
  color:#333;
  text-decoration:none;
  white-space:nowrap;
}
.dropdown-item:hover{ background:#f1f1f1; }

.dropdown-divider{
  height:1px;
  margin:0.35rem 0;
  background:rgba(0,0,0,0.12);
}

/* Right aligned (opt-in per dropdown) */
.dropdown-menu.dropdown-menu-end{
  left: auto;
  right: 0;
}

/* =========================================================
   Normalize dropdown-item buttons to match links
========================================================= */

/* Buttons inside dropdowns should behave like links */
.dropdown-menu button.dropdown-item{
  appearance: none;
  -webkit-appearance: none;

  width: 100%;
  text-align: left;

  background: transparent;
  border: 0;
  margin: 0;

  /* FORCE identical box model */
  padding: 0.45rem 1rem;
  line-height: 1.25;
  font-size: 0.9rem;

  color: #333;
  cursor: pointer;
}

/* Hover + focus should match anchors exactly */
.dropdown-menu button.dropdown-item:hover,
.dropdown-menu button.dropdown-item:focus{
  background: #f1f1f1;
  outline: none;
}

/* Remove weird button focus rings */
.dropdown-menu button.dropdown-item:focus-visible{
  outline: none;
}



/* =========================================================
   UTILITIES
========================================================= */
.text-white { color:#fff !important; }
.text-muted { color:#6c757d !important; }

/* =========================================================
   DISPLAY UTILITIES (Bootstrap-like)
========================================================= */

.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

.d-flex {
  display: flex !important;
}

/* md breakpoint: 768px+ */
@media (min-width: 768px) {
  .d-md-none {
    display: none !important;
  }
  .d-md-block {
    display: block !important;
  }
  .d-md-flex {
    display: flex !important;
  }
}


/* =========================================================
   RESPONSIVE MULTILINE TOOLTIP
========================================================= */

.tooltip {
    position: relative;
    display: inline-block;
}

/* The icon */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border-radius: 50%;
    font-size: 11px;
    cursor: help;
    background: #0dcaf0;
    color: #212529;
}

.tooltip-content {
    display: none;
    position: absolute;
    left: 50%;
    bottom: 130%;
    transform: translateX(-50%);

    /* ---- THE IMPORTANT FIX ---- */
    position: absolute;
    width: max-content;        /* bubble grows as wide as text */
    max-width: 260px;          /* but never wider than this */
    box-sizing: border-box;

    padding: 8px 10px;
    background: #212529;
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
    white-space: normal;       /* allow wrapping */
    text-align: center;
    overflow-wrap: break-word;
    z-index: 9999;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}


/* Little arrow */
.tooltip-content::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #212529 transparent transparent transparent;
}

/* Show on hover */
.tooltip:hover .tooltip-content {
    display: block;
}

/* Margin (m-) */
.m-0  { margin: 0 !important; }
.m-1  { margin: .25rem !important; }
.m-2  { margin: .5rem !important; }
.m-3  { margin: 1rem !important; }
.m-4  { margin: 1.5rem !important; }
.m-5  { margin: 3rem !important; }

/* Margin top (mt-) */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .25rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

/* Margin bottom (mb-) */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

/* Margin left (ms-) */
.ms-0 { margin-left: 0 !important; }
.ms-1 { margin-left: .25rem !important; }
.ms-2 { margin-left: .5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-4 { margin-left: 1.5rem !important; }
.ms-5 { margin-left: 3rem !important; }

/* Margin right (me-) */
.me-0 { margin-right: 0 !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.me-3 { margin-right: 1rem !important; }
.me-4 { margin-right: 1.5rem !important; }
.me-5 { margin-right: 3rem !important; }

/* Margin X (mx-) */
.mx-0 { margin-left: 0 !important; margin-right: 0 !important; }
.mx-1 { margin-left: .25rem !important; margin-right: .25rem !important; }
.mx-2 { margin-left: .5rem !important; margin-right: .5rem !important; }
.mx-3 { margin-left: 1rem !important; margin-right: 1rem !important; }
.mx-4 { margin-left: 1.5rem !important; margin-right: 1.5rem !important; }
.mx-5 { margin-left: 3rem !important; margin-right: 3rem !important; }

/* Margin Y (my-) */
.my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }
.my-1 { margin-top: .25rem !important; margin-bottom: .25rem !important; }
.my-2 { margin-top: .5rem !important; margin-bottom: .5rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.my-5 { margin-top: 3rem !important; margin-bottom: 3rem !important; }

/* Padding (p-) */
.p-0  { padding: 0 !important; }
.p-1  { padding: .25rem !important; }
.p-2  { padding: .5rem !important; }
.p-3  { padding: 1rem !important; }
.p-4  { padding: 1.5rem !important; }
.p-5  { padding: 3rem !important; }

/* Padding X (px-) */
.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.px-1 { padding-left: .25rem !important; padding-right: .25rem !important; }
.px-2 { padding-left: .5rem !important; padding-right: .5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-5 { padding-left: 3rem !important; padding-right: 3rem !important; }

/* Padding Y (py-) */
.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-1 { padding-top: .25rem !important; padding-bottom: .25rem !important; }
.py-2 { padding-top: .5rem !important; padding-bottom: .5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

/* =========================================================
   TABLES (Bootstrap-like, lightweight)
========================================================= */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  color: #212529;
}

.table th,
.table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e9ecef;
  vertical-align: middle;
}

.table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  border-bottom: 2px solid #dee2e6;
  background: #f8f9fa;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Zebra striping */
.table-striped tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

/* Hover highlight */
.table-hover tbody tr:hover {
  background-color: #eef4ff;
}

/* Compact variant */
.table-sm th,
.table-sm td {
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

/* Right-align numeric columns */
.table .text-end {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Muted / placeholder values */
.table .text-muted {
  color: #6c757d;
}

/* Table inside cards */
.card .table {
  margin-bottom: 0;
}

/* Responsive helper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* =========================================================
   ALIGNMENT HELPERS (Bootstrap-compatible)
========================================================= */

/* Vertical alignment */
.align-middle th,
.align-middle td {
  vertical-align: middle;
}

/* Also allow per-cell usage */
th.align-middle,
td.align-middle {
  vertical-align: middle;
}
