:root {
  --brand-orange: #e67e22;
  --brand-green: #488444;
  --brand-red:red;
  --brand-gray: gray;
  --brand-blue: #007bff;
  --success-green: #27ae60;
  --error-red: #e74c3c;
}
.my-green {
  color: var(--brand-green) !important;
}
.my-orange {
  color: var(--brand-orange) !important;
}
.my-red {
  color: var(--brand-red) !important;
}
.my-gray {
  color: var(--brand-gray) !important;
}
.my-blue {
  color: var(--brand-blue) !important;
}
.my-underline {
  text-decoration:underline;
}
.my-italic {
  font-style:italic;
}
.my-bold {
  font-weight:600;
}
.my-smaller {
  font-size:smaller;
}

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

.toast {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  background: #333;
  color: #fff;
  padding: 12px 20px;
  margin-bottom: 10px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-width: 280px;
  animation: slideIn 0.3s ease-out;
}

.toast-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  opacity: 0.6;
  line-height: 1;
  padding: 0;
}

.toast-close:hover {
  opacity: 1;
}

/* Modifier Classes */
.toast-success { border-left: 5px solid var(--success-green); }
.toast-error   { border-left: 5px solid var(--error-red); }
.toast-warning { border-left: 5px solid var(--brand-orange); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* =====================================
Wrapper for dynamically loaded content
===================================== */

#contentArea {
  padding: 2px;
  box-sizing: border-box;
  width: 100%;
}

/* Main content card used on inner pages */
.content-panel {
  background: #ffffff;
  border-radius: 8px;
  padding: 24px 28px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
  margin-bottom: 16px;
  max-width: 100%;
  overflow-x: auto;
}

/* Limit line length for readability (generic content page) */
.content-page {
  /*max-width: 960px;*/
  max-width: 100%;
}

/* =====================================
Breadcrumb
===================================== */

.content-panel .breadcrumb {
  background: #f3f4f6; /* Light grayish shading */
  padding: 12px 20px;
  margin-bottom: 24px;
  border-radius: 8px;
  border: 1px solid #e5e7eb; /* Subtle border for definition */
  display: inline-block; /* Optional: makes the gray box wrap the text width */
  width: 100%; /* Or keep 100% to span the panel */
}

.content-panel ul.account-breadcrumb {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.content-panel ul.account-breadcrumb > li {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  color: #6b7280;
}

/* Links (Clickable Items) */
.content-panel ul.account-breadcrumb > li > a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.content-panel ul.account-breadcrumb > li > a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Separator styling */
.content-panel ul.account-breadcrumb > li + li::before {
  content: "/";
  color: #9ca3af;
  margin: 0 12px;
  font-weight: 300;
}

/* Final Item (Non-Clickable) */
.content-panel ul.account-breadcrumb > li:last-child {
  color: #374151;      /* Darker, "text" color */
  font-weight: 600;    /* Bolder to show current location */
  pointer-events: none; /* Disables clicking */
  cursor: default;     /* Ensures arrow cursor instead of hand pointer */
  user-select: none;   /* Optional: prevents accidental highlighting */
}

/* Override for <a> tag if the last child happens to be wrapped in one */
.content-panel ul.account-breadcrumb > li:last-child > a {
  color: inherit;
  cursor: default;
  text-decoration: none;
  pointer-events: none;
}

@media (max-width: 576px) {
  .content-panel .breadcrumb {
    padding: 10px 14px;
  }
  .content-panel ul.account-breadcrumb > li {
    font-size: 13px;
  }
}

/* =====================================
Info banner (top highlight)
===================================== */

.info-banner {
  background: #ecfdf3;
  border: 1px solid #cde9cf;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  margin-top: 20px;
}

.info-banner-sub {
  margin: 4px 0 0;
  font-size: 14px; /* was 13px */
  color: #4b5563;
}

/* =====================================
Generic content typography / blocks
===================================== */

.content-page .content-heading {
  color: #488444;
  font-size: 19px; /* was 18px */
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.5;
}

.content-page .section-title {
  font-size: 17px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 10px;
  /*color: #ff8c00;*/
  color: #e67e22;
  text-decoration: underline;
}

.content-page .benefits-list {
  font-size: 15px; /* was 14px */
  margin-top: 8px;
  margin-bottom: 18px;
  background: #f9fafb;
  border-radius: 8px;
  padding: 12px 16px;
  padding-left: 20px;
  position: relative;
  border-left: 3px solid #488444;
}

.content-page .benefits-list li {
  margin-bottom: 6px;
}

.content-page .benefits-list li::marker {
  color: #488444;
}

.content-page .benefits-list b {
  color: #111827;
}

/* Fieldset / legend / help text in content forms */
.content-page fieldset {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 12px;
  background-color: #f9fafb;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.content-page legend {
  padding: 0 6px;
  font-weight: 600;
  font-size: 15px; /* was 14px */
  /*color: #374151;*/
  /*color: #ff8c00;*/
  color: #e67e22;
}

/* =====================================
 Help Text - START
===================================== */
.content-page .help-text {
    margin-top: 6px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background-color: #eff6ff;
    border: 1px solid #dbeafe;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 100%;
    max-height: 400px;
    overflow-y: auto;
}

/* info icon */
.content-page .help-text::before {
    content: "i";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background-color: #2563eb;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 4px;
}

/* text column */
.content-page .help-text > *:not(:first-child) {
    flex: 1 1 auto;
    min-width: 0;
}

/* NEW: wrapper for complex help (lists, images) */
.content-page .help-text-body {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.6
}

/* general text */
.content-page .help-text p,
.content-page .help-text li {
    color: #1e3a8a;
    font-size: 14px;
    line-height: 1.6;
}

/* paragraph spacing */
.content-page .help-text p {
    margin: 0 0 12px 0;
}

/* list spacing */
.content-page .help-text ol,
.content-page .help-text ul {
    padding-left: 22px;
    margin: 0 0 12px 0;
}

.content-page .help-text li {
    margin: 8px 0;
}

/* images with clear gaps */
.content-page .help-text img,
.content-page .help-text svg {
    max-width: 100% !important;
    max-height: 250px !important;
    height: auto !important;
    display: block;
    margin: 10px 0;
    border: 1px solid #e2e8f0;
}

/* allow <br> to behave normally but not relied on */
.content-page .help-text br {
    display: inline;
}

/* tables, video, iframe if any */
.content-page .help-text iframe,
.content-page .help-text video {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    margin: 10px 0;
}

.content-page .help-text table {
    width: 100%;
    table-layout: fixed;
    font-size: 0.85em;
    margin: 10px 0;
}
/* =====================================
 Help Text - END
===================================== */

/* =====================================
Generic form layout helpers
===================================== */

.form-group-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.form-group-inline-label {
  flex: 0 0 210px;
  font-size: 15px;
  font-weight: 600;
  color: steelblue;
  padding: 6px 10px;
  border-radius: 8px;
  background-color: #f9fafb;
  border-left: 3px solid #2563eb;
  line-height: 1.4;
}

.form-group-inline-label.required::after {
    content: ' *';
    color: #dc3545;
    font-weight: bold;
}

.form-group-inline-field {
  flex: 1 1 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Base radio appearance reset + custom green style */
.form-group-inline-field input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  margin: 0;
  position: relative;
  cursor: pointer;
  background-color: #ffffff;
  vertical-align: middle;
}

/* Inner dot when checked */
.form-group-inline-field input[type="radio"]::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background-color: transparent;
  transition: background-color 0.18s ease;
}

/* Checked state: green border + filled dot */
.form-group-inline-field input[type="radio"]:checked {
  border-color: #16a34a; /* green */
  background-color: #ecfdf3; /* soft green bg */
}

.form-group-inline-field input[type="radio"]:checked::before {
  background-color: #16a34a; /* green inner dot */
}

/* Label pill around radio + text */
.form-group-inline-field label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  cursor: pointer;
  font-size: 15px; /* was 14px */
  color: #374151;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Hover */
.form-group-inline-field label:hover {
  border-color: #16a34a;
  background-color: #f0fdf4; /* lighter green */
}

/* When the radio inside label is checked, highlight pill */
.form-group-inline-field label:has(input[type="radio"]:checked) {
  border-color: #16a34a;
}

/* Generic form row for text inputs */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  flex: 1 1 auto;
}

.form-group-inline .text-danger {
  flex-basis: 100%;
  align-self: flex-start;
  margin-top: 4px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #b91c1c;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.form-group-inline .text-danger::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background-color: #b91c1c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.text-danger.small {
  display: block;
  font-size: 0.75rem;
  line-height: 1;
  margin-top: 4px;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.text-danger {
  color: #dc3545;
  font-size: 11px;
  margin-top: 4px;
  display: block;
  /* Apply the animation */
  animation: fadeInDown 0.3s ease-out forwards;
}

/* Standard text-like inputs */
.form-row input[type="text"],
.form-row input[type="tel"],
.form-row input[type="email"],
.form-row input[type="number"],
.form-row input[type="radio"],
.form-row input[type="password"],
.form-row input[type="search"],
.form-row input[type="url"],
.form-row input[type="support_mobile"],
.form-row input[type="support_email"],
.form-row select,
.form-row textarea {
  flex: 1 1 220px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 15px;
  box-sizing: border-box;
}

/* For radio/checkbox groups wrapped in a div inside .form-row */
.form-row .option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}

.form-row input[type="text"]:focus,
.form-row input[type="tel"]:focus,
.form-row input[type="email"]:focus,
.form-row input[type="number"]:focus,
.form-row input[type="password"]:focus,
.form-row input[type="search"]:focus,
.form-row input[type="url"]:focus,
.form-row input[type="support_mobile"]:focus,
.form-row input[type="support_email"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.form-group-inline-field.form-group-inline-field--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.form-group-inline-field.form-group-inline-field--stacked label {
  display: flex;        /* keep pill style but full-width row */
  width: 95%;
  border-radius: 6px;   /* a bit less pill-like if you prefer */
}

/* =====================================
Reusable buttons and actions row
===================================== */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;              /* bigger */
  border-radius: 999px;            /* pill shape */
  font-size: 15px;                 /* was 14px */
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.08s ease;
}

/* Primary (Save) */
.btn-primary {
  background: linear-gradient(135deg, #488444, #5ba356); /* Uses #488444 as the base */
  border: 1px solid #488444;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(72, 132, 68, 0.25); /* Shadow matching your color */
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3d703a, #488444); /* Slightly darker on hover */
  box-shadow: 0 4px 12px rgba(72, 132, 68, 0.15);
  transform: translateY(-1px);
  color: #ffffff;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.25);
}

/* Secondary (Back) */
.btn-secondary {
  background-color: #ffffff;
  border-color: #d1d5db;
  color: #374151;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.btn-secondary:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

/* Optional: keyboard focus outline */
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.btn-primary.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

.btn-primary.is-loading::before {
  content: "";
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: #ffffff;
  animation: btn-spin 0.6s linear infinite;
}

.btn-primary.is-loading span {
  opacity: 0.9;
}

.btn-disabled-grey {
    background-color: #cccccc !important;
    border-color: #bbbbbb !important;
    color: #888888 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    pointer-events: none; 
    transition: all 0.3s ease;
}

/* Simple spinner animation */
@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Actions row */
.form-actions {
  margin-top: 20px;
  border-top: 1px solid #e5e7eb;
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* =====================================
Alerts for form messages
===================================== */

.alert {
  position: relative;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px; /* was 14px */
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid transparent;
}

/* Success */
.alert-success {
  background-color: #ecfdf3;
  border-color: #cde9cf;
  color: #166534;
}

/* Error */
.alert-error {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* Icon inside alert */
.alert-icon {
  font-size: 16px;
  margin-top: 2px;
}

.alert-text {
  flex: 1 1 auto;
  line-height: 2;
}

.alert-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.alert-close:hover {
    opacity: 1;
}

/* =====================================
Responsive tweaks for panel + forms
===================================== */

@media (max-width: 768px) {
  #contentArea {
    padding: 8px;
  }

  .content-panel {
    padding: 18px 16px;
    border-radius: 0;
    box-shadow: none;
    border-left: none;
    border-right: none;
  }

  .form-group-inline-label {
    flex: 0 0 100%;
    background-color: transparent;
    color: steelblue;
    border-left-width: 2px;
    padding-left: 8px;
    margin-bottom: 2px;
  }

  .form-group-inline-field {
    flex: 1 1 100%;
  }

  .content-page fieldset {
    padding: 14px;
  }

  .form-actions {
    flex-direction: column-reverse;
    gap: 10px;
    align-items: flex-start;
  }

  .form-row input[type="text"],
  .form-row input[type="tel"],
  .form-row input[type="radio"],
  .form-row input[type="email"],
  .form-row input[type="number"],
  .form-row input[type="password"],
  .form-row input[type="search"],
  .form-row input[type="url"],
  .form-row input[type="support_mobile"],
  .form-row input[type="support_email"] {
    flex: 1 1 100%;
  }
}

/* =====================================
    Copy Button - START
===================================== */
.form-row--with-copy {
  align-items: center;
  gap: 6px;
}

.copy-tip {
  font-size: 12px;
  color: #16a34a;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.copy-tip.visible {
  opacity: 1;
  transform: translateY(0);
}

.copy-btn.copied {
  background: #ecfdf3;
  border-color: #16a34a;
  color: #166534;
}

.copy-btn {
  /* Layout & Sizing */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  
  /* Aesthetics */
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
  
  /* Smooth transition for when the .copied class is added */
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.copy-btn:active {
  transform: scale(0.95);
}


/* =====================================
    Copy Button - END
===================================== */

/* =====================================
    Generic content tables - START
===================================== */
.content-table-wrapper {
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  overflow-x: auto;                  /* horizontal scroll on small screens [web:90][web:91] */
  background-color: #ffffff;
  overflow-x: auto;
}

.content-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 720px; 
}

.content-table thead {
  background: linear-gradient(135deg, #eff6ff, #e5edff);
}

.content-table thead th {
  text-align: left;
  font-weight: 600;
  color: #1f2937;
  padding: 10px 12px;
  border-bottom: 1px solid #d1d5db;
}

.content-table tbody td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  color: #111827;
  vertical-align: top;
  line-height: 1.6;
}

.content-table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

.content-table tbody tr:hover {
  background-color: #f1f5f9;
}

/* Align last column actions to right when using .text-right */
.content-table th.text-right,
.content-table td.text-right {
  text-align: right;
}

/* Last Sync Error cell – wrap but not one-char per line */
.last-sync-cell {
  max-width: 260px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}

/* Muted text utility */
.text-muted {
  color: #6b7280;
  font-size: 13px;
}

/* Small inline buttons (edit/delete) */
.btn-small {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 999px;
  margin-left: 4px;
}

/* Stack Delete below Edit when width is tight */
@media (max-width: 900px) {
  .content-table td.text-right {
    white-space: normal;
  }

  .content-table td.text-right .btn-small {
    display: block;
    width: 100%;
    margin: 0 0 4px 0;
    text-align: center;
  }

  .content-table td.text-right .btn-small:not(:first-child) {
    margin-bottom: 0;
    margin-top: 10px;
  }

}


@media screen and (max-width: 768px) {
  *, *:before, *:after {
        box-sizing: border-box !important;
    }

    /* 2. Lock the Root Containers */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative;
    }

    /* 3. Force the main wrapper to never exceed screen width */
    .content-table-wrapper, 
    .content-panel,
    .content-page {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    /* 4. Fix potential overflow from the Ticket Form rows */
    .form-group-inline, .form-row {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }


    .content-table-wrapper {
        overflow-x: visible !important;
        max-width: 100vw !important;
        overflow-x: hidden !important; /* This stops the right-side extension */
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box;
    }

    .content-table {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        border-collapse: collapse;
        table-layout: fixed !important; /* Prevents content from pushing width */
    }

    /* Hide table header */
    .content-table > thead {
        display: none;
    }

    /* Cards Layout */
    .content-table, 
    .content-table > tbody, 
    .content-table > tbody > tr {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .content-table > tbody > tr {
        margin-bottom: 25px;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        background: #fff;
        padding: 0; 
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        overflow: hidden; 
    }

    .content-panel {
        padding-left: 10px !important;
        padding-right: 10px !important;
        overflow-x: hidden !important;
    }

    /* --- SECTION STYLE FOR CELLS --- */
    .content-table > tbody > tr > td {
        display: block !important; /* Force block to prevent flex-right alignment */
        width: 100% !important;
        padding: 12px 15px;
        border-bottom: 1px solid #f0f0f0;
        text-align: left !important; /* Force text to left */
        box-sizing: border-box;
    }

    /* Section Header Labels */
    .content-table > tbody > tr > td::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        color: #1a3c6c;
        background: #f8f9fa; 
        margin: -12px -15px 10px -15px; 
        padding: 6px 15px;
        border-bottom: 1px solid #eee;
        text-align: left !important;
    }

    /* Internal Data Tables (like Booked On) */
    .content-table td table {
        display: table !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .clean-table > tbody > tr > td {
        line-height: 1.8;
        padding: 2px 0 !important;
        border: none !important;
        display: table-cell !important;
        text-align: left !important;
    }

    /* --- ACTION SECTION FIX --- */
    .content-table > tbody > tr > td:last-child {
        border-bottom: none;
        padding: 15px !important;
        background: #fafafa; 
        display: block !important;
    }

    /* Ensure the action container doesn't inherit flex-between or right-align */
    .content-table > tbody > tr > td:last-child table,
    .content-table > tbody > tr > td:last-child table tbody,
    .content-table > tbody > tr > td:last-child table tr,
    .content-table > tbody > tr > td:last-child table td {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        text-align: left !important;
        border: none !important;
    }

    /* Buttons: Force Full Width and Left Alignment */
    .table-btn, 
    .table-btn-delete {
        display: flex !important;
        width: 100% !important;
        justify-content: flex-start !important; /* Forces icon/text to start of button */
        align-items: center !important;
        padding: 12px 15px !important; 
        margin-bottom: 10px !important;
        box-sizing: border-box;
        border-radius: 6px;
        font-size: 14px;
        text-align: left !important;
        text-decoration: none;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .table-btn i, 
    .table-btn-delete i {
        margin-right: 12px;
        width: 18px;
        text-align: center;
        flex-shrink: 0;
    }

    .content-table > tbody > tr > td::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        color: #1a3c6c;           /* Blue text */
        background: #eef2f7;      /* Very light blue tint */
        margin: -12px -15px 10px -15px;
        padding: 8px 15px;
        border-bottom: 1px solid #d1d9e6;
        border-left: 4px solid #1a3c6c; /* Accent stripe on the left */
    }

    .content-table > tbody > tr > td {
        padding-top: 12px;
        color: #333; /* Ensuring the actual value is dark and readable */
    }

    /* Target the FIRST label in the row to signify the START of a record */
    .content-table > tbody > tr > td:first-child::before {
        background: #1a3c6c !important; /* Deep Blue background */
        color: #ffffff !important;      /* White text */
        font-weight: 800;
        border-bottom: 2px solid #0d264a;
        box-shadow: inset 0 -2px 0 rgba(0,0,0,0.1); /* Subtle depth */
    }

    /* Optional: Give the first cell content (the ID/Title) a slight tint too */
    .content-table > tbody > tr > td:first-child {
        background: #f0f7ff; /* Very light blue background for the primary info cell */
    }

    .no-labels > tbody > tr > td::before {
        display: none !important;
    }

    /* Adjust padding when labels are hidden so the data doesn't look cramped */
    .no-labels > tbody > tr > td {
        padding: 10px 15px !important;
        margin: 0 !important;
    }

    .scrollable-table-wrapper {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
        margin-bottom: 20px;
        border: 1px solid #eee;
        background: #fff;
    }

    /* 2. Force table elements back to their original behavior */
    .scrollable-table-wrapper .content-table {
        display: table !important;
        width: auto !important;
        min-width: 600px; /* Forces the scroll to trigger */
        table-layout: auto !important;
    }

    .scrollable-table-wrapper .content-table thead {
        display: table-header-group !important; /* Show headers again */
    }

    .scrollable-table-wrapper .content-table tbody {
        display: table-row-group !important;
    }

    .scrollable-table-wrapper .content-table tr {
        display: table-row !important;
        border: none !important;
        box-shadow: none !important;
        margin-bottom: 0 !important;
    }

    .scrollable-table-wrapper .content-table td, 
    .scrollable-table-wrapper .content-table th {
        display: table-cell !important;
        white-space: nowrap !important; /* Prevents text stacking */
        padding: 12px 10px !important;
        border-bottom: 1px solid #eee !important;
        text-align: left !important;
    }

    /* 3. Hide the generated data-labels (::before) */
    .scrollable-table-wrapper .content-table td::before {
        display: none !important;
    }

    .content-table-wrapper:not(.scrollable-table-wrapper) .content-table > tbody > tr > td:first-child {
        background: #f0f7ff !important; /* The soft blue tint */
    }

    /* Ensure cells in the Scrollable Table stay white/transparent 
    */
    .scrollable-table-wrapper .content-table td {
        background: transparent !important;
    }

}

@media screen and (max-width: 768px) {
    /* --- PAGINATION WRAPPING FIX --- */
    .pagination {
        display: flex !important;
        flex-wrap: wrap !important; /* The magic fix: allows wrapping */
        justify-content: center !important;
        padding-left: 0;
        margin: 20px 0;
        gap: 5px; /* Adds consistent spacing between wrapped buttons */
    }

    .pagination li {
        display: inline-block !important;
        float: none !important; /* Some frameworks use float, which breaks flex */
    }

    .pagination li a, 
    .pagination li span {
        margin: 2px !important;
        padding: 8px 12px !important;
        display: block;
        min-width: 35px;
        text-align: center;
        border-radius: 4px; /* Makes them look more like tap-friendly buttons */
    }

    /* Optional: Hide 'First' and 'Last' text on very small screens to save space */
    @media (max-width: 400px) {
        .pagination li:first-child a, 
        .pagination li:last-child a {
            font-size: 10px;
            padding: 8px 6px !important;
        }
    }
}


/* Softer danger for delete */
.btn-danger-soft {
  border-color: #fecaca;
  background-color: #fef2f2;
  color: #b91c1c;
}

.btn-danger-soft:hover {
  border-color: #fca5a5;
  background-color: #fee2e2;
}

/* Slightly smaller pill variant for table rows (optional) */
.content-table .status-pill {
  padding: 4px 10px;
  font-size: 13px;
}

/* =====================================
    Generic content tables - END
===================================== */

/* =====================================
    Inner link feedback states - START
====================================== */
.inner-link {
    text-decoration: none;
}

.inner-link-loading {
  opacity: 0.7;
  background-color: #f3f4f6 !important;
  border-color: #9ca3af !important;
}

.inner-link-success {
  background-color: #dbeafe !important;  /* light blue */
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.inner-link-error {
  background-color: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
}

/* Ensure btn-small variants inherit properly */
.inner-link.btn-small.inner-link-success,
.inner-link.btn-small.inner-link-error {
  padding: 6px 12px;  /* slight padding increase during highlight */
}

/* =====================================
    Inner link feedback states - END
====================================== */

/* =====================================
    Duration table - END
====================================== */

.duration-table {
  width: 100%;
  border-collapse: collapse;
}

.duration-table th,
.duration-table td {
  padding: 8px 10px;
  font-size: 13px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.duration-table th {
  font-weight: 600;
  background-color: #f9fafb;
}

.duration-table .duration-price,
.duration-table .duration-effective {
  text-align: left;
  white-space: nowrap;
}

/* generic small-table wrapper */
.table-responsive-sm {
  width: 100%;
  overflow-x: auto;
}

/* duration table: fix min width so columns don't squash */
.duration-table {
  min-width: 420px;  /* adjust if needed */
}

/* mobile tweaks */
@media (max-width: 600px) {
  .duration-table th,
  .duration-table td {
    padding: 6px 8px;
    font-size: 14px;
  }
}

/* =====================================
    Duration table - END
====================================== */

/* =========================
   List pagination bar - START
   ========================= */
.list-pagination-bar {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}


.list-pagination-bar .pagination {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-pagination-bar .pagination a,
.list-pagination-bar .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  color: #374151;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.list-pagination-bar .pagination a:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

.list-pagination-bar .pagination span.current,
.list-pagination-bar .pagination span.active {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
  cursor: default;
}

.list-pagination-bar .pagination a.current,
.list-pagination-bar .pagination a.active {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
}

.list-pagination-bar .pagination li.active span,
.list-pagination-bar .pagination li.active a {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
  cursor: default;
}

@media (max-width: 767px) {
  .list-pagination-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
/* =========================
   List pagination bar - END
   ========================= */

/* =========================
   Plan selection cards - START
   ========================= */
.section-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 12px 0 8px;
}

/* Plan cards */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 4px 0 18px 0;
}

.plan-card {
  position: relative;
  border-radius: 10px;
  padding: 12px 14px 12px 36px; /* room for radio */
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border: 1px solid #e5e7eb;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease,
    transform 0.1s ease;
}

/* radio left */
.plan-card input[type="radio"][name="plan_code"] {
  position: absolute;
  left: 12px;
  top: 14px;
  margin: 0;
}

.plan-card:hover {
  border-color: #bfdbfe;
  background-color: #eff6ff;
  transform: translateY(-1px);
}

.plan-card--selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.45);
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}

.plan-card--current {
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.5);
}

/* header: name + badges */
.plan-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-name {
  font-weight: 600;
  color: #111827;
  font-size: 15px;
}

.plan-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.plan-badge--current {
  border-color: #22c55e;
  background-color: #dcfce7;
  color: #166534;
}

.plan-badge--free {
  border-color: #9ca3af;
  background-color: #f3f4f6;
  color: #4b5563;
}

/* price row */
.plan-card-price {
  font-size: 14px;
  color: #111827;
}

.plan-amount {
  font-weight: 700;
}

.plan-period {
  margin-left: 4px;
  color: #6b7280;
  font-size: 13px;
}

/* bullets / features */
.plan-desc,
.plan-features {
  font-size: 13px;
  color: #374151;
  margin: 2px 0 0 0;
}

.plan-features {
  padding-left: 20px;
  margin-top: 4px;
}

.plan-features li {
  margin-bottom: 3px;      /* tighter but clear spacing */
  line-height: 1.5;        /* more readable bullets */
}
/* =========================
   Plan selection cards - END
   ========================= */

/* =========================
   Generic Tabs - START
   ========================= */
.tabs {
  margin: 10px 0 12px;
  border-bottom: 1px solid #e5e7eb;
}

.tabs-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
}

.tabs-nav-item {
  position: relative;
  padding: 8px 14px;
  cursor: pointer; 
  color: #4b5563;
  border-radius: 999px;
  background-color: #f9fafb; 
  border: 1px solid #e5e7eb;
  transition:
    background-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.tabs-nav-item:hover {
  background-color: #eef2ff;       /* light indigo */
  border-color: #c7d2fe;
  color: #111827;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.tabs-nav-item.is-active {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.tabs-nav-item.is-active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -8px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #22c55e);
}

.tabs-content {
  margin-top: 8px;
}

.tabs-panel {
  display: none;
}

.tabs-panel.is-active {
  display: block;
}
/* =========================
   Generic Tabs - END
   ========================= */

/* =========================
Generic filter panel – START
========================= */
.filter-panel {
  margin-top: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f9fafb 0, #f3f4f6 100%);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Header: title + optional helper text */
.filter-panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.filter-panel-footer {
  display: flex;
  justify-content: flex-end; /* Aligns content to the right */
  gap: 10px;                 /* Space between buttons */
  padding: 15px 20px;
  border-top: 1px solid #eee;
}

.filter-panel-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.filter-panel-sub {
  font-size: 13px;
  color: #6b7280;
}

/* Body: fields arranged in responsive row */
.filter-panel-body {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-end;
}

/* One field (label + input) */
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 170px;
}

.filter-label {
  font-size: 13px;
  color: #4b5563;
}

.filter-input {
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  box-sizing: border-box;
  width: 100%;
}

/* Actions group – aligned to the right on wide screens */
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

/* Separation below filters and before tabs/content */
.tabs-section {
  margin-top: 8px;
}

.filter-title-icon {
  margin-right: 6px;
  color: #2563eb;
}

/* Icon + text inside buttons */
.filter-actions .btn-primary i,
.filter-actions .btn-secondary i {
  margin-right: 6px;
  font-size: 14px;
}

/* Keep text vertically centered */
.filter-actions .btn-primary span,
.filter-actions .btn-secondary span {
  display: inline-block;
}

.filter-input,
.filter-panel-body input[type="date"] {
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  box-sizing: border-box;
}

.filter-input,
.filter-panel input[type="text"],
.filter-panel input[type="date"] {
  height: 36px !important;  /* EXACT target height */
  padding: 7px 12px !important;  /* Match original padding */
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
}

.filter-panel-body input[type="date"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

/* Disabled state for Filter button */
.btn-primary.filter-btn-disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.filter-panel select,
#filter-ticket-status,
#filter-status {
  height: 36px !important;  /* SAME as inputs */
  padding: 0 40px 0 12px !important;  /* Right padding for arrow */
  border: 1px solid #d1d5db !important;  /* SAME border */
  border-radius: 8px !important;
  font-size: 14px !important;  /* SAME font size */
  line-height: 1.4 !important;
  background: #fff;
  color: #222;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  display: flex;
  align-items: center;
  transition: border-color 0.2s ease;
}

/* Unified focus state */
.filter-input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
  outline: none;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25) !important;
}

/* Hover */
.filter-panel select:hover,
#filter-status:hover {
  border-color: #d1d5db;
}

/* Filter field alignment */
.filter-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px; /* Consistent spacing */
}

.filter-label {
  margin-bottom: 4px; /* Tight spacing to match text input */
  font-weight: 500;
  font-size: 14px;
  color: #374151;
}

.filter-panel-body .filter-field {
  min-width: 180px;
  flex: 1;
  max-width: 220px;
}

.filter-panel-body .filter-field.filter-field-wide {
  min-width: 400px;
  max-width: none;
  flex: 2;
}

#filter-toggle-header { 
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
}

#filter-status-text {
    white-space: nowrap;
}

/* Ensure the title doesn't take up full width */
.filter-panel-title {
    width: auto !important;
    display: inline-flex !important;
    align-items: center;
}

@media (min-width: 769px) {
    #filter-collapsible-content {
        display: block !important;
    }
    #filter-chevron {
        transform: rotate(180deg); /* Point up since it is open */
    }
}

.chevron-rotate {
    transform: rotate(180deg) !important;
}

/* Mobile */
@media (max-width: 700px) {
  .filter-panel-body {
    flex-direction: column;
    gap: 12px;
  }
  
}

/* MOBILE FILTER PANEL - FULL RESPONSIVE */
@media (max-width: 768px) {
  .filter-panel {
    padding: 16px !important;
    margin: 12px 0 !important;
  }
  
  .filter-panel-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    margin-bottom: 16px !important;
  }
  
  .filter-panel-body {
    flex-direction: column !important;
    gap: 16px !important;
    align-items: stretch !important;
  }
  
  .filter-field {
    min-width: 100% !important;
    max-width: 100% !important;
  }
  
  .filter-actions {
    margin-left: 0 !important;
    justify-content: center !important;
    width: 100% !important;
    margin-top: 12px !important;
  }
  
  .filter-actions button {
    flex: 1 !important;
    min-width: 100px !important;
  }

  #filter-collapsible-content {
        display: none;
  }
}

@media (max-width: 480px) {
  .filter-panel {
    padding: 14px !important;
  }
  
  .filter-input,
  .filter-panel select {
    height: 44px !important;
  }
  
  .filter-actions {
    flex-direction: column !important;
    gap: 10px !important;
  }
  
  .filter-actions button {
    width: 100% !important;
  }

  #filter-collapsible-content {
        display: none;
  }
}

.btn-minimize {
  background: none;
  border: none;
  color: var(--brand-blue);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 5px;
  transition: transform 0.3s ease;
}

.filter-content-hidden {
  display: none !important;
}

.rotate-180 {
  transform: rotate(180deg);
}

/* Optional: Smooth transition for height */
#filter-content {
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.filters-collapsed {
    display: none !important;
}

.rotate-180 {
    transform: rotate(180deg);
}

/* =========================
Generic filter panel – END
========================= */

/* 🔥 UNIVERSAL FILE UPLOAD - ticketform + ticketview */
.file-upload-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-input {
  display: none;
}

.file-label {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #94a3b8, #64748b) !important;
  color: white !important;
  border-radius: 10px !important;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  font-size: 14px;
  border: none !important;
  text-decoration: none !important;
}

.file-label:hover {
  background: linear-gradient(135deg, #64748b, #475569) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #ecfdf3;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  font-size: 13px;
  max-width: 200px;
  word-break: break-all;
}

.file-remove {
  color: #dc3545;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
}

/* Kill old conflicting styles */
.ticketform input[type="file"] + label,
input[type="file"] + label {
  background: linear-gradient(135deg, #94a3b8, #64748b) !important;
  color: white !important;
  border-radius: 10px !important;
  padding: 12px 20px !important;
}



.file-logo-list {
    margin-top: 10px;
}

/* Style for both the preview and the placeholder to keep sizing consistent */
.file-logo-list .file-preview, 
.file-logo-list .placeholder-box {
    width: 224px;
    height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #cbd5e1; /* Light Slate */
    border-radius: 8px;
    background-color: #f8fafc;
    overflow: hidden;
    position: relative;
}

.file-logo-list .placeholder-box {
    color: #94a3b8;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
}

.logo-preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Prevents stretching of the logo */
}

/* Position remove button specifically for the logo overlay */
.file-logo-list .file-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ef4444;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.existing-file-preview {
    background: #f1f5f9;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    display: inline-block;
}

.pdf-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}



.chart-grid {
    display: flex;
    flex-wrap: wrap; /* Allows charts to move to next line */
    gap: 20px;       /* Space between charts */
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
}

.chart-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-sizing: border-box;
    /* Default for Desktop: Try to fit 3 per row (approx 30% each) */
    flex: 1 1 calc(33.333% - 20px); 
    min-width: 300px; /* If the screen is smaller than 300px, it will stack */
}

.chart-item.wide {
    flex: 2 1 600px; /* Takes up more space than standard charts */
}

.chart-header {
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

/* MOBILE SPECIFIC: 1 Chart per Row */
@media (max-width: 768px) {
    .chart-card {
        flex: 1 1 100%; /* Force full width */
        min-width: 100%;
        margin-bottom: 10px;
    }
    
    .dashboard-flex-grid {
        padding: 10px;
        gap: 15px;
        overflow-x: hidden; /* Disable horizontal scroll */
    }
}

/* Bulk Action Bar Styling - START */
.bulk-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 12px 20px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.selected-count {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

/* Button Group Container */
.btn-group {
    display: inline-flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ff8c00; /* Dark Orange Border */
}

/* Individual Button Base Styles */
.btn-sm-bulk {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    border: none;
    border-right: 1px solid #ff8c00;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    color: #007bff;
}

.btn-sm-bulk:last-child {
    border-right: none;
}

/* Hover States for Outline Buttons */
.btn-outline-primary-bulk:hover, 
.btn-outline-secondary-bulk:hover {
    /*color: #ff8c00;*/
    color: #488444;
    background: #fff7ed; /* Very Light Orange */
}

/* Specific Style for Delete (stays red but with orange tint on hover) */
.btn-outline-danger-bulk:hover {
    color: #ef4444;
    background: #fff1f2;
}

/* The Save Button (Solid Orange) */
.btn-primary-bulk {
    background: #ff8c00; /* Brand Orange */
    color: #ffffff;
}

.btn-primary-bulk:hover {
    background: #e67e00; /* Deeper Orange */
    color: #ffffff;
}



.btn-primary-bulk i {
    color: #ffffff;
}
/* Bulk Action Bar Styling - END */

/* Product Images - START */
.product-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    width: 100%;
}

.image-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.image-card:hover {
    border-color: #488444;
}

.image-preview-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 8px;
}

.image-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-icon {
    font-size: 28px;
    color: #cbd5e1;
}

.upload-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
    width: 100%;
}

.file-name-wrapper {
    flex: 1;
    overflow: hidden;
}

.file-link {
    display: block;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #488444; /* Brand Green */
    text-decoration: none;
}

.btn-upload-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fdfdfd;
    border: 2px dashed #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-upload-placeholder:hover {
    border-color: #488444;
    color: #488444;
    background: #f1f8f1;
}

.btn-remove-file {
    background: #fff1f2;
    color: #e11d48;
    border: none;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-remove-file:hover {
    background: #ffe4e6;
}

.hidden { display: none !important; }

.hidden-btn {
    display: none !important;
    visibility: hidden !important;
}




/* Product Images - END */

/* Inline Button - START */
.btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 12px;               /* Compact for text flow */
  margin: 0 2px;                   /* Tiny gap from surrounding text */
  vertical-align: middle;          /* Aligns perfectly with text baseline */
  border-radius: 4px;              /* Subtle curve rather than full pill for small size */
  font-size: 13px;                 /* Slightly smaller than body text */
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid #e67e22;       /* Base orange border */
  background: linear-gradient(135deg, #f39c12, #e67e22); /* Orange gradient */
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(230, 126, 34, 0.2);
  transition: all 0.2s ease;
  line-height: 1.4;
}

.btn-inline:hover {
  background: linear-gradient(135deg, #e67e22, #d35400); /* Darker orange */
  box-shadow: 0 3px 6px rgba(211, 84, 0, 0.3);
  transform: translateY(-1px);
  color: #ffffff !important;
}

.btn-inline:active {
  transform: translateY(0);
}

/* Inline Button - END */

.int-link-icon, .ext-link-icon {
  font-size:10px;
  /*color:#007bff;*/
  color:gray;
}

/* Table properties for ACTION columns - START */
.clean-table {
  width: 100%;
  border-collapse: collapse;
  border: none;
}

.clean-table tbody {
  border: none;
}

.clean-table tbody tr {
  background-color: transparent !important;
}

/* Remove highlighting from cells (some frameworks target cells) */
.clean-table tbody td {
  background-color: transparent !important;
  border: none;
  line-height: 1.5;
  padding: 6px;
}

/* 2. Make the link fill the entire cell */
.table-btn {
  display: block;      /* Takes up full width */
  width: 100%;         /* Ensures it stretches */
  text-align: center;  /* Centers the text */
  box-sizing: border-box; /* Includes padding in the width calculation */
  padding: 10px 16px;
  background-color: white;
  color: #007bff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  min-width: 150px;   /* Won't get smaller than this */
  max-width: 250px;   /* Won't get larger than this */
  margin: 0 auto;     /* Centers the button if the cell is wider than 250px */
  border-radius: 4px;
  border: 1px solid #ff8c00
}

.table-btn:hover {
  color: #488444;
  background: #fff7ed;
}

/* Active/Click State */
.table-btn:active {
  transform: scale(0.98);
}

.table-btn-delete {
  display: block;      /* Takes up full width */
  width: 100%;         /* Ensures it stretches */
  text-align: center;  /* Centers the text */
  box-sizing: border-box; /* Includes padding in the width calculation */
  padding: 10px 16px;
  background-color: white;
  color: #007bff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  min-width: 150px;   /* Won't get smaller than this */
  max-width: 250px;   /* Won't get larger than this */
  margin: 0 auto;     /* Centers the button if the cell is wider than 250px */
  border-radius: 4px;
  border: 1px solid #ff8c00
}

.table-btn-delete:hover {
  color: #488444;
  background: #fff7ed;
}

/* Active/Click State */
.table-btn-delete:active {
  transform: scale(0.98);
}

/* MOBILE SPECIFIC: */
@media (max-width: 768px) {
    .table-btn-delete {
      min-width: 120px; 
      max-width: 250px;
    }
}

/* Table properties for ACTION columns - END */

.readonly-badge {
    background-color: #f3f4f6 !important; /* Light grey background */
    color: #374151 !important;           /* Darker text for readability */
    border: 1px solid #d1d5db !important;
    font-weight: 600;
    cursor: default;                      /* Show standard arrow instead of text beam */
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    outline: none !important;
    box-shadow: none !important;
}

/* Optional: Make it look blue when a value is calculated */
.readonly-badge:not(:placeholder-shown):not([value=""]) {
    background-color: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1e40af !important;
}


/* Desktop & Base Styles - Courier Estimate and Selection */
.cr-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 16px 0;
    color: #1e293b;
    width: 100%;
}

.cr-table-main {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.cr-th {
    background-color: #f8fafc;
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid #f1f5f9;
}

.cr-td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.cr-brand-flex {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.cr-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px;
    flex-shrink: 0;
}

.cr-name {
    display: block;
    font-size: 20px;
    font-weight: 500;
    color: #0f172a;
    margin-bottom: 6px;
}

.cr-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 4px;
}

.cr-meta {
    display: inline-block;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.cr-meta-price-split {
    display: inline-block;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

.cr-blue-text {
    color: #2563eb;
    font-weight: 500;
}

.cr-price {
    font-weight: 500;
    font-size: 16px;
    white-space: nowrap;
}

.cr-price::before {
    content: "₹ ";
}

.cr-cost-highlight {
    background-color: #fff4ed;
    color: #c2410c;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #ffedd5;
}

.cr-ship-btn {
    background-color: #488444;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
    text-align: center;
    box-sizing: border-box; /* Critical for overflow fix */
}

.cr-advisory {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

/* Promotion Style (Green/Light Blue) */
.cr-promo {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* Warning/Delay Advisory Style (Orange/Red) */
.cr-warning {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

/* Icon styling if you use FontAwesome */
.cr-advisory i {
    font-size: 14px;
}

/* Container for the badge - ensure the parent TD is relative */
.cr-td-relative {
    position: relative;
    overflow: hidden; /* Clips the ribbon if it's too long */
}

.cr-pill-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Green for Cheapest */
.badge-value {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* Blue for Fastest */
.badge-fastest {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

/* Purple or Gold for Highest Delivery Rate */
.badge-reliable {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #e1bee7;
}

.badge-overall {
    background: #fff9c4;
    color: #f57f17;
    border: 1px solid #fff176;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* --- MOBILE VIEW --- */
@media screen and (max-width: 768px) {
    .cr-table-main, .cr-tbody, .cr-tr, .cr-td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .cr-table-main thead { display: none; }

    .cr-tr {
        background: #ffffff;
        margin-bottom: 20px;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 16px;
    }

    .cr-td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0 !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }

    /* Top row (Logo & Name) */
    .cr-td:first-child {
        display: block !important;
        border-bottom: 1.5px solid #e2e8f0 !important;
        padding-bottom: 16px !important;
        margin-bottom: 8px;
    }

    .cr-td:before {
        content: attr(data-label);
        font-weight: 500;
        font-size: 12px;
        color: #94a3b8;
        text-transform: uppercase;
    }

    /* Hide labels for specific rows */
    .cr-td:first-child:before,
    .cr-td[data-label="Action"]:before { display: none; }

    /* Action Row Fix (Button) */
    .cr-td[data-label="Action"] {
        display: block !important; /* Force to block to fill width */
        padding-top: 16px !important;
        border-bottom: none !important;
    }

    .cr-ship-btn {
        display: block; /* Make button fill the width */
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }
    
    .cr-meta-grid {
        flex-direction: column;
        gap: 4px;
    }

    .cr-advisory {
        width: 100%;
        box-sizing: border-box;
    }
}

/* loading */
/* Spinner animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Style for the loading fields */
.loading-field {
    background-color: #f9f9f9 !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="gray" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    animation: spin-bg 1s linear infinite;
    pointer-events: none; /* Prevent user from changing values while loading */
}

/* Rotate the background icon specifically */
.loading-field {
    /* Since we can't rotate background-images easily, 
       an alternative is using an opacity pulse */
    opacity: 0.7;
}

/* Highlight animation for updated fields - START */
@keyframes highlight-fade {
    0% { background-color: #e9f2e8; transform: scale(1.02); } /* Light green and slight pop */
    100% { background-color: transparent; transform: scale(1); }
}

.flash-highlight {
    animation: highlight-fade 1.5s ease-out;
    border-radius: 8px;
}
/* Highlight animation for updated fields - END */

/* Dynamic table - START */
.icarry-table-wrapper {
  width: 100%;
  overflow-x: auto;
  /*margin: 20px 0;*/
}

.icarry-dynamic-table {
  width: 100%;
  border-collapse: collapse;
  font-family: sans-serif;
}

.icarry-dynamic-table th {
  background: #f8f9fa;
  text-align: left;
  padding: 12px;
  border-bottom: 2px solid #dee2e6;
  font-size: 15px;
  color: steelblue;
}

.icarry-dynamic-table td {
  padding: 8px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.ic-input, .ic-select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box; /* Crucial for sizing */
}

.ic-input:focus {
  border-color: #f37021;
  outline: none;
}

.ic-btn-add {
  background: #1a3c6c;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
}

.ic-error {
  color: red;
  font-size: 11px;
  display: block;
}

/* Styling for the dynamic table rows */
.box-row td {
    vertical-align: middle;
    padding: 8px 5px;
}

/* Ensure the inputs inside the table don't look cramped */
.box-row .ic-input {
    min-width: 60px;
}

/* Styling for the Trash/Remove button */
.ic-btn-remove {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.ic-btn-remove:hover {
    background-color: #dc3545;
    color: #fff;
}

/* Responsive Table Logic */
@media screen and (max-width: 600px) {
    .icarry-dynamic-table, 
    .icarry-dynamic-table thead, 
    .icarry-dynamic-table tbody, 
    .icarry-dynamic-table th, 
    .icarry-dynamic-table td, 
    .icarry-dynamic-table tr { 
        display: block; 
    }

    /* Hide table headers on mobile */
    .icarry-dynamic-table thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .box-row {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 8px;
        background: #fff;
    }

    .icarry-dynamic-table td { 
        border: none;
        position: relative;
        padding-left: 50% !important; 
        text-align: right;
        min-height: 40px;
    }

    /* Add labels back using data-label attribute */
    .icarry-dynamic-table td:before { 
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%; 
        padding-right: 10px; 
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: #1a3c6c;
    }
}

/* Dynamic table - END */

/* Address Select - START */
/* Force the selected text to wrap */
.select2-container .select2-selection--single {
    height: auto !important;
    padding: 5px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.4 !important;
}

/* Force the dropdown list items to wrap */
.select2-container--default .select2-results__option {
    white-space: normal !important;
    word-break: break-word !important;
}

/* Make it look consistent with your form fields */
.select2-container--default .select2-selection--single {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
}

.form-row .select2-container {
    width: 100% !important;
    display: block;
}

/* Address Select - END */

/* Container for the insurance block */
.cr-insurance-wrapper {
    background: #f8fbff;
    border: 1px dashed #bcd0f7;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    display: none; 
    cursor: pointer;
    transition: all 0.3s ease;
}

.cr-insurance-wrapper:hover {
    background: #eff5ff;
}

/* Make the radio button huge and clickable */
.cr-courier-select-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 25px;
    padding: 8px 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    color: #666;
}

/* Highlight row when selected */
.cr-tr.selected-row {
    background-color: #f0f7ff;
}

.cr-tr.selected-row .cr-courier-select-btn {
    /*background: #1a3c6c;*/
    color: #fff;
    /*border-color: #1a3c6c;*/
    background: #488444;
    border-color: #488444;
}

/* Hide original inputs but keep them functional */
.cr-td input[type="radio"], 
.cr-td input[type="checkbox"] {
    transform: scale(1.2);
    margin-right: 8px;
    cursor: pointer;
}

input[name="chosen_courier"]:checked + .cr-courier-select-btn {
    background: #007bff;
    color: #fff;
}

.insurance-text {
    font-size: 12px;
    line-height: 1.4;
    color: #444;
}

.cr-courier-select-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

/* 2. Ensure the pill (btn) changes color when the HIDDEN radio is checked */
/* We use the + selector to target the span immediately after the radio */
.cr-courier-select-label input[type="radio"]:checked + .cr-courier-select-btn {
    color: #fff;
    background: #488444;
    border-color: #488444;
}

/* 3. Keep the insurance checkbox visible but tidy */
.insurance-check {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-top: -2px;
}

/* Address scores - START */
/* Container for the score */
.score-container {
    width: 140px;
    margin-top: 5px;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

/* The label text */
.score-text {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

/* The background track */
.score-track {
    background: #e0e0e0;
    height: 6px;
    border-radius: 10px;
    overflow: hidden;
}

/* The colored fill */
.score-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

/* Address scores - END */

/* Shipment tags */
.tag-pill {
  display: inline-flex;
  align-items: center;
  background: #e8f0fe;
  color: #1a73e8;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
  white-space: nowrap;
}
.tag-remove-btn {
  cursor: pointer;
  color: #999;
  font-size: 12px;
  line-height: 1;
  background: none;
  border: none;
  padding: 0;
  margin-left: 2px;
}
.tag-remove-btn:hover { color: #e53e3e; }
.tag-add-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px dashed #aaa;
  border-radius: 12px;
  padding: 2px 7px;
  font-size: 11px;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
}
.tag-add-btn:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.tag-popover {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.14);
  padding: 10px;
  min-width: 200px;
  max-width: 280px;
}
.tag-popover-list {
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 6px;
}
.tag-popover-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 4px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
}
.tag-popover-item:hover { background: #f5f5f5; }
.tag-popover-item.assigned { color: var(--brand-blue); font-weight: 600; }
.tag-popover-create {
  display: flex;
  gap: 6px;
  border-top: 1px solid #eee;
  padding-top: 8px;
}
.tag-popover-create input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  min-width: 0;
}
.tag-popover-create button {
  background: var(--brand-blue);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
/* Shipment tags - END */
