/* ================================================
   PsManager.Server — App Styles
   Pure CSS: theme variables, element base styles,
   component classes, and utility classes.
   ================================================ */

/* ---- 1. CSS Custom Properties ---- */
:root {
  --color-paper: #f6f6f6;
  --color-paper-50: #ffffff;
  --color-paper-100: #f8f8f8;
  --color-paper-200: #f6f6f6;
  --color-paper-300: #f2f2f2;
  --color-paper-400: #f0f0f0;
  --color-paper-500: #e9e9e9;
  --color-paper-600: #e5e5e5;
  --color-paper-700: #e3e3e3;
  --color-paper-800: #d5d5d5;
  --color-paper-900: #c9c9c9;
  --color-paper-950: #c0c0c0;

  --color-content: #242424;

  --color-accent: #0165e1;
  --color-accent-50: #e0eeff;
  --color-accent-100: #c4deff;
  --color-accent-200: #8cbffe;
  --color-accent-300: #54a0fe;
  --color-accent-400: #1c81fe;
  --color-accent-500: #0165e1;
  --color-accent-600: #0153b8;
  --color-accent-700: #014190;
  --color-accent-800: #002e67;
  --color-accent-900: #001c3f;
  --color-accent-950: #00132a;
  --color-accent-content: #ffffff;

  --shadow-r: 1px 0 3px 0 rgb(0 0 0 / 0.1), 1px 0 2px -1px rgb(0 0 0 / 0.1);
  --shadow-r-md: 4px 0 6px -1px rgb(0 0 0 / 0.1), 2px 0 4px -2px rgb(0 0 0 / 0.1);
  --shadow-r-lg: 10px 0 15px -3px rgb(0 0 0 / 0.1), 4px 0 6px -4px rgb(0 0 0 / 0.1);

  /* Standard colors used as utilities */
  --color-gray-50:  #f9fafb; --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb; --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af; --color-gray-500: #6b7280;
  --color-gray-600: #4b5563; --color-gray-700: #374151;
  --color-gray-800: #1f2937; --color-gray-900: #111827;
  --color-green-50: #f0fdf4; --color-green-100: #dcfce7;
  --color-green-300: #86efac; --color-green-600: #16a34a;
  --color-green-700: #15803d; --color-green-800: #166534;
  --color-red-50:   #fef2f2; --color-red-100: #fee2e2;
  --color-red-200:  #fecaca; --color-red-300: #fca5a5;
  --color-red-500:  #ef4444; --color-red-600: #dc2626;
  --color-red-700:  #b91c1c; --color-red-800: #991b1b;
  --color-amber-50: #fffbeb; --color-amber-100: #fef3c7;
  --color-amber-300: #fcd34d; --color-amber-800: #92400e;
  --color-amber-900: #78350f;
  --color-blue-50:  #eff6ff; --color-blue-100: #dbeafe;
  --color-blue-200: #bfdbfe; --color-blue-600: #2563eb;
  --color-blue-700: #1d4ed8; --color-blue-800: #1e40af;
  --color-blue-900: #1e3a8a;
  --color-sky-50:   #f0f9ff; --color-sky-200: #bae6fd;
  --color-sky-800:  #075985;
  --color-indigo-600: #4f46e5; --color-indigo-700: #4338ca;
  --color-purple-100: #f3e8ff; --color-purple-600: #9333ea;
  --color-purple-700: #7e22ce; --color-purple-800: #6b21a8;
  --color-orange-50: #fff7ed; --color-orange-100: #ffedd5;
  --color-orange-800: #9a3412;
  --color-yellow-50: #fefce8; --color-yellow-100: #fef9c3;
  --color-yellow-200: #fef08a; --color-yellow-600: #ca8a04;
  --color-yellow-700: #a16207; --color-yellow-800: #854d0e;
  --color-emerald-600: #059669; --color-emerald-700: #047857;
  --color-slate-50:  #f8fafc; --color-slate-200: #e2e8f0;
  --color-slate-700: #334155;
}

/* ---- 2. Base Reset & Styles ---- */

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 13px; }

body {
  margin: 0;
  color: var(--color-content);
  font-family: InterVariable, ui-sans-serif, system-ui, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  background-color: var(--color-paper);
  line-height: 1.5;
}

/* Dotnet compile error workaround */
#dotnet-compile-error:empty { visibility: hidden; display: none; }

/* ---- 3. Element Base Styles ---- */

/* Headings */
h1 { font-size: 1.875rem; font-weight: 900; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem;   font-weight: 700; margin-bottom: 0.5rem; }
h3 { font-size: 1.25rem;  font-weight: 600; margin-bottom: 0.5rem; }
h4 { font-size: 1.125rem; font-weight: 500; margin-bottom: 0.5rem; }

/* Links */
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

/* Labels */
label {
  font-weight: 500;
  color: var(--color-content);
  display: block;
  margin-bottom: 0.125rem;
}

/* Text inputs */
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="text"] {
  border-radius: 0.25rem;
  padding: 0.25rem 0.25rem 0 0.25rem;
  font-weight: 500;
  border: 1px solid rgb(36 36 36 / 0.2);
  color: var(--color-content);
  background-color: #fff;
  width: auto;
  height: auto;
  margin-bottom: 0;
  font-size: inherit;
  font-family: inherit;
}
input[type="password"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
input[type="text"]:hover {
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
input[type="password"]:read-only,
input[type="email"]:read-only,
input[type="tel"]:read-only,
input[type="text"]:read-only {
  background-color: var(--color-paper-300);
  color: rgb(36 36 36 / 0.7);
  border-color: rgb(36 36 36 / 0.1);
  box-shadow: none;
}

/* Select */
select {
  border-radius: 0.25rem;
  padding: 0.25rem 0.25rem 0 0.25rem;
  border: 1px solid rgb(36 36 36 / 0.2);
  color: var(--color-content);
  background-color: #fff;
  font-size: inherit;
  font-family: inherit;
  height: auto;
  margin-bottom: 0;
}

/* Textarea */
textarea {
  border-radius: 0.25rem;
  border: 1px solid rgb(36 36 36 / 0.2);
  font-size: inherit;
  font-family: inherit;
  margin-bottom: 0;
}

/* Checkbox */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--color-paper-500);
  margin: 0;
  width: 1.15em;
  height: 1.15em;
  border-radius: 0.25rem;
  border: 1px solid rgb(36 36 36 / 0.2);
  vertical-align: middle;
  flex-shrink: 0;
  cursor: pointer;
  display: inline-block;
  position: relative;
}
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
input[type="checkbox"]:checked {
  background-color: var(--color-accent);
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
  border-color: var(--color-accent);
}
input[type="checkbox"]:disabled:checked {
  background-color: var(--color-accent-100);
  border-color: var(--color-accent-100);
}
input[type="checkbox"]:disabled {
  border-color: rgb(36 36 36 / 0.1);
  background-color: var(--color-paper-300);
  cursor: not-allowed;
}

label.checkbox {
  position: relative;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
}
label.checkbox:has(input[type="checkbox"]:disabled) > span {
  opacity: 0.8;
  cursor: not-allowed;
}

/* Tables */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: inherit;
  margin-bottom: 0;
}

/* Buttons */
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  display: inline-block;
  line-height: inherit;
}

p { margin-bottom: 0; }

/* hr */
hr {
  border: none;
  border-top: 1px solid rgb(36 36 36 / 0.1);
  margin: 0;
}

/* ---- 4. Component Classes ---- */

/* --- 4.0 Cross-page patterns --- */

/* Page content wrapper */
.page-content {
  height: 100%;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Section panel (card-like container used in Stock pages) */
.section-panel {
  border-radius: 0.75rem;
  border: 1px solid var(--color-gray-200);
  background-color: #ffffff;
  padding: 1rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

/* Section header (title + count/action) */
.section-header {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Action row (Edit/Delete buttons at end of table row) */
.action-row { display: flex; justify-content: flex-end; gap: 0.5rem; }

/* Inline alerts */
.alert-success {
  border-radius: 0.25rem;
  border: 1px solid var(--color-green-300);
  background-color: var(--color-green-50);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-green-800);
}
.alert-error {
  border-radius: 0.25rem;
  border: 1px solid var(--color-red-300);
  background-color: var(--color-red-50);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-red-800);
}
.alert-warning-inline {
  border-radius: 0.25rem;
  border: 1px solid var(--color-amber-300);
  background-color: var(--color-amber-50);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-amber-900);
}

/* Stock CRUD buttons */
.btn-create {
  border-radius: 0.25rem;
  background-color: var(--color-blue-600);
  padding: 0.5rem 1rem;
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}
.btn-create:hover { background-color: var(--color-blue-700); }
.btn-save {
  border-radius: 0.25rem;
  background-color: var(--color-emerald-600);
  padding: 0.5rem 1rem;
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}
.btn-save:hover { background-color: var(--color-emerald-700); }
.btn-cancel {
  border-radius: 0.25rem;
  border: 1px solid var(--color-gray-300);
  padding: 0.5rem 1rem;
  background: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}
.btn-cancel:hover { background-color: var(--color-gray-50); }
.btn-edit-row {
  border-radius: 0.25rem;
  border: 1px solid var(--color-gray-300);
  padding: 0.375rem 0.75rem;
  background: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}
.btn-edit-row:hover { background-color: var(--color-gray-50); }
.btn-delete-row {
  border-radius: 0.25rem;
  border: 1px solid var(--color-red-300);
  padding: 0.375rem 0.75rem;
  color: var(--color-red-700);
  background: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}
.btn-delete-row:hover { background-color: var(--color-red-50); }
.btn-delete-row:disabled { cursor: not-allowed; opacity: 0.5; }

/* Filter/form inputs in CRUD pages (larger padding than default inputs) */
.filter-input {
  border-radius: 0.25rem;
  border: 1px solid var(--color-gray-300);
  padding: 0.5rem 0.75rem;
  background-color: #ffffff;
  color: var(--color-content);
  font-size: inherit;
  font-family: inherit;
}
.filter-input:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; }

/* Stock CRUD table */
.stock-table { width: 100%; font-size: 0.875rem; border-collapse: separate; border-spacing: 0; }
.stock-table thead tr { border-bottom: 1px solid var(--color-gray-200); text-align: left; color: var(--color-gray-600); }
.stock-table th, .stock-table td { padding: 0.5rem; }
.stock-table th:last-child { text-align: right; }
.stock-table tbody tr { border-bottom: 1px solid var(--color-gray-200); }
.stock-table tbody tr:last-child { border-bottom: none; }
.stock-table td.empty { padding: 1rem 0.5rem; text-align: center; color: var(--color-gray-500); }

/* Toast notification (centered overlay) */
.toast {
  position: fixed;
  min-width: 20rem;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  z-index: 50;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  border: 1px solid var(--color-gray-300);
  font-size: 1rem;
  animation: fadeInFast 0.1s ease-out;
  background-color: rgb(229 231 235 / 0.7);
  color: var(--color-gray-900);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

/* Error icon inside toast */
.toast > i {
  color: var(--color-red-600);
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* Badges — semantic status pills shared across components */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge.pill    { border-radius: 9999px; }
.badge.success { background-color: var(--color-green-100);  color: var(--color-green-800); }
.badge.warning { background-color: var(--color-yellow-100); color: var(--color-yellow-800); }
.badge.danger  { background-color: var(--color-red-100);    color: var(--color-red-800); }
.badge.info    { background-color: var(--color-blue-100);   color: var(--color-blue-800); }
.badge.neutral { background-color: var(--color-gray-100);   color: var(--color-gray-600); }
.badge.muted   { background-color: var(--color-gray-100);   color: var(--color-gray-800); }
.badge.special { background-color: var(--color-purple-100); color: var(--color-purple-800); }
.badge.partial { background-color: var(--color-orange-100); color: var(--color-orange-800); }
.badge.notice  { background-color: var(--color-amber-100);  color: var(--color-amber-800); }
.badge.sky     { background-color: var(--color-sky-50);     color: var(--color-sky-800); border: 1px solid var(--color-sky-200); }

/* Badge count (notification bubble on nav icon) */
.badge-count {
  position: absolute;
  top: 0.25rem;
  right: -0.25rem;
  background-color: var(--color-red-500);
  color: #ffffff;
  font-size: 0.75rem;
  border-radius: 9999px;
  padding: 0 0.375rem;
  text-align: center;
  min-width: 20px;
  line-height: 1.4;
}

/* Bootstrap Icons bold variant */
.bi-b {
  -webkit-text-stroke-width: 0.5px;
}

.validation-message {
  color: var(--color-red-500);
  font-size: 0.875rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgb(36 36 36 / 0.1);
  border-radius: 0.5rem;
  padding: 0 1rem 1px;
  font-weight: 500;
  background-color: var(--color-paper-50);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  cursor: pointer;
  line-height: 1.5rem;
  color: var(--color-content);
  font-size: inherit;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  background-color: rgb(36 36 36 / 0.1);
  text-decoration: none;
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.btn.btn-lg {
  padding: 0.5rem 1rem;
}
.btn.btn-xl {
  padding: 1rem 1.5rem;
}
.btn.btn-primary {
  color: var(--color-accent-content);
  background: linear-gradient(to top, var(--color-accent-600), var(--color-accent-400));
  border-color: transparent;
}
.btn.btn-primary:hover {
  background: linear-gradient(to top, var(--color-accent-500), var(--color-accent-300));
  color: var(--color-accent-content);
}
.btn.btn-link {
  background: transparent;
  border: none;
  color: var(--color-accent);
  box-shadow: none;
}
.btn.btn-link:hover {
  background: transparent;
  box-shadow: none;
}
.btn.btn-danger {
  color: var(--color-accent-content);
  background: linear-gradient(to top, var(--color-red-600), var(--color-red-400, #f87171));
  border-color: transparent;
}
.btn.btn-danger:hover {
  background: linear-gradient(to top, var(--color-red-500), var(--color-red-300, #fca5a5));
  color: var(--color-accent-content);
}

/* Alert */
.alert-warning {
  background-color: #fde047;
  color: var(--color-content);
  border-radius: 0.5rem;
  border: 4px solid rgb(0 0 0 / 0.2);
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
}
.alert-warning::before {
  font-size: 2.25rem;
  margin-right: 1rem;
  content: "\F33B";
  font-family: "Bootstrap-icons";
  -webkit-text-stroke-width: 0.5px;
  flex-shrink: 0;
}

/* Form layout: vertical → 2-col grid at md */
.form-layout {
  display: flex;
  flex-direction: column;
}
.form-layout > label {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}
.form-layout > label > span {
  font-size: 0.875rem;
  font-weight: 400;
  display: block;
  margin-top: -0.25rem;
}
.form-layout > input[type="email"],
.form-layout > input[type="tel"],
.form-layout > input[type="password"],
.form-layout > input[type="text"] {
  margin-bottom: 1.5rem;
}
.form-layout > .validation-message {
  font-size: 0.875rem;
  margin-top: -1.5rem;
  padding-bottom: 0.25rem;
}
@media (min-width: 48rem) {
  .form-layout {
    display: grid;
    grid-template-columns: [label] max-content [field] auto;
  }
  .form-layout > label {
    margin-bottom: 0.5rem;
    margin-right: 0.5rem;
    text-align: right;
    grid-column: label;
    grid-row: auto / span 2;
  }
  .form-layout > input[type="email"],
  .form-layout > input[type="tel"],
  .form-layout > input[type="password"],
  .form-layout > input[type="text"] {
    grid-column: field;
  }
  .form-layout > .validation-message {
    grid-column: field;
  }
  .form-layout > .label-column { grid-column: label; }
  .form-layout > .field-column { grid-column: field; }
}

/* Segmented control */
.segmented {
  display: flex;
  justify-content: center;
}
.segmented > ul {
  background-color: var(--color-paper-500);
  display: flex;
  flex-direction: row;
  border-radius: 0.5rem;
  max-width: fit-content;
  flex-wrap: wrap;
  justify-content: space-between;
  border-top: 1px solid rgb(36 36 36 / 0.1);
  border-bottom: 1px solid rgb(36 36 36 / 0.1);
  list-style: none;
  margin: 0;
  padding: 0;
}
.segmented > ul > li {
  font-weight: 500;
  padding: 0.125rem 0.75rem;
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  border-right: 1px solid transparent;
  border-left: 1px solid transparent;
}
.segmented > ul > li:first-child {
  border-radius: 0.5rem 0 0 0.5rem;
  border-left: 1px solid rgb(36 36 36 / 0.1);
}
.segmented > ul > li:last-child {
  border-radius: 0 0.5rem 0.5rem 0;
  border-right: 1px solid rgb(36 36 36 / 0.1);
}
.segmented > ul > li::after {
  content: "";
  position: absolute;
  bottom: 0;
  top: 0;
  right: 0;
  height: 60%;
  margin: auto 0;
  border-right: 1px solid rgb(36 36 36 / 0.2);
}
.segmented > ul > li:last-child::after { border: none; }
.segmented > ul > li:has(.active) {
  border-radius: 0.5rem;
  background-color: var(--color-paper-50);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  border-right: 1px solid rgb(36 36 36 / 0.3);
  border-left: 1px solid rgb(36 36 36 / 0.3);
}
.segmented > ul > li:has(.active)::after { border: none; }
.segmented > ul > li:has(+ li .active)::after { border: none; }

/* Popup (CSS-only dropdown via checkbox) */
.popup {
  position: relative;
  width: fit-content;
  display: flex;
  min-width: 2rem;
}
.popup::after {
  content: "x";
  width: 0;
  visibility: hidden;
  padding: 0.125rem 0;
  border: 1px solid transparent;
}
.popup > label > input[type="checkbox"] { display: none; }
.popup > label:has(> input[type="checkbox"]:not(:checked)) {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.popup > label:has(> input[type="checkbox"]:not(:checked))::after {
  content: "\F283";
  font-family: "Bootstrap-icons";
  -webkit-text-stroke-width: 0.5px;
  position: absolute;
  right: 0.312rem;
  top: 0.187rem;
  bottom: 0.187rem;
  display: flex;
  align-items: center;
  padding: 0.25rem;
  max-height: 2rem;
  border-radius: 0.375rem;
  border: 1px solid rgb(36 36 36 / 0.3);
  background: linear-gradient(to top, var(--color-paper-300), var(--color-paper-100));
}
.popup > label:has(> input[type="checkbox"]:checked) {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}
.popup ul:has(+ label > input[type="checkbox"]) {
  background-color: var(--color-paper-50);
  border-radius: 0.5rem;
  width: fit-content;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 1px solid rgb(36 36 36 / 0.3);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  list-style: none;
  margin: 0;
  padding: 0;
}
.popup ul:has(+ label > input[type="checkbox"]) > li {
  visibility: hidden;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 0;
  padding-left: 0.5rem;
  padding-right: 2.5rem;
}
.popup ul:has(+ label > input[type="checkbox"]) > li:has(.active) {
  visibility: visible;
  height: auto;
  padding: 0.125rem 0.5rem;
}
.popup ul:has(+ label > input[type="checkbox"]:checked) {
  position: absolute;
  background-color: var(--color-paper-500);
  border-radius: 0.5rem;
  width: fit-content;
  z-index: 10;
  top: -1rem;
  padding: 0.25rem;
}
.popup ul:has(+ label > input[type="checkbox"]:checked) > li {
  visibility: visible;
  height: auto;
  padding: 0.125rem 0.25rem 0.125rem 1.5rem;
  width: 100%;
  border-radius: 0.25rem;
}
.popup ul:has(+ label > input[type="checkbox"]:checked) > li:has(.active) {
  position: relative;
}
.popup ul:has(+ label > input[type="checkbox"]:checked) > li:has(.active)::before {
  content: "\F633";
  font-family: "Bootstrap-icons";
  -webkit-text-stroke-width: 0.5px;
  position: absolute;
  left: 0.375rem;
}
.popup ul:has(+ label > input[type="checkbox"]:checked) > li:hover {
  background-color: var(--color-accent-500);
  color: var(--color-accent-content);
}
.popup ul:has(+ label > input[type="checkbox"]:checked) > li > * { width: 100%; }

/* Tab content */
.tab-content {
  position: relative;
  background-color: var(--color-paper-400);
  border-radius: 0.5rem;
  border: 1px solid rgb(36 36 36 / 0.2);
}
.tab-content > .tab-control {
  position: absolute;
  margin: auto;
  min-width: 100%;
  left: 0;
  right: 0;
  top: -1rem;
}
.tab-content > .tab-control .popup { margin-left: 1rem; }

/* Card */
.card {
  background-color: rgb(255 255 255 / 0.7);
  border-radius: 1rem;
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.08);
  border: 1px solid rgb(36 36 36 / 0.2);
  transition: all 0.2s;
  outline: 1px solid rgb(36 36 36 / 0.2);
  display: flex;
  flex-direction: column;
}
.card:hover { border-color: var(--color-accent-500); }
.card.highlighted {
  outline: 2px solid #fde68a;
  background-color: rgb(255 247 237 / 0.8);
}
.card.selected {
  outline: 2px solid var(--color-accent-200);
}
.card.selected:hover { outline-color: var(--color-accent-500); }

/* Table */
.table {
  background-color: var(--color-paper-50);
  border: 1px solid rgb(36 36 36 / 0.2);
  border-radius: 0.5rem;
  padding: 0 0.5rem;
  overflow: auto;
}
.table > table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.table > table > thead > tr > th {
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  position: relative;
  background-color: var(--color-paper-50);
  text-align: left;
  border-bottom: 1px solid rgb(36 36 36 / 0.2);
}
.table > table > thead > tr > th:first-child { border-radius: 0.5rem 0 0 0; }
.table > table > thead > tr > th:last-child  { border-radius: 0 0.5rem 0 0; }
.table > table > thead > tr > th::after {
  content: "";
  position: absolute;
  bottom: 0;
  top: 0;
  right: 0;
  height: 60%;
  margin: auto 0;
  border-right: 1px solid rgb(36 36 36 / 0.2);
}
.table > table > thead > tr > th:last-child::after { border: none; }
.table > table > tbody > tr:nth-of-type(even) > td {
  background-color: var(--color-paper-300);
}
.table > table > tbody > tr:nth-of-type(odd) > td {
  background-color: var(--color-paper-50);
}
.table > table > tbody > tr:hover > td {
  background-color: var(--color-paper-800);
}
.table > table > tbody > tr > td {
  padding: 0.5rem 0.75rem;
  position: relative;
}
.table > table > tbody > tr > td:first-child { border-radius: 0.5rem 0 0 0.5rem; }
.table > table > tbody > tr > td:last-child  { border-radius: 0 0.5rem 0.5rem 0; }
.table > table > tbody > tr.active:nth-of-type(even) > td {
  background-color: var(--color-accent-600);
  color: var(--color-accent-content);
}
.table > table > tbody > tr.active > td {
  background-color: var(--color-accent-500);
  color: var(--color-accent-content);
}
.table > table > tbody > tr.active:hover > td {
  background-color: var(--color-accent-700);
}

/* Page title inside the main header (h1 + optional subtitle) */
.page-title {
  display: flex;
  align-items: center;
}
.page-title h1 {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
  margin: 0 0 0 0.5rem;
}
.page-title > span {
  font-weight: 600;
  color: var(--color-gray-600);
  margin-left: 0.5rem;
}
/* Variant: title left, action link right */
.page-title.spread {
  justify-content: space-between;
  width: 100%;
  padding-right: 0.5rem;
}

/* Mobile bottom navigation bar (Shopify pages) */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #ffffff;
  border-top: 1px solid var(--color-gray-200);
  box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.05), 0 -2px 4px -2px rgb(0 0 0 / 0.05);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 6rem;
  z-index: 40;
}
@media (min-width: 48rem) {
  .mobile-nav { display: none; }
}

.mobile-nav > div {
  flex: 1;
  display: flex;
  justify-content: center;
}

.mobile-nav-link {
  position: relative;
  width: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0;
  transition: color 150ms;
  color: var(--color-gray-500);
  text-decoration: none;
}
.mobile-nav-link:hover { color: var(--color-blue-500); text-decoration: none; }
.mobile-nav-link.active { color: var(--color-blue-600); font-weight: 700; }
.mobile-nav-link i { font-size: 1.25rem; line-height: 1.75rem; }
.mobile-nav-link > span:last-child { font-size: 0.75rem; }

/* Scrollable main area of Shopify pages */
.page-scroll {
  overflow-y: auto;
  height: 100%;
  flex: 1;
}
@media (min-width: 48rem) {
  .page-scroll { padding: 1rem; }
}

/* Informational message when nothing can be shown */
.no-permission {
  font-size: 1.125rem;
  color: var(--color-gray-600);
}

/* ---- 5. Utility Classes ---- */

/* --- 5.1 Display --- */
.flex        { display: flex; }
.grid        { display: grid; }
.block       { display: block; }
.inline-block { display: inline-block; }
.hidden      { display: none; }

/* --- 5.2 Flex / Grid --- */
.flex-col     { flex-direction: column; }
.flex-1       { flex: 1 1 0%; }


/* --- 5.3 Alignment --- */
.items-center   { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-stretch { justify-content: stretch; }

/* --- 5.4 Gap --- */
.gap-2   { gap: 0.5rem; }
.gap-4   { gap: 1rem; }
.gap-8   { gap: 2rem; }

/* Vertical spacing shorthand */

/* --- 5.5 Padding --- */
.p-4   { padding: 1rem; }
.p-8   { padding: 2rem; }

.px-4   { padding-left: 1rem;     padding-right: 1rem; }

.py-2   { padding-top: 0.5rem;   padding-bottom: 0.5rem; }

.pt-4  { padding-top: 1rem; }

/* --- 5.6 Margin --- */
.m-auto { margin: auto; }

.mx-4   { margin-left: 1rem;  margin-right: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.my-2   { margin-top: 0.5rem;  margin-bottom: 0.5rem; }
.my-4   { margin-top: 1rem;    margin-bottom: 1rem; }

.mt-2   { margin-top: 0.5rem; }
.mt-3   { margin-top: 0.75rem; }
.mt-4   { margin-top: 1rem; }

.mb-1   { margin-bottom: 0.25rem; }
.mb-2   { margin-bottom: 0.5rem; }
.mb-3   { margin-bottom: 0.75rem; }
.mb-4   { margin-bottom: 1rem; }

.ml-2   { margin-left: 0.5rem; }
.mr-1   { margin-right: 0.25rem; }


/* --- 5.7 Sizing --- */
.w-full   { width: 100%; }
.w-0      { width: 0; }
.w-5      { width: 1.25rem; }
.w-56     { width: 14rem; }
.w-80     { width: 20rem; }
.w-100    { width: 100%; }

.h-full   { height: 100%; }
.h-100    { height: 100%; }
.h-5      { height: 1.25rem; }
.h-56     { height: 14rem; }


.max-w-lg  { max-width: 32rem; }




/* --- 5.8 Typography --- */
.text-xs   { font-size: 0.75rem;  line-height: 1rem; }
.text-sm   { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg   { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl   { font-size: 1.25rem;  line-height: 1.75rem; }
.text-2xl  { font-size: 1.5rem;   line-height: 2rem; }

.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-weight-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.text-center { text-align: center; }
.text-right  { text-align: right; }


.truncate       { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* --- 5.9 Colors — Text --- */
.text-content    { color: var(--color-content); }
.text-white      { color: #ffffff; }
.text-accent-500 { color: var(--color-accent-500); }
.text-content\/50 { color: rgb(36 36 36 / 0.5); }

.text-gray-500   { color: var(--color-gray-500); }
.text-gray-600   { color: var(--color-gray-600); }
.text-gray-700   { color: var(--color-gray-700); }



.text-red-800    { color: var(--color-red-800); }



/* --- 5.10 Colors — Background --- */





.bg-red-50     { background-color: var(--color-red-50); }



.bg-indigo-600 { background-color: var(--color-indigo-600); }



/* --- 5.11 Borders --- */
.border   { border-width: 1px; border-style: solid; border-color: rgb(36 36 36 / 0.2); }

/* Border colors */

.border-red-200    { border-color: var(--color-red-200); }


/* --- 5.12 Border Radius --- */
.rounded      { border-radius: 0.25rem; }
.rounded-xl   { border-radius: 0.75rem; }

/* --- 5.13 Shadows --- */

/* --- 5.14 Position / Layout --- */
.fixed    { position: fixed; }

/* --- 5.15 Overflow --- */
.overflow-x-auto  { overflow-x: auto; }

/* --- 5.16 Opacity --- */

/* --- 5.19 Animations --- */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInFast { from { opacity: 0; } to { opacity: 1; } }


/* --- 5.20 Misc --- */
.table-auto          { table-layout: auto; }

/* --- 5.21 Hover State Utilities --- */
.hover\:bg-indigo-700:hover  { background-color: var(--color-indigo-700); }

/* --- 5.22 Disabled State Utilities --- */

/* --- 5.24 Last-child Utilities --- */

/* --- 5.25 Even-child Utilities --- */

/* --- 5.26 Responsive Utilities --- */
@media (min-width: 64rem) {
  .lg\:mt-2  { margin-top: 0.5rem; }
  .lg\:text-xs { font-size: 0.75rem; line-height: 1rem; }
}
