/* ==========================
   🧭 Buttons
   ========================== */
.btn {
  font-weight: 600;
  letter-spacing: 0.2px;
  border-radius: 30px;
  user-select: none;
}

.btn-primary,
.btn-success {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
}

.btn-primary:hover,
.btn-success:hover,
.btn-warning:hover {
  background: var(--main-accent);
  filter: brightness(0.95);
}

.btn-primary:focus,
.btn-success:focus,
.btn-warning:focus {
  outline: none;
}

/* ==========================
   ➕ Add Button – Responsive Width
   ========================== */

/* Bootstrap 5 is missing w-{breakpoint}-auto utilities — define them */
@media (min-width: 576px) { .w-sm-auto { width: auto !important; } }
@media (min-width: 768px) { .w-md-auto { width: auto !important; } }
@media (min-width: 992px) { .w-lg-auto { width: auto !important; } }
@media (min-width: 1200px){ .w-xl-auto { width: auto !important; } }

/* All "Add"-type action buttons share this class */
.btn-add-action {
  /* intentionally empty — width set via media queries below */
}

/* Mobile (< 576 px): full-width stacked layout */
@media (max-width: 575.98px) {
  .btn-add-action,
  .addbutton .btn,
  button.js-add-action,
  #addBtn,
  #btnAddGRN {
    display: block;
    width: 100% !important;
    min-width: unset;
    max-width: unset;
  }
}

/* Small and up (≥ 576 px): fluid 10 rem → 30 rem */
@media (min-width: 576px) {
  .btn-add-action,
  .addbutton .btn,
  button.js-add-action,
  #addBtn,
  #btnAddGRN {
    width: clamp(10rem, 25vw, 30rem) !important;
    min-width: 10rem;
    max-width: 30rem;
  }
}

/* ==========================
   🏭 Plant / Scope Dropdown (topbar)
   ========================== */

/* searchable-select.js wraps the native select in .ss-wrap — size the wrapper, not the hidden select */
#scopeWrap .ss-wrap {
  width: 220px !important;
  min-width: 220px !important;
}

/* Native select is owned by searchable-select.js (display:none!important) — no width rule needed */

/* Chip is never shown */
#scopeChip {
  display: none !important;
}

/* ==========================
   🧮 Form Controls
   ========================== */
.form-control {
  font-size: 1rem;
  border: 1.8px solid var(--main-accent);
  border-radius: 10px;
  transition: all 0.25s ease-in-out;
  box-shadow: inset 0 1px 5px #f6f2f6;
}

.form-control:focus {
  border-color: var(--main-accent) !important;
  background: #f3f7fb;
  outline: none;
  color: var(--text-dark);
}

/* ==========================
   📋 Table Styles
   ========================== */
.table-scroll-container {
  position: relative;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 350px;
  border-radius: 8px;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  position: sticky;
  top: 0;
  background: var(--main-accent);
  color: #fff;
  font-weight: 600;
  z-index: 5;
}

/* Auto-sizing inputs inside table cells — overrides Bootstrap's width:100% on form-control.
   JS sets style.width from content; min-width prevents collapse on empty/short values. */
.table td input[type="number"].form-control,
.table td input[type="text"].form-control {
  width: auto !important;
  min-width: 70px;
}

.table th,
.table td {
  min-width: 50px;
  white-space: nowrap;
  vertical-align: middle;
  text-align: center;
  color: var(--text-dark);
  border-top: 1px solid #f3ccef;
}

.table-success {
  background: var(--main-accent) !important;
  color: #fff !important;
}

.table-danger {
  background: #b025ae !important;
  color: #fff !important;
}

.table-active {
  background-color: #fcd9fc !important;
}

/* ==========================
   📦 Modal & Dropdown Fix
   ========================== */
.modal {
  z-index: 1050 !important;
}

.modal-backdrop {
  z-index: 1040 !important;
}

.modal-dialog {
  max-width: 90vw !important;
  margin: 1rem auto;
}

.modal-content {
  border-radius: 12px;
  border: 1.5px solid #637bf1;
  background: #edf1fc;
  box-shadow: 0 8px 30px #f163f140;
  /* overflow: hidden; */
}

.modal-header {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-header .btn {
  white-space: nowrap;
}

.modal .dropdown-menu {
  position: absolute !important;
  z-index: 9999 !important;
}
.dropdown{
  position:static;
}

/* ==========================
   🧾 Multi-Select Dropdown
   ========================== */
.multi-select-dropdown {
  position: relative;
  display: inline-block;
  width: 210px;
}

.dropdown-btn {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.dropdown-list {
  display: none;
  position: absolute;
  background: #fff;
  min-width: 210px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  z-index: 1;
}

.dropdown-list label {
  display: block;
  padding: 6px 10px;
  cursor: pointer;
}

.dropdown-list input {
  margin-right: 8px;
}

.multi-select-dropdown.open .dropdown-list {
  display: block;
}

/* ==========================
   ⚠️ Alerts & Links
   ========================== */
.error-message,
.success-message {
  font-size: 0.98rem;
  min-height: 22px;
  font-weight: 600;
  color: var(--main-accent);
}

a, .text-primary {
  color: var(--main-accent) !important;
  transition: color 0.2s ease-in-out;
}

a:hover, a:focus {
  color: var(--accent-darker) !important;
  text-decoration: underline;
  outline: none;
}

/* ==========================
   📱 Responsive Adjustments
   ========================== */
@media (max-width: 576px) {
  body, html {
    overflow-x: hidden;
  }

  .auth-card {
    padding: 1rem;
  }

  .logo-bar {
    font-size: 1.25rem;
    padding: 0.55rem 0;
  }

  .modal-dialog {
    max-width: 95vw !important;
    margin: 0.5rem auto;
  }

  .modal-header,
  .modal-footer {
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-header .btn,
  .modal-footer .btn {
    width: 100%;
  }

  .table-scroll-container {
    max-height: 250px;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    font-size: 0.85rem;
  }

  .table th,
  .table td {
    min-width: 50px;
  }
}

.table-responsive{
  max-height: 400px;
}

