/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* Production UI polish: visual-only normalization across existing Tailwind markup. */
.shadow-lg.shadow-slate-200\/70 {
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.05);
}

/* Reports / MIS overview */
.mis-page { position: relative; color: #0f172a; }
.mis-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; padding-right: 3.5rem; }
.mis-heading h1 { margin: 0; font-size: 2rem; font-weight: 900; letter-spacing: -.035em; }
.mis-heading p { margin: .35rem 0 0; color: #64748b; font-size: .925rem; font-weight: 600; }
.mis-report-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; }
.mis-report-button, .mis-export-button, .mis-apply-button, .mis-reset-button { display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center; border-radius: .65rem; padding: .65rem 1.15rem; font-size: .875rem; font-weight: 800; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.mis-report-button, .mis-reset-button { border: 1px solid #cbd5e1; background: #fff; color: #334155; }
.mis-report-button:hover, .mis-reset-button:hover { background: #f8fafc; border-color: #94a3b8; }
.mis-export-button { background: #059669; color: #fff; box-shadow: 0 5px 14px rgba(5,150,105,.2); }
.mis-export-button:hover { background: #047857; }
.mis-filter-disclosure { margin-bottom: 1.5rem; }
.mis-filter-disclosure:not([open]) { margin-bottom: 0; }
.mis-filter-disclosure > summary { list-style: none; }
.mis-filter-disclosure > summary::-webkit-details-marker { display: none; }
.mis-filter-toggle { position: absolute; top: 0; right: 0; display: grid; width: 2.85rem; height: 2.85rem; place-items: center; border: 1px solid #cbd5e1; border-radius: .65rem; background: #fff; color: #334155; cursor: pointer; box-shadow: 0 4px 12px rgba(15,23,42,.06); }
.mis-filter-toggle:hover, .mis-filter-disclosure[open] .mis-filter-toggle { border-color: #94a3b8; background: #f8fafc; color: #0f172a; }
.mis-filter-toggle svg { width: 1.35rem; height: 1.35rem; fill: currentColor; }
.mis-filter-disclosure .mis-filter-panel { margin-top: .75rem; margin-bottom: 0; }
.report-filter-page { position: relative; }
.report-filter-page > div:first-of-type { padding-right: 3.5rem; }
.report-filter-disclosure > summary { list-style: none; }
.report-filter-disclosure > summary::-webkit-details-marker { display: none; }
.report-filter-toggle { position: absolute; top: 0; right: 0; display: grid; width: 2.85rem; height: 2.85rem; place-items: center; border: 1px solid #cbd5e1; border-radius: .65rem; background: #fff; color: #334155; cursor: pointer; box-shadow: 0 4px 12px rgba(15,23,42,.06); }
.report-filter-toggle:hover, .report-filter-disclosure[open] .report-filter-toggle { border-color: #94a3b8; background: #f8fafc; color: #0f172a; }
.report-filter-toggle svg { width: 1.35rem; height: 1.35rem; fill: currentColor; }
.report-filter-disclosure .report-filter-panel { margin-top: .75rem; }
.report-back-button { display: inline-flex; width: 2.85rem; height: 2.85rem; align-items: center; justify-content: center; border: 1px solid #bfdbfe; border-radius: 999px; background: #fff; color: #2563eb; font-size: 1.35rem; font-weight: 900; line-height: 1; }
.report-back-button:hover { border-color: #60a5fa; background: #eff6ff; color: #1d4ed8; }
.mis-filter-panel { margin-bottom: 1.5rem; border: 1px solid #dbe3ee; border-radius: 1rem; background: #fff; padding: 1.15rem; box-shadow: 0 5px 18px rgba(15,23,42,.05); }
.mis-filter-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)) auto; align-items: end; gap: 1rem; }
.mis-filter-grid label { display: block; margin-bottom: .45rem; color: #64748b; font-size: .72rem; font-weight: 900; letter-spacing: .055em; text-transform: uppercase; }
.mis-filter-grid input, .mis-filter-grid select { width: 100%; min-height: 2.85rem; border: 1px solid #cbd5e1; border-radius: .6rem; background: #fff; padding: .65rem .8rem; color: #1e293b; font-size: .875rem; font-weight: 650; }
.mis-filter-actions { display: flex; align-items: center; gap: .65rem; white-space: nowrap; }
.mis-apply-button { border: 0; background: #2563eb; color: #fff; cursor: pointer; box-shadow: 0 5px 14px rgba(37,99,235,.2); }
.mis-apply-button:hover { background: #1d4ed8; }
.mis-filter-actions .mis-apply-button { width:auto; height:2.85rem; min-width:6.25rem; flex:0 0 auto; padding:.65rem 1.25rem; }
.mis-filter-actions .mis-reset-button { width:2.85rem; height:2.85rem; min-width:2.85rem; min-height:2.85rem; flex:0 0 2.85rem; padding:0; }
.mis-reset-button svg { width:1.25rem; height:1.25rem; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.mis-metric-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.mis-metric-card { min-width: 0; border: 1px solid #dbe3ee; border-radius: 1rem; background: #fff; padding: 1.2rem; box-shadow: 0 6px 20px rgba(15,23,42,.055); }
.mis-metric-icon { display: grid; width: 2.65rem; height: 2.65rem; place-items: center; margin-bottom: 1rem; border-radius: 50%; background: var(--mis-icon-bg); color: var(--mis-icon-color); }
.mis-metric-icon svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mis-metric-label { overflow: hidden; color: #64748b; font-size: .78rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.mis-metric-value { margin-top: .4rem; color: #0f172a; font-size: clamp(1.15rem, 1.55vw, 1.7rem); font-weight: 900; letter-spacing: -.025em; white-space: nowrap; }
.mis-metric-hint { margin-top: .55rem; color: #94a3b8; font-size: .7rem; font-weight: 650; line-height: 1.35; }
.mis-tone-purple { --mis-icon-bg:#f3e8ff; --mis-icon-color:#7e22ce; }
.mis-tone-green { --mis-icon-bg:#dcfce7; --mis-icon-color:#16a34a; }
.mis-tone-orange { --mis-icon-bg:#ffedd5; --mis-icon-color:#f97316; }
.mis-tone-blue { --mis-icon-bg:#dbeafe; --mis-icon-color:#2563eb; }
.mis-tone-violet { --mis-icon-bg:#ede9fe; --mis-icon-color:#7c3aed; }
.mis-tone-cyan { --mis-icon-bg:#cffafe; --mis-icon-color:#0891b2; }
.mis-tone-indigo { --mis-icon-bg:#e0e7ff; --mis-icon-color:#4f46e5; }
.mis-tone-rose { --mis-icon-bg:#ffe4e6; --mis-icon-color:#e11d48; }
.mis-tone-chart-indigo { --mis-icon-bg:#e0e7ff; --mis-icon-color:#4f46e5; }
.mis-tone-chart-cyan { --mis-icon-bg:#cffafe; --mis-icon-color:#0891b2; }
.mis-tone-chart-rose { --mis-icon-bg:#ffe4e6; --mis-icon-color:#e11d48; }
.mis-tone-chart-indigo .mis-metric-value { color:#4f46e5; }
.mis-tone-chart-cyan .mis-metric-value { color:#0891b2; }
.mis-tone-chart-rose .mis-metric-value { color:#e11d48; }
.mis-tone-blue .mis-metric-value { color:#16a34a; }
.mis-tone-violet .mis-metric-value { color:#7c3aed; }
.mis-analytics-grid { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 1.25rem; }
.mis-chart-card { min-width: 0; border: 1px solid #dbe3ee; border-radius: 1rem; background: #fff; padding: 1.25rem; box-shadow: 0 6px 20px rgba(15,23,42,.055); }
.mis-chart-card h2 { margin: 0; color: #1e293b; font-size: 1rem; font-weight: 900; }
.mis-bar-chart { display: flex; height: 18.5rem; align-items: flex-end; justify-content: space-around; gap: 1rem; padding: 2.5rem .5rem 0; border-bottom: 1px solid #dbe3ee; background: repeating-linear-gradient(to bottom, transparent 0, transparent 24.5%, #edf2f7 25%); }
.mis-bar-column { display: flex; height: 100%; min-width: 0; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; }
.mis-bar-value { margin-bottom: .5rem; color: #334155; font-size: .75rem; font-weight: 900; white-space: nowrap; }
.mis-bar-track { display: flex; width: min(5rem, 75%); flex: 1; align-items: flex-end; }
.mis-bar { width: 100%; min-height: .5rem; border-radius: .45rem .45rem 0 0; }
.mis-bar-purchase { background: linear-gradient(180deg,#818cf8,#4f46e5); }
.mis-bar-sales { background: linear-gradient(180deg,#22d3ee,#0891b2); }
.mis-bar-stock { background: linear-gradient(180deg,#fb7185,#e11d48); }
.mis-bar-label { min-height: 3.2rem; padding-top: .75rem; color: #64748b; font-size: .72rem; font-weight: 800; text-align: center; }
.mis-chart-legend { display: flex; justify-content: center; gap: 1.25rem; margin: .85rem 0 .2rem; color: #64748b; font-size: .72rem; font-weight: 800; }
.mis-chart-legend span { display: flex; align-items: center; gap: .4rem; }
.mis-chart-legend i { width: 1.2rem; height: .2rem; border-radius: 999px; }
.mis-legend-margin { background:#22c55e; }.mis-legend-percent { background:#7c3aed; }
.mis-line-chart { min-height: 17rem; display: grid; place-items: center; }
.mis-line-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.mis-line-chart text { fill: #64748b; font-size: 9px; font-weight: 700; }
.mis-grid-line { stroke: #e2e8f0; stroke-width: 1; }
.mis-axis-line { stroke:#cbd5e1; stroke-width:1.2; }
.mis-line-chart .mis-axis-tick { fill:#16a34a; font-size:9px; font-weight:800; }
.mis-line-chart .mis-axis-percent { fill:#7c3aed; }
.mis-line-chart .mis-axis-title { font-size:10px; font-weight:900; letter-spacing:.025em; }
.mis-line-chart .mis-axis-title-margin { fill:#16a34a; }
.mis-line-chart .mis-axis-title-percent { fill:#7c3aed; }
.mis-margin-line, .mis-percent-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mis-margin-line { stroke:#22c55e; }.mis-percent-line { stroke:#7c3aed; }
.mis-margin-point { fill:#fff; stroke:#22c55e; stroke-width:3; }.mis-percent-point { fill:#fff; stroke:#7c3aed; stroke-width:3; }
.mis-customer-card { display: flex; flex-direction: column; }
.mis-customer-table-wrap { flex: 1; overflow-x: auto; margin-top: 1rem; }
.mis-customer-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.mis-customer-table th { color: #64748b; font-size: .67rem; font-weight: 900; letter-spacing: .03em; text-align: left; text-transform: uppercase; }
.mis-customer-table th:nth-child(n+3), .mis-customer-table td:nth-child(n+3) { text-align: right; }
.mis-customer-table th, .mis-customer-table td { border-bottom: 1px solid #eef2f7; padding: .8rem .45rem; }
.mis-customer-table td { color:#334155; font-weight:700; }.mis-customer-table td:nth-child(2) { color:#1e293b; font-weight:850; }
.mis-view-all { display: inline-block; margin-top: 1rem; color:#2563eb; font-size:.78rem; font-weight:900; }
.mis-empty-state, .mis-empty-cell { color:#94a3b8; font-size:.8rem; font-weight:700; text-align:center !important; }
.mis-footnote { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; color: #64748b; font-size: .72rem; font-weight: 600; }
.mis-footnote strong { color:#334155; }

@media (max-width: 1500px) {
  .mis-metric-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .mis-analytics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mis-customer-card { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .mis-heading { flex-direction: column; }
  .mis-report-links { justify-content: flex-start; }
  .mis-filter-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .mis-heading h1 { font-size:1.75rem; }
  .mis-report-links { display:grid; width:100%; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .mis-filter-grid, .mis-metric-grid, .mis-analytics-grid { grid-template-columns:1fr; }
  .mis-filter-actions { grid-column:auto; }
  .mis-customer-card { grid-column:auto; }
  .mis-metric-card { display:grid; grid-template-columns:auto 1fr; column-gap:1rem; }
  .mis-metric-icon { grid-row:1 / 4; margin:0; }
  .mis-metric-value, .mis-metric-hint { grid-column:2; }
  .mis-bar-chart { height:15rem; }
  .mis-footnote { flex-direction:column; }
}

button,
a,
input,
select,
textarea {
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  min-height: 2.5rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgb(37 99 235);
  box-shadow: none !important;
}

thead.bg-blue-50,
thead.bg-slate-50 {
  background-color: rgb(248 250 252);
  color: rgb(100 116 139);
  font-weight: 600;
  letter-spacing: 0.025em;
}

thead.bg-blue-50 th,
thead.bg-slate-50 th {
  font-weight: 600;
}

tr.hover\:bg-blue-50\/50:hover,
tr.hover\:bg-slate-50:hover {
  background-color: rgb(248 250 252);
}

.rounded-xl.border.border-slate-200.bg-white,
.rounded-lg.border.border-slate-200.bg-white {
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.05);
}

.bg-blue-600,
.bg-emerald-600,
.bg-rose-600 {
  font-weight: 600;
}

.border.border-slate-300,
.ring-1.ring-slate-200 {
  font-weight: 600;
}

/* Shared filter/search bar layout. View-only; preserves existing form fields and params. */
.filter-grid,
.filter-search-grid {
  display: grid;
  gap: 0.75rem;
  align-items: end;
}

.filter-grid {
  grid-template-columns: 1fr;
}

.filter-search-grid {
  grid-template-columns: 1fr;
}

.filter-actions {
  display: flex;
  align-items: end;
  gap: 0.5rem;
  white-space: nowrap;
}

.filter-actions > a,
.filter-actions > input,
.filter-actions > button {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
}

.filter-actions > .filter-reset-icon {
  width: 2.75rem;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: .65rem;
  background: #fff;
  color: #334155;
}

.filter-reset-icon:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.filter-reset-icon svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.orders-filter-grid {
  align-items: end;
}

@media (min-width: 1400px) {
  .orders-filter-grid {
    grid-template-columns: minmax(8rem, .85fr) minmax(8rem, .85fr) minmax(8rem, .9fr) minmax(9rem, 1fr) minmax(9rem, 1fr) minmax(8rem, .9fr) minmax(10rem, 1.1fr) auto;
  }
}

@media (min-width: 768px) {
  .filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  }

  .filter-search-grid {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  height: 100vh;
  width: 85vw;
  max-width: 320px;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 250ms ease;
  will-change: transform;
}

.app-sidebar.open {
  transform: translateX(0);
}

.app-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgb(15 23 42 / 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.app-sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-open {
  overflow: hidden;
}
/* Customer Details two-row ERP layout. Scoped to the shared component only. */
.customer-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: end;
}

.customer-details-field {
  min-width: 0;
}

.customer-details-field input,
.customer-details-field select,
.customer-details-field [data-product-search-wrapper],
.customer-details-field [data-product-search-wrapper] input {
  width: 100%;
}

@media (min-width: 768px) {
  .customer-details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .customer-details-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .customer-details-existing { grid-column: span 4 / span 4; }
  .customer-details-lab { grid-column: span 3 / span 3; }
  .customer-details-contact { grid-column: span 3 / span 3; }
  .customer-details-phone { grid-column: span 2 / span 2; }
  .customer-details-city { grid-column: span 2 / span 2; }
  .customer-details-gst { grid-column: span 2 / span 2; }
  .customer-details-address { grid-column: span 4 / span 4; }
  .customer-details-payment { grid-column: span 4 / span 4; }
}
/* App-wide table scrolling: keep page chrome stable and scroll table content inside cards. */
.overflow-x-auto:has(> table) {
  max-height: var(--app-table-max-height);
  overflow: auto;
}

.overflow-x-auto:has(> table) thead {
  position: sticky;
  top: 0;
  z-index: 10;
}
/* Responsive app density and scroll behavior across phone, tablet, laptop and desktop. */
:root {
  --app-table-max-height: min(60vh, 34rem);
}

.app-main {
  width: 100%;
  max-width: 112rem;
  min-width: 0;
  margin-inline: auto;
}

.app-main > section,
.app-main > form,
.app-main > div {
  min-width: 0;
}

.app-main .grid,
.app-main .flex {
  min-width: 0;
}

/* Shared resilience for long customer names, identifiers, URLs and currency values. */
.app-main p,
.app-main td,
.app-main dd,
.app-main a,
.app-main span {
  overflow-wrap: anywhere;
}

.app-main img,
.app-main svg {
  max-width: 100%;
}

.app-main input,
.app-main select,
.app-main textarea {
  max-width: 100%;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid rgb(37 99 235);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none !important;
  border-color: rgb(37 99 235);
  box-shadow: none !important;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.overflow-x-auto:has(> table) {
  width: 100%;
  max-width: 100%;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.overflow-x-auto:has(> table)::-webkit-scrollbar {
  height: 0.65rem;
  width: 0.65rem;
}

.overflow-x-auto:has(> table)::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgb(148 163 184);
  background-clip: padding-box;
}

.mobile-filter-toggle {
  display: none;
}

.orders-summary-filter-layout {
  display: contents;
}

@media (max-width: 639px) {
  .orders-summary-filter-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.875rem;
    margin-bottom: 0.875rem;
  }

  .orders-summary-filter-layout .orders-summary-grid {
    display: contents !important;
  }

  .orders-summary-filter-layout .orders-summary-grid > div {
    min-width: 0;
    margin: 0 !important;
  }

  .orders-summary-filter-layout .orders-summary-grid > div:last-child {
    grid-column: 1 / -1;
  }

  .orders-summary-filter-layout .orders-filter-form {
    grid-column: 1 / -1;
    margin: 0 !important;
  }

  .mobile-filter-toggle {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    margin-left: auto;
    margin-bottom: 0.75rem;
    place-items: center;
    border: 1px solid rgb(203 213 225);
    border-radius: 0.65rem;
    background: white;
    color: rgb(51 65 85);
    cursor: pointer;
  }

  .mobile-filter-heading .mobile-filter-toggle {
    flex: 0 0 2.75rem;
    margin: 0 0 0 auto;
  }

  .mobile-filter-toggle svg {
    width: 1.35rem;
    height: 1.35rem;
    fill: currentColor;
  }

  .mobile-filter-form:not(.mobile-filter-open) {
    display: none !important;
    padding: 0 !important;
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .mobile-filter-form:not(.mobile-filter-open) .mobile-filter-toggle {
    margin-bottom: 0;
  }

  .mobile-filter-form:not(.mobile-filter-open) > .filter-grid,
  .mobile-filter-form:not(.mobile-filter-open) > .filter-search-grid {
    display: none !important;
  }

  .app-main {
    padding: 0.75rem !important;
  }

  .app-topbar-inner {
    min-height: 4rem !important;
    gap: 0.5rem !important;
    padding: 0.625rem 0.75rem !important;
  }

  .app-global-search {
    flex-basis: 100%;
  }

  header [data-user-menu] button,
  header [data-notifications-toggle],
  header [data-sidebar-toggle] {
    height: 2.25rem !important;
  }

  .app-main h1 {
    font-size: 1.5rem !important;
    line-height: 2rem !important;
  }

  .app-main .mb-5 {
    margin-bottom: 0.875rem !important;
  }

  .app-main .gap-5 {
    gap: 0.875rem !important;
  }

  .app-main .gap-4 {
    gap: 0.75rem !important;
  }

  .app-main .p-5 {
    padding: 0.875rem !important;
  }

  .app-main .px-5 {
    padding-left: 0.875rem !important;
    padding-right: 0.875rem !important;
  }

  .app-main .py-4 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }

  .app-main .px-4 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .app-main .py-3 {
    padding-top: 0.625rem !important;
    padding-bottom: 0.625rem !important;
  }

  .app-main .grid-cols-2 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .app-main .text-3xl {
    font-size: 1.5rem !important;
    line-height: 2rem !important;
  }

  .app-main .text-2xl {
    font-size: 1.25rem !important;
    line-height: 1.75rem !important;
  }

  .filter-actions {
    width: 100%;
  }

  .filter-actions > a,
  .filter-actions > input,
  .filter-actions > button {
    flex: 1 1 0;
  }

  .app-main form > .flex.justify-end,
  .app-main form > .flex.flex-wrap.justify-end,
  .app-main .sticky.bottom-0.flex {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .app-main form > .flex.justify-end > *,
  .app-main form > .flex.flex-wrap.justify-end > *,
  .app-main .sticky.bottom-0.flex > * {
    width: 100%;
    margin-left: 0 !important;
    text-align: center;
  }

  .app-main nav {
    overflow-x: auto;
    white-space: nowrap;
  }

  .app-main .overflow-x-auto:has(> table) {
    max-height: none;
    border-bottom: 1px solid rgb(203 213 225);
  }

  .app-main .overflow-x-auto:has(> table) thead {
    position: static;
  }

  .app-main .overflow-x-auto:has(> table) th:first-child,
.app-main .overflow-x-auto:has(> table) td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: white;
  box-shadow: 1px 0 0 rgb(226 232 240);
}

/* Keep the read-only Call Logs table legible on narrow phone screens. */
.call-logs-results-table {
  min-width: 980px;
  width: 100%;
  table-layout: auto;
}

.call-logs-results-table th {
  white-space: nowrap;
}

.call-logs-results-table th:nth-child(1),
.call-logs-results-table td:nth-child(1) {
  min-width: 120px;
  white-space: nowrap;
}

.call-logs-results-table th:nth-child(2),
.call-logs-results-table td:nth-child(2) {
  min-width: 210px;
}

.call-logs-results-table th:nth-child(3),
.call-logs-results-table td:nth-child(3) {
  min-width: 160px;
}

.call-logs-results-table th:nth-child(4),
.call-logs-results-table td:nth-child(4) {
  min-width: 220px;
}

.call-logs-results-table th:nth-child(5),
.call-logs-results-table td:nth-child(5) {
  min-width: 125px;
  white-space: nowrap;
}

.call-logs-results-table th:nth-child(6),
.call-logs-results-table td:nth-child(6) {
  min-width: 145px;
  white-space: nowrap;
}

.call-logs-results-table th:nth-child(7),
.call-logs-results-table td:nth-child(7) {
  min-width: 120px;
  white-space: nowrap;
}

  .app-main .overflow-x-auto:has(> table) thead th:first-child {
    z-index: 3;
    background: rgb(248 250 252);
  }

  .app-main .overflow-x-auto:has(> table) tbody tr:hover td:first-child {
    background: rgb(248 250 252);
  }

  /* Editable tables must scroll as one row so every field remains usable on phones. */
  .app-main .overflow-x-auto:has(> table input, > table select, > table textarea) th:first-child,
  .app-main .overflow-x-auto:has(> table input, > table select, > table textarea) td:first-child {
    position: static;
    box-shadow: none;
  }

  .app-main button,
  .app-main a.rounded-lg,
  .app-main input[type="submit"] {
    min-height: 2.75rem;
  }

  [data-user-menu-panel] {
    position: fixed !important;
    top: 3.75rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto !important;
    max-width: 24rem;
    margin-left: auto;
  }

  [data-notifications-panel] {
    padding: 1rem !important;
  }

  .app-main [class*="min-w-["] {
    max-width: none;
  }

  :root {
    --app-table-max-height: min(48vh, 26rem);
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .app-main {
    padding: 1rem !important;
  }

  .app-main .p-5 {
    padding: 1rem !important;
  }

  .app-main .gap-5 {
    gap: 1rem !important;
  }

  .app-main .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  :root {
    --app-table-max-height: min(54vh, 30rem);
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .app-main {
    padding: 1rem 1.25rem !important;
  }

  .app-main .p-5 {
    padding: 1rem !important;
  }

  .app-main .gap-5 {
    gap: 1rem !important;
  }

  .app-main .px-5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .app-main .py-4 {
    padding-top: 0.875rem !important;
    padding-bottom: 0.875rem !important;
  }

  .app-main .px-4 {
    padding-left: 0.875rem !important;
    padding-right: 0.875rem !important;
  }

  .app-main .py-3 {
    padding-top: 0.625rem !important;
    padding-bottom: 0.625rem !important;
  }

  .app-main .lg\:grid-cols-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .app-main .lg\:grid-cols-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .app-main .text-3xl {
    font-size: 1.625rem !important;
    line-height: 2.125rem !important;
  }

  .app-main .text-2xl {
    font-size: 1.375rem !important;
    line-height: 1.875rem !important;
  }

  :root {
    --app-table-max-height: min(52vh, 30rem);
  }
}

@media (min-width: 1280px) {
  :root {
    --app-table-max-height: min(62vh, 38rem);
  }
}

.order-summary-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.order-summary-card {
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-summary-card > div:last-child,
.order-summary-card a {
  overflow-wrap: anywhere;
}

.order-items-mobile {
  display: none;
}

@media (min-width: 640px) {
  .order-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) and (max-width: 1279px) {
  .order-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .order-summary-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .order-summary-card {
    padding: 1rem !important;
  }
}

.order-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.order-action-left,
.order-action-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.order-action-right {
  justify-content: flex-end;
}

.invoice-actions-dropdown {
  position: relative;
}

.invoice-actions-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  list-style: none;
}

.invoice-actions-toggle::-webkit-details-marker {
  display: none;
}

.invoice-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.375rem);
  z-index: 50;
  min-width: 12rem;
  overflow: hidden;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.25rem;
  box-shadow: 0 14px 30px rgb(15 23 42 / 0.14);
}

.invoice-actions-item {
  display: block;
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  color: rgb(51 65 85);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}

.invoice-actions-item:hover,
.invoice-actions-item:focus {
  background: rgb(239 246 255);
  color: rgb(29 78 216);
}

@media (max-width: 767px) {
  .order-detail-page {
    overflow: hidden;
  }

  .order-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .order-action-left,
  .order-action-right {
    width: 100%;
  }

  .order-action-right {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .order-action-left > *,
  .order-action-right > a,
  .order-action-right > button,
  .order-action-right > form,
  .order-action-right > form > button,
  .order-action-right > details,
  .order-action-right summary {
    width: 100%;
  }

  .order-action-left > a,
  .order-action-right > a,
  .order-action-right > button,
  .order-action-right > form > button,
  .order-action-right summary {
    align-items: center;
    display: flex;
    justify-content: center;
    text-align: center;
  }

  .invoice-actions-dropdown {
    position: relative;
  }

  .invoice-actions-menu {
    left: 0;
    right: 0;
    min-width: 0;
    width: 100%;
  }

  .order-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.75rem;
  }

  .order-summary-card {
    padding: 0.875rem !important;
  }

  .order-summary-card:first-child,
  .order-summary-card:last-child {
    grid-column: 1 / -1;
  }

  .order-detail-page .space-y-5,
  .order-detail-page .space-y-3,
  .order-detail-page .leading-6,
  .order-detail-page a {
    overflow-wrap: anywhere;
  }

  .order-detail-page .order-items-scroll {
    max-height: none;
  }

  .order-detail-page .order-items-mobile {
    display: block;
  }

  .order-detail-page .order-items-mobile dl {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .order-detail-page .order-items-desktop {
    display: none;
  }

  .order-detail-page .order-items-scroll table {
    min-width: 780px;
  }

  .order-detail-page .order-items-scroll th,
  .order-detail-page .order-items-scroll td {
    white-space: nowrap;
  }

  .order-detail-page .order-history-card table {
    min-width: 640px;
  }

  .order-detail-page form .flex.items-end,
  .order-detail-page form .flex.flex-wrap.gap-2 {
    align-items: stretch;
    flex-direction: column;
  }

  .order-detail-page form .flex.items-end > *,
  .order-detail-page form .flex.flex-wrap.gap-2 > * {
    width: 100%;
    text-align: center;
  }
}

/* Dashboard metric presentation. */
.dashboard-overview {
  min-height: calc(100vh - 9rem);
  padding: 0.25rem;
}

.dashboard-watermark {
  position: absolute;
  top: -5rem;
  right: -2rem;
  width: 30rem;
  max-width: 48vw !important;
  opacity: 0.035;
  pointer-events: none;
  user-select: none;
}

.dashboard-metric-card {
  position: relative;
  min-height: 12.5rem;
  overflow: hidden;
  border: 1px solid rgb(226 232 240);
  border-radius: 1.25rem;
  background: white;
  padding: 2rem;
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.06);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.dashboard-metric-card::after {
  content: "";
  position: absolute;
  right: -12%;
  bottom: -45%;
  width: 88%;
  height: 70%;
  border-radius: 50% 0 0 0;
  background: var(--metric-tint);
  opacity: 0.72;
  transform: rotate(-8deg);
}

.dashboard-metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgb(15 23 42 / 0.1);
}

.dashboard-metric-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.dashboard-metric-icon {
  display: grid;
  flex: 0 0 auto;
  width: 4.75rem;
  height: 4.75rem;
  place-items: center;
  border-radius: 1rem;
  background: var(--metric-tint);
  color: var(--metric-accent);
  font-size: 2rem;
  font-weight: 900;
}

.dashboard-metric-value {
  color: rgb(15 23 42);
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.dashboard-metric-label {
  margin-top: 0.75rem;
  color: rgb(100 116 139);
  font-size: 0.95rem;
  font-weight: 700;
}

@media (max-width: 639px) {
  .dashboard-watermark {
    top: -1rem;
    right: -3rem;
    width: 16rem;
    max-width: 70vw !important;
  }

  .dashboard-metric-card {
    min-height: 10.5rem;
    padding: 1.25rem;
  }

  .dashboard-metric-content {
    gap: 1rem;
  }

  .dashboard-metric-icon {
    width: 3.75rem;
    height: 3.75rem;
    font-size: 1.5rem;
  }

  .dashboard-metric-label {
    margin-top: 0.4rem;
  }

}
