/* html {
  font-size: 14px;
} */

/* @media (min-width: 768px) {
  html {
    font-size: 16px;
  }
} */

/* .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
} */
/* Drop the breadcrumb's own bottom margin when it sits inline with other controls in a single row */
.bc-inline > nav { margin-bottom: 0 !important; }

/* Active nav link — underline sits visibly above the header's bottom border */
.nav-link-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background-color: var(--tele-blue);
  border-radius: 2px 2px 0 0;
}

/* Red borders on invalid form fields */
.input-validation-error {
  border-color: #ef4444 !important;
}

.field-validation-error {
  color: #ef4444;
  font-size: 0.875rem;
}

/* Style "forgot password" and similar text links */
#forgot-password, a.text-link {
  color: var(--tele-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
#forgot-password:hover, a.text-link:hover {
  color: #1b47ff;
}

html,
body {
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; 
  display: flex;
  flex-direction: column;
}

html {
  position: relative;
  min-height: 100%;
  --lines-light: #cad6e6;
  --lines: #bcbcbc;
  --tele-blue: #0133ff;
  --tele-blue-trans: #0133ffc3;
  /* --tele-active-border: #4188d0; */
  --tele-active-border: #0133ff;
  --tele-light-bg: #f2f5f8;
  --radius: 0.375rem;
  overflow-y: scroll;
}

body {
  margin-bottom: 60px;
  flex: 1;
}

main {
  flex: 1;
}


a,
.text-link {
  transition: color 0.3s ease;
}
a:hover,
.text-link:hover {
  color: var(--tele-blue);
}

/* .form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
} */

.form-label {
  display: block;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 14px;
  margin-bottom: 5px;
}

.inline-label {
  font-size: 12px;
  /* font-weight: 800; */
  font-weight: 400;
}
.inline-label--big {
  font-size: 16px;
}

.btn {
  display: inline-block;
  cursor: pointer;
  padding: 0.5rem 1rem;
  /* border-radius: 3rem; */
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

.btn-lg {
  padding: 15px 30px;
}

.btn-sm {
  padding: 5px 14px;
  font-size: 14px;
}

.btn-primary {
  background-color: var(--tele-blue);
  color: white;
}
.btn-primary:hover {
  color: white;
  background-color: #1b47ff;
}
.btn-primary:disabled {
  opacity: 35%;
  pointer-events: none;
}
.btn-primary.btn-lg {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-outline-primary {
  color: var(--tele-blue);
  background-color: #fff;
  border: 1px solid var(--tele-blue);
}
.btn-outline-primary:hover {
  color: #fff;
  background-color: var(--tele-blue);
}

.btn-outline-secondary,
.btn-secondary {
  color: black;
  /* background-color: #f2f5f8; */
  /* border: 1px solid #4188d0; */
  background-color: #fff;
  border: 1px solid var(--lines);
}
.btn-outline-secondary:hover,
.btn-secondary:hover {
  color: black;
  /* background-color: #d4e6f8; */
  border-color: #1b47ff;
}

.btn-danger {
  color: black;
  background-color: #fff;
  border: 1px solid #e77182;
}
.btn-danger:hover {
  color: black;
  /* background-color: #d4e6f8; */
  border-color: #ad2136;
}

.btn-selectable {
  border-radius: var(--radius);
  background-color: white;
  border: 1px solid var(--lines);
  outline: 1px solid transparent;
}
.btn-selectable:hover {
  box-shadow: 0 0 5px #4086cdc3;
  box-shadow: 0 0 5px var(--tele-blue-trans);
  border-color: var(--tele-active-border);
  outline-color: var(--tele-active-border);
}
.btn-selectable.selected {
  box-shadow: 0 0 5px #4086cdc3;
  box-shadow: 0 0 5px var(--tele-blue-trans);
  border-color: var(--tele-active-border);
  outline-color: var(--tele-active-border);
}
.btn-selectable:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  background-color: #f0f0f0;
  border-color: #cccccc;
  color: #888888;
}

select,
.form-select {
  border: 1px solid var(--lines);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: all 0.3s ease;
  outline: 1px solid transparent;
  width: 100%;
  background: white;
}
select:focus,
.form-select:focus {
  border-color: var(--tele-active-border);
  outline-color: var(--tele-active-border);
}

input[type="radio"],
input[type="checkbox"],
.form-check-input {
  width: 16px;
  height: 16px;
  accent-color: var(--tele-blue);
  cursor: pointer;
  transition: all 0.3s ease;
}

input[type="radio"]:disabled
input[type="checkbox"]:disabled,
.form-check-input:disabled {
  cursor: default;
  opacity: 0.5;
}

.form-check {
  display: flex;
  align-items: center;
}
.form-check-label {
  cursor: pointer;
}
.text-muted {
  cursor: default;
  color: rgba(0,0,0,0.5);
}
.form-check-input {
  margin-right: 5px;
}

.text-danger {
  color: #dc2626;
  font-size: 14px;
}


input[type="range"] {
  --progress-color: #0133ff; /* red-500 */
  --track-color: #d1d5db;    /* gray-200 */

  width: 100%;
  height: 6px;
  appearance: none;
  background: linear-gradient(
    to right,
    var(--progress-color) 0% 50%,  /* the 50% will be overridden below in Chrome */
    var(--track-color) 50% 100%
  );
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

/* Thumb (Chrome/Edge) */
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--progress-color);
  border: 2px solid white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  cursor: pointer;
  margin-top: -6px; /* centers thumb on 6px track */
}

/* Track for Chrome/Edge */
input[type="range"]::-webkit-slider-runnable-track {
  background: var(--track-color);
  height: 6px;
  border-radius: 999px;
}

/* Firefox thumb + progress */
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--progress-color);
  border: 2px solid white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  cursor: pointer;
}
input[type="range"]::-moz-range-track {
  background: var(--track-color);
  height: 6px;
  border-radius: 999px;
}
input[type="range"]::-moz-range-progress {
  background: var(--progress-color);
  height: 6px;
  border-radius: 999px;
}

input[type='text'],
input[type='number'],
.form-control {
  border: 1px solid var(--lines);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition:
    border 0.3s ease,
    outline 0.3s ease;
  outline: 1px solid transparent;
  width: 100%;
}
input[type='text']:focus,
input[type='number']:focus,
.form-control:focus {
  border-color: var(--tele-active-border);
  outline-color: var(--tele-active-border);
}


.card {
  border: 1px solid var(--lines);
  border-radius: var(--radius);
  background-color: white;
}

.card-sm {
  max-width: 640px;
  margin: auto;
}
.card-body {
  padding: 1.5rem;
  padding-top: 1rem;
}

.card-title {
  font-weight: 500;
  font-size: 1.125rem;
  line-height: 1.75rem;
  padding-bottom: 0.5rem;
}

.card-secondary {
  background-color: #f2f5f8;
}

/* Lock body scroll when any modal is open (Bootstrap adds this class).
   Both html AND body need overflow:hidden for mobile browsers (iOS/Android).
   position:fixed prevents touch-scroll bleed-through on mobile Safari/Chrome. */
html.modal-open,
body.modal-open {
  overflow: hidden;
  height: 100%;
}
body.modal-open {
  position: fixed;
  width: 100%;
}

.modal {
  position: fixed;
  z-index: 1055;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.modal.fade {
  display: none !important;
}
.modal.fade.show {
  display: flex !important;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0,0,0,0.4);
}

/* Bootstrap-injected modal backdrop (Bootstrap CSS not loaded, so style it ourselves) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background-color: #000;
}
.modal-backdrop.fade { opacity: 0; }
.modal-backdrop.show { opacity: 0.5; }

/* Bootstrap-injected close button (btn-close) styling fallback */
.btn-close {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s ease-in-out;
  position: relative;
}
.btn-close:hover { opacity: 1; }
.btn-close::before,
.btn-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1rem;
  height: 2px;
  background-color: currentColor;
  transform-origin: center;
}
.btn-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.btn-close::after  { transform: translate(-50%, -50%) rotate(-45deg); }

/* Bootstrap badge/color utilities fallback (Bootstrap CSS not loaded) */
.badge {
  display: inline-block;
  padding: 0.25em 0.5em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}
.bg-success { background-color: #16a34a !important; color: #fff; }
.bg-danger  { background-color: #dc2626 !important; color: #fff; }
.bg-warning { background-color: #f59e0b !important; }
.bg-info    { background-color: #06b6d4 !important; color: #fff; }
.bg-primary { background-color: var(--tele-blue, #1b47ff) !important; color: #fff; }
.bg-secondary { background-color: #6b7280 !important; color: #fff; }
.text-dark  { color: #1f2937 !important; }
.text-white { color: #fff !important; }

/* Bootstrap alert utility fallback */
.alert { padding: 0.75rem 1rem; border: 1px solid transparent; border-radius: 0.375rem; }
.alert-success { background-color: #dcfce7; border-color: #86efac; color: #14532d; }
.alert-danger  { background-color: #fee2e2; border-color: #fca5a5; color: #7f1d1d; }
.alert-warning { background-color: #fef3c7; border-color: #fcd34d; color: #78350f; }
.alert-info    { background-color: #cffafe; border-color: #67e8f9; color: #164e63; }

.modal-dialog {
  position: relative;
  max-width: 400px;
  width: 100%;
  background-color: white;
  border-radius: var(--radius);
  z-index: 1;
  --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}

.modal-dialog.modal-lg {
  max-width: 640px;
}

.modal-dialog.modal-xl {
  max-width: 900px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--lines);
}
.modal-body {
  padding: 1rem 1.5rem;
  max-height: 75vh;
  overflow-y: auto;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--lines);
}
.modal-footer .btn {
  min-width: 7rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  font-weight: 500;
}

/* Filled, high-contrast variants — used by CP.confirm/CP.alert for stronger
   visual hierarchy. Intentionally separate from .btn-danger (outlined) so
   existing outlined usages elsewhere in the app are not affected. */
.btn-solid-danger {
  color: #fff;
  background-color: #d83a50;
  border: 1px solid #d83a50;
}
.btn-solid-danger:hover {
  color: #fff;
  background-color: #ad2136;
  border-color: #ad2136;
}
.btn-solid-warning {
  color: #fff;
  background-color: #f59e0b;
  border: 1px solid #f59e0b;
}
.btn-solid-warning:hover {
  color: #fff;
  background-color: #c27a06;
  border-color: #c27a06;
}
.btn-solid-success {
  color: #fff;
  background-color: #16a34a;
  border: 1px solid #16a34a;
}
.btn-solid-success:hover {
  color: #fff;
  background-color: #0f7a37;
  border-color: #0f7a37;
}

.modal-title {
  font-weight: 500;
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.d-none {
  display: none;
}

.tab-pane.fade {
  display: none;
}
.tab-pane.fade.show {
  display: block;
}

.nav-tabs {
  border-bottom: 3px solid black;
  display: flex;
  align-items: stretch;   /* every tab the same height */
  overflow-x: auto;
}
.nav-tabs .nav-item {
  display: flex;          /* let the link fill the item height */
}

.nav-tabs .nav-link {
  display: inline-flex;
  align-items: center;    /* button & anchor labels share one baseline */
  font: inherit;          /* <button> would otherwise use the OS font */
  line-height: 1.25;
  color: inherit;
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0.75rem 1.5rem;
  text-transform: uppercase;
  transition: all 0.3s ease;
  border-top-right-radius: 0.375rem;
  white-space: nowrap;
}
.nav-tabs .nav-link:hover {
  padding: 0.75rem 1.5rem;
  text-transform: uppercase;
  background-color: rgba(0,0,0,0.1);
}
.nav-tabs .nav-link.active {
  background-color: black;
  color: white;
}

h2 {
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 2rem;
}

table {
  background-color: white;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
table tr th,
table tr td {
  border-bottom: 1px solid var(--lines);
  padding: 0.5rem 1rem;
}

table tr th:first-child,
table tr td:first-child {
  border-left: 1px solid var(--lines);
}
table tr th:last-child,
table tr td:last-child {
  border-right: 1px solid var(--lines);
}
table tr th {
  background: var(--tele-light-bg);
  text-align: left;
  border-top: solid 1px var(--lines);
  font-size: 14px;
}

/* top-left border-radius */
table tr:first-child th:first-child {
  border-top-left-radius: 0.375rem;
}

/* top-right border-radius */
table tr:first-child th:last-child {
  border-top-right-radius: 0.375rem;
}

/* bottom-left border-radius */
table tr:last-child td:first-child {
  border-bottom-left-radius: 0.375rem;
}

/* bottom-right border-radius */
table tr:last-child td:last-child {
  border-bottom-right-radius: 0.375rem;
}

table select,
table .form-select {
  width: unset;
}

/* Spacious table variant */
.table-spacious tr th,
.table-spacious tr td {
  padding: 0.75rem 1.25rem;
}
.table-spacious tbody tr {
  transition: background-color 0.15s ease;
}
.table-spacious tbody tr:hover {
  background-color: #f8fafc;
}
tr.tier-disabled {
  opacity: 0.5;
}

/* Tabs inside modal */
.modal-tabs {
  display: flex;
  border-bottom: 2px solid var(--lines);
  padding: 0 1.5rem;
  overflow-x: auto;
}
.modal-tabs .modal-tab {
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  color: rgba(0,0,0,0.5);
  white-space: nowrap;
  flex-shrink: 0;
}
.modal-tabs .modal-tab:hover {
  color: var(--tele-blue);
}
.modal-tabs .modal-tab.active {
  border-bottom-color: var(--tele-blue);
  color: var(--tele-blue);
}

.alert {
  padding: 1rem;
  border-radius: var(--radius);
  border-width: 1px;
  border-style: solid;
  border-color: var(--lines);
  color: black;
  font-size: 14px;
  background-color: white;
}

.alert.alert-success {
  border-color: #34d399;
  background-color: #ecfdf5;
  color: #059669;
}
.alert.alert-danger {
  border-color: #e77182;
  background-color: #fdf5f6;
  color: #c72f44;
}

.btn-group-horizontal {
  display: flex;
  gap: 0.5rem;
}

.list-group {
  background-color: white;
  border-radius: var(--radius);
  border: 1px solid var(--lines);
}

.list-group-item {
  display: block;
  padding: 1rem;
  border-bottom: 1px solid var(--lines);
}
.list-group-item:last-child {
  border-bottom: unset;
}

.badge {
  border-radius: var(--radius);
  color: black;
  font-size: 0.75rem;
  line-height: 1rem;
  padding: 0.25rem 0.5rem;
  font-weight: 500;
  border: 1px solid var(--lines);
}

.badge.bg-primary {
  color: white;
  background-color: var(--tele-blue);
  border: unset;
}

.pagination {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  justify-content: center;
}

.page-item:not(.disabled) .page-link {
  color: black;
  display: inline-block;
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
  border-radius: var(--radius);
  background-color: white;
  border: 1px solid var(--lines);
  outline: 1px solid transparent;
}
.page-item:not(.disabled):hover .page-link,
.page-item:not(.disabled).active .page-link {
  color: black;
  box-shadow: 0 0 5px var(--tele-blue-trans);
  border-color: var(--tele-active-border);
  outline-color: var(--tele-active-border);
}

.page-item.disabled {
  padding: 0.5rem 1rem;
}

/* ============================
   Responsive / Mobile-First
   ============================ */

/* Button groups wrap on mobile */
.btn-group-horizontal {
  flex-wrap: wrap;
}

/* Bootstrap grid shim — used by addon modals and a few legacy pages.
   Only defines the handful of classes actually referenced in the app. */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}
.row > [class*="col-"] {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  width: 100%;
}
.col-4  { flex: 0 0 100%; max-width: 100%; }
.col-6  { flex: 0 0 100%; max-width: 100%; }
@media (min-width: 640px) {
  .col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-6 { flex: 0 0 50%; max-width: 50%; }
}

/* Mobile card list — paired with Tailwind "flex md:hidden" classes on the element.
   Only set layout properties here, NOT display. Tailwind controls visibility. */
.mobile-card-list {
  flex-direction: column;
  gap: 0.75rem;
}
.mobile-card {
  background: white;
  border: 1px solid var(--lines);
  border-radius: var(--radius);
  padding: 1rem;
}
.mobile-card-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  font-size: 14px;
}
.mobile-card-row .label {
  color: rgba(0,0,0,0.5);
  font-size: 13px;
}
.mobile-card-row .value {
  text-align: right;
  font-weight: 500;
}
.mobile-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--lines);
}
.mobile-card-actions .btn {
  flex: 1;
  text-align: center;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure primary interactive buttons have 44px min tap target on touch.
   Note: we intentionally target only `.btn` (not all `button` tags) because
   many inline controls use fixed heights (e.g. `h-9` for 36px) to match
   adjacent inputs — forcing 44px there breaks visual alignment. */
@media (max-width: 767px) {
  .btn, a.btn, .page-link, .nav-link, .form-check-label, .page-pill {
    min-height: 44px;
  }
  .btn-sm {
    min-height: 36px;
    padding: 6px 12px;
  }
  /* Pagination pill links inline-flex so min-height renders */
  .page-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Modal takes full width on mobile */
  .modal-dialog {
    max-width: calc(100vw - 2rem);
    margin: 1rem;
  }
  .modal-dialog.modal-lg,
  .modal-dialog.modal-xl {
    max-width: calc(100vw - 2rem);
  }

  /* Prevent horizontal overflow */
  .mx-auto.w-full {
    overflow-x: hidden;
  }

  /* <pre> tags (summaries, logs) — always wrap on mobile */
  pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
  }
}