/* ==========================================================================
   WAREHOUSE INVENTORY MANAGEMENT SYSTEM — CORE STYLESHEET
   ==========================================================================
   Structure:
     1. Design tokens (custom properties)
     2. Reset & base
     3. Typography
     4. Layout helpers (container, grid, form-grid)
     5. Buttons
     6. Forms
     7. Tables
     8. Badges (stock status)
     9. Alerts
    10. Cards / panels
    11. Pagination
    12. Utility classes
    13. Responsive
    14. Accessibility
    15. Chat / discussion thread
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  /* -- Core palette -------------------------------------------------- */
  --ink: #1b222c;            /* primary text */
  --steel-700: #4b5563;      /* secondary text */
  --steel-500: #66707d;      /* muted text / placeholders */
  --steel-300: #d7dce3;      /* borders */
  --steel-200: #e8eaed;      /* dividers, subtle borders */
  --steel-100: #f1f2f5;      /* hover backgrounds */
  --canvas: #f4f5f7;         /* page background */
  --surface: #ffffff;        /* card / input / table background */

  --primary: #2955a3;        /* actions, links, focus */
  --primary-hover: #1f4483;
  --primary-active: #17356a;
  --primary-light: #e8eefa;  /* tints, selected rows */

  /* -- Semantic / status colors (tied to stock states) ---------------- */
  --success: #2f8558;
  --success-light: #e7f4ee;
  --danger: #c23b3b;
  --danger-light: #fbebeb;
  --warning: #8a5a0a;
  --warning-light: #fbf1e2;
  --info: #2955a3;
  --info-light: #e8eefa;

  /* -- Typography ------------------------------------------------------ */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.8125rem;  /* 13px */
  --text-base: 0.875rem; /* 14px — body/table default */
  --text-md: 0.9375rem;  /* 15px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.375rem;   /* 22px */
  --text-2xl: 1.75rem;   /* 28px */

  --leading-tight: 1.25;
  --leading-normal: 1.5;

  /* -- Spacing scale (4px base) ---------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;

  /* -- Radius / elevation / motion -------------------------------------- */
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-pill: 0;

  --shadow-sm: 0 1px 2px rgba(27, 34, 44, 0.06);
  --shadow-md: 0 2px 10px rgba(27, 34, 44, 0.08);
  --shadow-focus: 0 0 0 3px rgba(41, 85, 163, 0.18);

  --transition: 140ms ease;
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

hr {
  border: none;
  border-top: 1px solid var(--steel-200);
  margin: var(--space-6) 0;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-2xl);  margin-bottom: var(--space-6); }
h2 { font-size: var(--text-xl);   margin-bottom: var(--space-5); }
h3 { font-size: var(--text-lg);   margin-bottom: var(--space-4); }
h4 { font-size: var(--text-md);   margin-bottom: var(--space-3); }
h5 { font-size: var(--text-base); margin-bottom: var(--space-2); }
h6 { font-size: var(--text-sm);   margin-bottom: var(--space-1); }

p {
  margin: 0 0 var(--space-3);
  color: var(--steel-700);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.text-muted   { color: var(--steel-500); }
.text-secondary { color: var(--steel-700); }
.text-sm      { font-size: var(--text-sm); }
.text-xs      { font-size: var(--text-xs); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }

/* Tabular numerals for anything that counts (quantities, prices, SKUs) */
.num {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.95em;
}

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--steel-500);
}

/* ==========================================================================
   4. LAYOUT HELPERS
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.stack > * + * {
  margin-top: var(--space-4);
}

.cluster {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4) var(--space-5);
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

/* ==========================================================================
   5. BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 36px;
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
    color var(--transition), box-shadow var(--transition);
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* -- Variants ---------------------------------------------------------- */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:active:not(:disabled) { background: var(--primary-active); border-color: var(--primary-active); }

.btn-secondary {
  background: var(--surface);
  border-color: var(--steel-300);
  color: var(--ink);
}
.btn-secondary:hover:not(:disabled) { background: var(--steel-100); border-color: var(--steel-300); }

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline:hover:not(:disabled) { background: var(--primary-light); }

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #a53131; border-color: #a53131; }

.btn-danger-outline {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-light); }

.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.btn-success:hover:not(:disabled) { background: #256e48; border-color: #256e48; }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--steel-700);
}
.btn-ghost:hover:not(:disabled) { background: var(--steel-100); color: var(--ink); }

/* -- Sizes --------------------------------------------------------------- */
.btn-sm {
  height: 30px;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.btn-lg {
  height: 42px;
  padding: 0 var(--space-5);
  font-size: var(--text-md);
}

/* -- Icon-only buttons (table row actions, etc.) -------------------------- */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--steel-700);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn-icon:hover:not(:disabled) { background: var(--steel-100); color: var(--ink); }
.btn-icon.btn-icon-danger:hover:not(:disabled) { background: var(--danger-light); color: var(--danger); }

.btn-icon svg { width: 16px; height: 16px; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-block {
  width: 100%;
}

/* ==========================================================================
   6. FORMS
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-label .optional {
  font-weight: 400;
  color: var(--steel-500);
  margin-left: var(--space-1);
}

.form-control,
select.form-control,
textarea.form-control,
.form-select {
  width: 100%;
  height: 38px;
  padding: 0 var(--space-3);
  background: var(--surface);
  border: 1px solid var(--steel-300);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-size: var(--text-base);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control::placeholder {
  color: var(--steel-500);
}

.form-control:hover,
.form-select:hover {
  border-color: var(--steel-500);
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
  background: var(--steel-100);
  color: var(--steel-500);
  cursor: not-allowed;
}

textarea.form-control {
  height: auto;
  min-height: 90px;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  resize: vertical;
}

.form-control-sm,
.form-select-sm {
  height: 32px;
  padding: 0 var(--space-2);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.form-control-inline {
  width: auto;
}

/* Selects — both our .form-control selects and Bootstrap's .form-select —
   share the same sharp-edged look and custom dropdown arrow. */
select.form-control,
.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%237A8492' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 10px 6px;
  padding-right: var(--space-8);
}

/* Small selects keep the arrow tucked a little tighter. */
select.form-control-sm,
.form-select-sm {
  background-position: right var(--space-2) center;
  padding-right: var(--space-6);
}

.form-help {
  font-size: var(--text-xs);
  color: var(--steel-500);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--danger);
  font-weight: 500;
}

/* -- Validation states --------------------------------------------------- */
.form-control.is-invalid {
  border-color: var(--danger);
}
.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(194, 59, 59, 0.15);
}

.form-control.is-valid {
  border-color: var(--success);
}
.form-control.is-valid:focus {
  box-shadow: 0 0 0 3px rgba(47, 133, 88, 0.15);
}

/* -- Input group (prefix / suffix, e.g. currency, unit) ------------------ */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control {
  border-radius: 0;
}

.input-group .form-control:first-child { border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.input-group .form-control:last-child { border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  background: var(--steel-100);
  border: 1px solid var(--steel-300);
  color: var(--steel-700);
  font-size: var(--text-base);
  white-space: nowrap;
}

.input-group-text:first-child {
  border-right: none;
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.input-group-text:last-child {
  border-left: none;
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

/* -- Checkbox / radio ------------------------------------------------------ */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-check label {
  font-size: var(--text-base);
  color: var(--ink);
  cursor: pointer;
}

/* -- File input ------------------------------------------------------------ */
.form-file {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border: 1px dashed var(--steel-300);
  border-radius: var(--radius-md);
  background: var(--steel-100);
}

/* -- Fieldset ---------------------------------------------------------------- */
fieldset {
  border: 1px solid var(--steel-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: 0;
}

legend {
  padding: 0 var(--space-2);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--ink);
}

/* -- Form actions (footer row of a form) -------------------------------------- */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--steel-200);
  margin-top: var(--space-2);
}

/* ==========================================================================
   7. TABLES
   ========================================================================== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--steel-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
}

.table thead th {
  position: sticky;
  top: 0;
  background: var(--steel-100);
  color: var(--steel-700);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--steel-300);
  white-space: nowrap;
}

.table thead th.text-right { text-align: right; }

.table th.sortable {
  cursor: pointer;
  user-select: none;
}

.table th.sortable .sort-arrow {
  display: inline-block;
  margin-left: var(--space-1);
  opacity: 0.4;
}

.table th.sortable.is-active .sort-arrow {
  opacity: 1;
  color: var(--primary);
}

.table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--steel-200);
  color: var(--ink);
  vertical-align: middle;
}

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

.table tbody tr:nth-child(even) {
  background: var(--canvas);
}

.table tbody tr:hover {
  background: var(--primary-light);
}

.table .cell-primary {
  font-weight: 600;
  color: var(--ink);
}

.table .cell-secondary {
  display: block;
  font-size: var(--text-xs);
  color: var(--steel-500);
  font-weight: 400;
}

.table .cell-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-1);
}

.table-empty {
  padding: var(--space-10) var(--space-4);
  text-align: center;
  color: var(--steel-500);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--steel-200);
  flex-wrap: wrap;
}

.table-toolbar .search-input {
  max-width: 280px;
}

/* ==========================================================================
   8. BADGES (stock / order status)
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--info-light);    color: var(--info); }
.badge-neutral { background: var(--steel-100);      color: var(--steel-700); }

/* ==========================================================================
   9. ALERTS
   ========================================================================== */
.alert {
  display: block;                 /* normal flowing text, not flex items */
  position: relative;
  padding: var(--space-3) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
}

.alert svg {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  margin-right: var(--space-2);
}

/* Keep alert text as a simple flowing row, not stacked columns. */
.alert strong {
  display: inline;
  margin-bottom: 0;
}

/* Dismissible alerts: × pinned to the right, vertically centered. */
.alert-dismissible {
  padding-right: var(--space-8);
}
.alert-dismissible .btn-close {
  position: absolute;
  top: 50%;
  right: var(--space-3);
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
}

/* File inputs: center the "Choose file" button + filename vertically. */
input[type="file"].form-control,
input[type="file"].form-control-sm {
  display: flex;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
  line-height: normal;
}
input[type="file"].form-control::file-selector-button,
input[type="file"].form-control-sm::file-selector-button {
  margin-right: var(--space-2);
  align-self: center;
}

.alert p {
  margin: 0;
  color: inherit;
  opacity: 0.85;
  font-size: var(--text-sm);
}

.alert-success { background: var(--success-light); border-color: #cbe7d7; color: var(--success); }
.alert-danger  { background: var(--danger-light);  border-color: #f2caca; color: var(--danger); }
.alert-warning { background: var(--warning-light); border-color: #f2ddb3; color: var(--warning); }
.alert-info    { background: var(--info-light);    border-color: #c9d9f2; color: var(--info); }

.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.alert-close:hover { opacity: 1; }

/* ==========================================================================
   10. CARDS / PANELS
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--steel-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* Sharp edges everywhere — align with the app theme. */
.card,
.card-header,
.card-footer,
.card-img,
.card-img-top,
.card-img-bottom,
.modal-content,
.list-group,
.list-group-item,
.dropdown-menu {
  border-radius: 0 !important;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-5);
  padding-right: var(--space-6);
  padding-bottom: var(--space-4);
  padding-left: var(--space-6);
  border-bottom: 1px solid var(--steel-200);
}

.card-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-md);
  font-weight: 600;
}

.card-subtitle {
  margin: 2px 0 0;
  font-size: var(--text-sm);
  color: var(--steel-500);
}

.card-body {
  padding-top: var(--space-4);
  padding-right: var(--space-6);
  padding-bottom: var(--space-6);
  padding-left: var(--space-6);
}

.card-footer {
  padding-top: var(--space-4);
  padding-right: var(--space-6);
  padding-bottom: var(--space-5);
  padding-left: var(--space-6);
  border-top: 1px solid var(--steel-200);
}

/* ==========================================================================
   11. PAGINATION
   ========================================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  flex-wrap: wrap;
}

.pagination-info {
  font-size: var(--text-sm);
  color: var(--steel-500);
}

.pagination-list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--steel-700);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
}

.page-link:hover { background: var(--steel-100); text-decoration: none; }

.page-link.is-active {
  background: var(--primary);
  color: #fff;
}

.page-link.is-disabled {
  color: var(--steel-300);
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   12. UTILITY CLASSES
   ========================================================================== */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   13. RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  .container { padding: 0 var(--space-4); }

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

  .card-body,
  .card-header,
  .card-footer {
    padding: var(--space-4);
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-toolbar .search-input {
    max-width: none;
  }

  .pagination {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pagination-list {
    justify-content: center;
  }
}

/* ==========================================================================
   14. ACCESSIBILITY
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:focus-visible,
.form-control:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   15. CHAT / DISCUSSION THREAD
   ========================================================================== */
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.chat-row {
  display: flex;
}

.chat-row-sent     { justify-content: flex-end; }
.chat-row-received { justify-content: flex-start; }

.chat-bubble {
  max-width: 75%;
  padding: var(--space-3) var(--space-4);
}

.chat-bubble-sent {
  background: var(--primary);
  color: #fff;
}

.chat-bubble-received {
  background: var(--steel-100);
  color: var(--ink);
}

.chat-meta {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.chat-bubble-sent .chat-meta     { color: rgba(255, 255, 255, 0.75); }
.chat-bubble-received .chat-meta { color: var(--steel-500); }

.chat-text {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

/* -- Composer (message input + send) -------------------------------------- */
.chat-composer {
  display: flex;
  align-items: flex-start;
  border: 1px solid var(--steel-300);
  background: var(--surface);
}

.chat-composer:focus-within {
  border-color: var(--primary);
}

.chat-composer-input {
  flex: 1;
  min-height: 90px;
  padding: var(--space-3) var(--space-4);
  border: none;
  outline: none;
  resize: vertical;
  font: inherit;
  font-size: var(--text-base);
  color: var(--ink);
  background: transparent;
}

.chat-composer-input::placeholder {
  color: var(--steel-500);
}

.chat-send-btn {
  flex-shrink: 0;
  border: none;
  border-left: 1px solid var(--steel-300);
  background: transparent;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.chat-send-btn:hover  { background: var(--primary-light); }
.chat-send-btn:active { background: var(--info-light); color: var(--primary-active); }

@media (max-width: 768px) {
  .chat-bubble { max-width: 88%; }
  .chat-send-btn { padding: var(--space-3) var(--space-3); }
}
/* ---------------------------------------------------------------
   Global page width cap — every page's .container (content + navbar)
   is limited to 1200px so all screens share one consistent width.
   Small screens are unaffected (max-width only caps; it never forces).
   --------------------------------------------------------------- */
.container {
  max-width: 1200px;
}

/* ---------------------------------------------------------------
   Fill the full 1200px width on content/list/dashboard pages.
   These wrap their content in a centered col-md-9/10/11; widen that
   wrapper to 100% so the page matches the request pages (mx-auto 1200).
   Form pages (col-md-7/8) intentionally keep a narrower column for
   readability (this also keeps the login/register forms sensible).
   More specific than Bootstrap's .col-md-* so it wins the cascade.
   --------------------------------------------------------------- */
.row.justify-content-center > .col-md-9,
.row.justify-content-center > .col-md-10,
.row.justify-content-center > .col-md-11 {
  width: 100%;
  max-width: 100%;
  flex: 0 0 100%;
}

/* Alpine cloak — hide x-show elements until Alpine initializes */
[x-cloak] { display: none !important; }

/* Clickable cards: never show the anchor underline on hover (the whole card is the target) */
a:has(.card):hover,
a:has(.card),
a.hub-tile,
a.hub-tile:hover,
a.pa-card,
a.pa-card:hover,
a.text-reset:hover {
  text-decoration: none !important;
}
