/* =====================================================================
   TCD Universal Design System — "Notion-solid"
   ---------------------------------------------------------------------
   Read docs/UI_DESIGN_SYSTEM.md before editing.
   PRINT/A4 SAFETY: every rule below is scoped under .app-shell or an
   explicit component class. Never style raw body/table/input here, and
   never emit rules inside @media print. Print pages (print.php,
   print-wht.php, share-document.php, print_templates/*) and the
   .pv-paper / 210mm preview regions must remain pixel-identical.
   ===================================================================== */

/* ── Tokens ────────────────────────────────────────────────────────── */
:root {
  /* Brand — primary */
  --tcs-accent:        #B92025;
  --tcs-accent-hover:  #9A1A1F;
  --tcs-accent-soft:   #FFF1F1;
  --tcs-accent-ring:   rgba(185, 32, 37, 0.18);

  /* Brand — secondary (taxcount studio palette, per spec §1) */
  --tcs-yellow:        #FFBC00;
  --tcs-yellow-soft:   #FFF6DB;
  --tcs-green:         #007426;
  --tcs-green-soft:    #E0F2E7;
  --tcs-blue:          #2025B9;
  --tcs-blue-soft:     #E6E7F8;
  --tcs-gray-deep:     #363636;

  /* Neutral surface (Notion-leaning warm grays) */
  --tcs-bg:            #FFFFFF;
  --tcs-bg-page:       #FBFAF9;     /* main content background */
  --tcs-bg-sunken:     #F5F4F2;
  --tcs-bg-hover:      rgba(55, 53, 47, 0.06);
  --tcs-bg-active:     rgba(55, 53, 47, 0.10);

  /* Sidebar (light Notion-style, not dark) */
  --tcs-side-bg:       #F7F6F3;
  --tcs-side-border:   #ECEAE4;
  --tcs-side-text:     #37352F;
  --tcs-side-muted:    rgba(55, 53, 47, 0.55);
  --tcs-side-section:  rgba(55, 53, 47, 0.45);

  /* Text */
  --tcs-text:          #1F1F1F;
  --tcs-text-sub:      #6B6B6B;
  --tcs-text-mute:     #9A9A9A;

  /* Borders + shadows (1px, no big drop shadows) */
  --tcs-border:        #E6E5E1;
  --tcs-border-strong: #D6D5D0;
  --tcs-border-hover:  #B8B7B2;
  --tcs-card-shadow:   0 1px 0 rgba(15, 15, 15, 0.04);
  --tcs-pop-shadow:    0 4px 12px rgba(15, 15, 15, 0.10), 0 0 0 1px rgba(15, 15, 15, 0.06);
  --tcs-focus-ring:    0 0 0 3px var(--tcs-accent-ring);

  /* Radii */
  --tcs-radius-xs:     4px;
  --tcs-radius-sm:     6px;
  --tcs-radius:        8px;
  --tcs-radius-lg:     10px;

  /* Density (compact) */
  --tcs-h-input:       32px;
  --tcs-h-input-sm:    26px;
  --tcs-h-input-lg:    38px;
  --tcs-row-height:    34px;
  --tcs-pad-cell-x:    10px;
  --tcs-pad-cell-y:    7px;

  /* Type scale */
  --tcs-fs-xs:         11px;
  --tcs-fs-sm:         12px;
  --tcs-fs-md:         13px;   /* base UI */
  --tcs-fs-lg:         15px;
  --tcs-fs-xl:         18px;
  --tcs-fs-2xl:        22px;
  --tcs-fs-3xl:        28px;

  /* Font */
  --tcs-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
              "Inter", "Sarabun", "Prompt", "Kanit", "Helvetica Neue",
              Arial, sans-serif;
  /* Display font (headings, hero brand) — per spec §1 */
  --tcs-font-display: "Playfair Display", "Sarabun", Georgia, serif;

  /* Layout */
  --tcs-side-w:        240px;
  --tcs-side-w-collapsed: 56px;
  --tcs-top-h:         44px;
}

/* ── App shell scaffolding ─────────────────────────────────────────── */
.app-shell {
  font-family: var(--tcs-font);
  color: var(--tcs-text);
  background: var(--tcs-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: var(--tcs-fs-md);
  line-height: 1.45;
  min-height: 100vh;
}
.app-shell *,
.app-shell *::before,
.app-shell *::after { box-sizing: border-box; }

/* Topbar — sits to the right of the full-height sidebar on desktop */
.app-topbar {
  position: fixed; top: 0; left: var(--tcs-side-w); right: 0;
  height: var(--tcs-top-h);
  background: var(--tcs-bg);
  border-bottom: 1px solid var(--tcs-border);
  display: flex; align-items: center;
  gap: 8px;
  padding: 0 12px;
  z-index: 40;
  transition: left 180ms ease;
}
/* Brand lives in the sidebar now; keep selector for any leftover markup */
.app-topbar .topbar-brand { display: none; }
.app-topbar .topbar-biz {
  flex: 1;
  font-size: var(--tcs-fs-md);
  color: var(--tcs-text);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-topbar .topbar-actions {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--tcs-fs-sm);
}
.app-topbar .topbar-actions a {
  color: var(--tcs-text-sub);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--tcs-radius-sm);
}
.app-topbar .topbar-actions a:hover { background: var(--tcs-bg-hover); color: var(--tcs-text); }

/* Sidebar — full viewport height, hosts the app brand at top */
.app-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--tcs-side-w);
  background: var(--tcs-side-bg);
  border-right: 1px solid var(--tcs-side-border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 6px 24px;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: rgba(55,53,47,.2) transparent;
}

/* App brand inside the sidebar */
.app-sidebar .side-brand {
  display: flex; align-items: center;
  height: var(--tcs-top-h);
  margin: 0 -6px 6px;
  padding: 0 14px;
  border-bottom: 1px solid var(--tcs-side-border);
  background: var(--tcs-side-bg);
  font-weight: 700;
  font-size: 15px;
  color: var(--tcs-accent);
  letter-spacing: -0.02em;
  text-transform: lowercase;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}
.app-sidebar .side-brand a {
  color: inherit;
  text-decoration: none;
  font-family: var(--tcs-font-display, 'Playfair Display', serif);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.app-sidebar::-webkit-scrollbar { width: 8px; }
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(55,53,47,.18); border-radius: 4px; }
.app-sidebar::-webkit-scrollbar-track { background: transparent; }

.app-sidebar .side-section {
  font-size: var(--tcs-fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tcs-side-section);
  padding: 12px 10px 4px;
}
.app-sidebar .side-link {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  margin: 1px 2px;
  border-radius: var(--tcs-radius-sm);
  font-size: var(--tcs-fs-md);
  color: var(--tcs-side-text);
  text-decoration: none;
  line-height: 1.3;
  transition: background-color 80ms ease;
  position: relative;
}
.app-sidebar .side-link:hover { background: var(--tcs-bg-hover); }
.app-sidebar .side-link.is-active { background: var(--tcs-bg-active); font-weight: 500; }
.app-sidebar .side-link .side-ico {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--tcs-side-muted);
  flex-shrink: 0;
}
.app-sidebar .side-link.is-active .side-ico { color: var(--tcs-accent); }
.app-sidebar .side-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-sidebar .side-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--tcs-accent);
  color: #fff;
  font-weight: 600;
}

/* Main */
.app-main {
  margin-left: var(--tcs-side-w);
  padding-top: var(--tcs-top-h);
  min-height: 100vh;
}
.app-main .main-inner { padding: 20px 24px 80px; }
.app-main .main-inner-wide { max-width: 1280px; margin: 0 auto; padding: 20px 24px 80px; }
.app-main .main-inner-md   { max-width: 960px;  margin: 0 auto; padding: 20px 24px 80px; }
.app-main .main-inner-sm   { max-width: 640px;  margin: 0 auto; padding: 20px 24px 80px; }

/* Legacy wrapper compat — any leftover `<div class="max-w-[Npx] mx-auto px-N py-N pb-N">`
   directly inside .app-main inherits the same compact density as .main-inner*. */
.app-main > div[class*="max-w-["][class*="mx-auto"] {
  padding: 20px 24px 80px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 768px) {
  .app-main > div[class*="max-w-["][class*="mx-auto"] {
    padding: 14px 12px 80px;
  }
}

/* Business switcher — focus & active states (cannot be done inline) */
.biz-switcher {
  font-family: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border: 0;
  background: transparent;
}
.biz-switcher:focus-visible {
  outline: 2px solid #B92025;
  outline-offset: 1px;
  background: #f3f4f6; /* matches Tailwind gray-100 */
}
.biz-switcher:active {
  transform: scale(0.985);
  background: #e5e7eb; /* matches Tailwind gray-200 */
}
.biz-switcher:hover .biz-action {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Sidebar collapsed state */
.app-shell.is-side-collapsed .app-sidebar { width: var(--tcs-side-w-collapsed); }
.app-shell.is-side-collapsed .app-topbar  { left: var(--tcs-side-w-collapsed); }
.app-shell.is-side-collapsed .app-main    { margin-left: var(--tcs-side-w-collapsed); }
.app-shell.is-side-collapsed .app-sidebar .side-label,
.app-shell.is-side-collapsed .app-sidebar .side-section,
.app-shell.is-side-collapsed .app-sidebar .side-badge { display: none; }
.app-shell.is-side-collapsed .app-sidebar .side-link { justify-content: center; padding: 6px; }
.app-shell.is-side-collapsed .app-sidebar .side-brand {
  padding: 0; justify-content: center;
}
.app-shell.is-side-collapsed .app-sidebar .side-brand a { font-size: 0; line-height: 0; }
.app-shell.is-side-collapsed .app-sidebar .side-brand a::after {
  content: "ts";
  font-family: var(--tcs-font-display, 'Playfair Display', serif);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1;
}

/* Mobile */
@media (max-width: 768px) {
  .app-topbar { left: 0; padding-left: 8px; }
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(.16,1,.3,1);
    width: 260px;
    box-shadow: var(--tcs-pop-shadow);
  }
  .app-shell.is-side-mobile-open .app-sidebar { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .app-main .main-inner,
  .app-main .main-inner-wide,
  .app-main .main-inner-md,
  .app-main .main-inner-sm { padding: 14px 12px 80px; }
  /* Phase 2 a11y: sidebar links need 44px+ touch targets on mobile */
  .app-sidebar .side-link {
    padding: 10px 12px;
    min-height: 44px;
    font-size: var(--tcs-fs-md);
  }
  .app-sidebar .side-link .side-ico { width: 20px; height: 20px; }
}
/* The topbar hamburger doubles as desktop collapse / mobile drawer trigger */
.app-shell .topbar-side-toggle { color: var(--tcs-text-sub); }
.app-shell .topbar-side-toggle:hover { color: var(--tcs-text); }

/* ── Page header ───────────────────────────────────────────────────── */
.app-shell .page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.app-shell .breadcrumb {
  font-size: var(--tcs-fs-sm); color: var(--tcs-text-sub);
  margin-bottom: 4px;
}
.app-shell .breadcrumb a { color: inherit; text-decoration: none; }
.app-shell .breadcrumb a:hover { color: var(--tcs-text); }
.app-shell .breadcrumb .sep { margin: 0 4px; color: var(--tcs-text-mute); }
.app-shell .page-title {
  font-size: var(--tcs-fs-3xl);
  font-weight: 700;
  color: var(--tcs-text);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.app-shell .page-subtitle {
  font-size: var(--tcs-fs-md);
  color: var(--tcs-text-sub);
  margin-top: 4px;
}
.app-shell .page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.app-shell .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--tcs-h-input);
  padding: 0 12px;
  font-family: inherit;
  font-size: var(--tcs-fs-md);
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: var(--tcs-radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--tcs-text);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 100ms ease, border-color 100ms ease, box-shadow 100ms ease, transform 60ms ease;
}
.app-shell a.btn { color: var(--tcs-text); }
.app-shell .btn:focus-visible { outline: none; box-shadow: var(--tcs-focus-ring); }
.app-shell .btn:active:not(:disabled) { transform: translateY(0.5px); }
.app-shell .btn:disabled, .app-shell .btn.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.app-shell .btn-primary {
  background: var(--tcs-accent); color: #fff; border-color: var(--tcs-accent);
  box-shadow: 0 1px 2px rgba(185, 32, 37, 0.18), inset 0 1px 0 rgba(255,255,255,0.10);
}
.app-shell .btn-primary:hover:not(:disabled) { background: var(--tcs-accent-hover); border-color: var(--tcs-accent-hover); }
.app-shell a.btn-primary { color: #fff; }

.app-shell .btn-secondary {
  background: var(--tcs-bg); color: var(--tcs-text);
  border-color: var(--tcs-border-strong);
  box-shadow: var(--tcs-card-shadow);
}
.app-shell .btn-secondary:hover:not(:disabled) { background: var(--tcs-bg-sunken); border-color: var(--tcs-border-hover); }

.app-shell .btn-ghost { background: transparent; color: var(--tcs-text-sub); }
.app-shell .btn-ghost:hover:not(:disabled) { background: var(--tcs-bg-hover); color: var(--tcs-text); }

.app-shell .btn-danger { background: var(--tcs-accent); color: #fff; border-color: var(--tcs-accent); }
.app-shell .btn-danger:hover:not(:disabled) { background: var(--tcs-accent-hover); border-color: var(--tcs-accent-hover); }
.app-shell .btn-danger-ghost { background: transparent; color: var(--tcs-accent); border-color: #FECACA; }
.app-shell .btn-danger-ghost:hover:not(:disabled) { background: var(--tcs-accent-soft); border-color: #FCA5A5; }

.app-shell .btn-sm { height: var(--tcs-h-input-sm); padding: 0 8px; font-size: var(--tcs-fs-sm); }
.app-shell .btn-lg { height: var(--tcs-h-input-lg); padding: 0 16px; font-size: var(--tcs-fs-lg); }
.app-shell .btn-icon { width: var(--tcs-h-input); padding: 0; }
.app-shell .btn-icon.btn-sm { width: var(--tcs-h-input-sm); }

.app-shell .btn.is-loading { pointer-events: none; opacity: 0.7; }
.app-shell .btn.is-loading::after {
  content: ''; width: 12px; height: 12px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; margin-left: 6px;
  animation: tcs-spin 0.6s linear infinite;
}
@keyframes tcs-spin { to { transform: rotate(360deg); } }

/* ── Inputs ────────────────────────────────────────────────────────── */
.app-shell .input,
.app-shell .select,
.app-shell .textarea {
  width: 100%;
  font-family: inherit;
  font-size: var(--tcs-fs-md);
  line-height: 1.4;
  color: var(--tcs-text);
  background: var(--tcs-bg);
  border: 1px solid var(--tcs-border-strong);
  border-radius: var(--tcs-radius-sm);
  outline: none;
  padding: 0 10px;
  height: var(--tcs-h-input);
  transition: border-color 100ms ease, box-shadow 100ms ease, background-color 100ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.app-shell .input::placeholder,
.app-shell .textarea::placeholder { color: var(--tcs-text-mute); }
.app-shell .input:hover:not(:focus):not(:disabled),
.app-shell .select:hover:not(:focus):not(:disabled),
.app-shell .textarea:hover:not(:focus):not(:disabled) { border-color: var(--tcs-border-hover); }
.app-shell .input:focus,
.app-shell .select:focus,
.app-shell .textarea:focus {
  border-color: var(--tcs-accent);
  box-shadow: var(--tcs-focus-ring);
}
.app-shell .input:disabled,
.app-shell .select:disabled,
.app-shell .textarea:disabled {
  background: var(--tcs-bg-sunken);
  color: var(--tcs-text-sub);
  cursor: not-allowed;
}
.app-shell .input.is-invalid,
.app-shell .select.is-invalid,
.app-shell .textarea.is-invalid {
  border-color: var(--tcs-accent);
  box-shadow: 0 0 0 3px rgba(185, 32, 37, 0.10);
}
.app-shell .textarea { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; }
.app-shell .select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.app-shell .input-sm { height: var(--tcs-h-input-sm); font-size: var(--tcs-fs-sm); padding: 0 8px; }
.app-shell .input-lg { height: var(--tcs-h-input-lg); }

.app-shell input[type="checkbox"].tcs-check,
.app-shell input[type="radio"].tcs-check {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px;
  border: 1px solid var(--tcs-border-strong);
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  transition: background 100ms ease, border-color 100ms ease, box-shadow 100ms ease;
}
.app-shell input[type="radio"].tcs-check { border-radius: 50%; }
.app-shell input[type="checkbox"].tcs-check:hover,
.app-shell input[type="radio"].tcs-check:hover { border-color: var(--tcs-border-hover); }
.app-shell input[type="checkbox"].tcs-check:checked,
.app-shell input[type="radio"].tcs-check:checked { background: var(--tcs-accent); border-color: var(--tcs-accent); }
.app-shell input[type="checkbox"].tcs-check:checked::after {
  content: ''; position: absolute; left: 4px; top: 0px;
  width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.app-shell input[type="radio"].tcs-check:checked::after {
  content: ''; position: absolute; left: 4px; top: 4px;
  width: 5px; height: 5px;
  border-radius: 50%; background: #fff;
}
.app-shell input[type="checkbox"].tcs-check:focus-visible,
.app-shell input[type="radio"].tcs-check:focus-visible { outline: none; box-shadow: var(--tcs-focus-ring); }

/* Field structure */
.app-shell .field { margin-bottom: 14px; }
.app-shell .field:last-child { margin-bottom: 0; }
.app-shell .field .label,
.app-shell .field-label {
  display: block;
  font-size: var(--tcs-fs-sm);
  font-weight: 500;
  color: var(--tcs-text);
  margin-bottom: 4px;
}
.app-shell .field .label-required::after,
.app-shell .field-label.required::after {
  content: '*'; color: var(--tcs-accent); margin-left: 3px;
}
.app-shell .field-hint, .app-shell .field .label-hint {
  font-size: var(--tcs-fs-sm); color: var(--tcs-text-sub);
  margin-top: 4px; line-height: 1.4;
}
.app-shell .field-error {
  font-size: var(--tcs-fs-sm); color: var(--tcs-accent);
  margin-top: 4px; display: flex; align-items: center; gap: 4px;
}
.app-shell .field-row { display: grid; gap: 10px; }
@media (min-width: 640px) {
  .app-shell .field-row-2 { grid-template-columns: 1fr 1fr; }
  .app-shell .field-row-3 { grid-template-columns: 1fr 1fr 1fr; }
  .app-shell .field-row-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Input group prefix/suffix */
.app-shell .input-group { display: flex; align-items: stretch; width: 100%; }
.app-shell .input-group .input,
.app-shell .input-group .select { border-radius: 0; }
.app-shell .input-group > :first-child { border-top-left-radius: var(--tcs-radius-sm); border-bottom-left-radius: var(--tcs-radius-sm); }
.app-shell .input-group > :last-child  { border-top-right-radius: var(--tcs-radius-sm); border-bottom-right-radius: var(--tcs-radius-sm); }
.app-shell .input-group > :not(:first-child) { margin-left: -1px; }
.app-shell .input-group .input-addon {
  display: inline-flex; align-items: center; padding: 0 10px;
  background: var(--tcs-bg-sunken); color: var(--tcs-text-sub);
  border: 1px solid var(--tcs-border-strong); font-size: var(--tcs-fs-sm);
  white-space: nowrap;
}
.app-shell .input-group .input:focus,
.app-shell .input-group .select:focus { position: relative; z-index: 1; }

/* ── Cards / panels ────────────────────────────────────────────────── */
.app-shell .card {
  background: var(--tcs-bg);
  border: 1px solid var(--tcs-border);
  border-radius: var(--tcs-radius);
  box-shadow: var(--tcs-card-shadow);
}
.app-shell .card-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--tcs-border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.app-shell .card-title {
  font-size: var(--tcs-fs-md); font-weight: 600; color: var(--tcs-text);
  margin: 0; letter-spacing: -0.005em;
}
.app-shell .card-meta { font-size: var(--tcs-fs-sm); color: var(--tcs-text-sub); }
.app-shell .card-body { padding: 14px; }
.app-shell .card-body-tight { padding: 8px; }
.app-shell .card-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--tcs-border);
  background: var(--tcs-bg-sunken);
  font-size: var(--tcs-fs-sm);
}

/* Form card (legacy compatibility) */
.app-shell .form-card {
  background: var(--tcs-bg);
  border-radius: var(--tcs-radius);
  border: 1px solid var(--tcs-border);
  box-shadow: var(--tcs-card-shadow);
  overflow: hidden;
  margin-bottom: 14px;
}
.app-shell .form-card .card-body { padding: 16px; }
.app-shell .form-card .card-footer { padding: 12px 16px; background: var(--tcs-bg-sunken); border-top: 1px solid var(--tcs-border); }

.app-shell .section-title {
  font-size: var(--tcs-fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--tcs-text-sub);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--tcs-border);
}
.app-shell .section-title-lg {
  font-size: var(--tcs-fs-lg); font-weight: 600; color: var(--tcs-text);
  margin: 0 0 4px; letter-spacing: -0.01em;
}
.app-shell .section-desc { font-size: var(--tcs-fs-md); color: var(--tcs-text-sub); margin: 0 0 12px; line-height: 1.45; }

/* ── Tables ────────────────────────────────────────────────────────── */
.app-shell .data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--tcs-bg);
  font-size: var(--tcs-fs-md);
}
.app-shell .data-table thead th {
  text-align: left;
  font-size: var(--tcs-fs-sm);
  font-weight: 500;
  color: var(--tcs-text-sub);
  background: var(--tcs-bg-sunken);
  padding: var(--tcs-pad-cell-y) var(--tcs-pad-cell-x);
  border-bottom: 1px solid var(--tcs-border);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.app-shell .data-table tbody td {
  padding: var(--tcs-pad-cell-y) var(--tcs-pad-cell-x);
  border-bottom: 1px solid var(--tcs-border);
  color: var(--tcs-text);
  vertical-align: middle;
  height: var(--tcs-row-height);
}
.app-shell .data-table tbody tr:last-child td { border-bottom: 0; }
.app-shell .data-table tbody tr:hover td { background: var(--tcs-bg-hover); }
.app-shell .data-table tbody tr.is-selected td { background: var(--tcs-accent-soft); }
.app-shell .data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.app-shell .data-table .nowrap { white-space: nowrap; }
.app-shell .data-table .actions { text-align: right; white-space: nowrap; }
.app-shell .data-table-card {
  background: var(--tcs-bg);
  border: 1px solid var(--tcs-border);
  border-radius: var(--tcs-radius);
  overflow: hidden;
  box-shadow: var(--tcs-card-shadow);
}
.app-shell .data-table-card .data-table thead th:first-child { border-top-left-radius: var(--tcs-radius); }
.app-shell .data-table-card .data-table thead th:last-child { border-top-right-radius: var(--tcs-radius); }

/* Toolbar above tables */
.app-shell .toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--tcs-bg);
  border: 1px solid var(--tcs-border);
  border-bottom: 0;
  border-top-left-radius: var(--tcs-radius);
  border-top-right-radius: var(--tcs-radius);
  flex-wrap: wrap;
}
.app-shell .toolbar + .data-table-card,
.app-shell .toolbar + .data-table {
  border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0;
}
.app-shell .toolbar .toolbar-spacer { flex: 1; }
.app-shell .toolbar .input,
.app-shell .toolbar .select { height: var(--tcs-h-input-sm); font-size: var(--tcs-fs-sm); }

/* Pagination */
.app-shell .pagination {
  display: flex; align-items: center; gap: 4px; padding: 10px 12px;
  border-top: 1px solid var(--tcs-border);
  background: var(--tcs-bg);
  font-size: var(--tcs-fs-sm); color: var(--tcs-text-sub);
}
.app-shell .pagination .page-btn {
  min-width: 28px; height: 28px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--tcs-radius-sm);
  color: var(--tcs-text); text-decoration: none;
}
.app-shell .pagination .page-btn:hover { background: var(--tcs-bg-hover); }
.app-shell .pagination .page-btn.is-active { background: var(--tcs-accent); color: #fff; }
.app-shell .pagination .spacer { flex: 1; }

/* ── Badges / chips / pills ────────────────────────────────────────── */
.app-shell .badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px;
  font-size: var(--tcs-fs-xs);
  font-weight: 500;
  border-radius: 999px;
  background: var(--tcs-bg-sunken);
  color: var(--tcs-text-sub);
  line-height: 1.6;
  white-space: nowrap;
}
.app-shell .badge-red    { background: #FEE2E2; color: #B91C1C; }
.app-shell .badge-blue   { background: #DBEAFE; color: #1D4ED8; }
.app-shell .badge-green  { background: #D1FAE5; color: #047857; }
.app-shell .badge-yellow { background: #FEF3C7; color: #92400E; }
.app-shell .badge-purple { background: #EDE9FE; color: #6D28D9; }
.app-shell .badge-gray   { background: #F3F4F6; color: #374151; }

.app-shell .chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 10px;
  font-size: var(--tcs-fs-sm);
  border: 1px solid var(--tcs-border-strong);
  background: var(--tcs-bg);
  color: var(--tcs-text);
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 100ms ease, border-color 100ms ease;
}
.app-shell .chip:hover { background: var(--tcs-bg-sunken); }
.app-shell .chip.is-active { background: var(--tcs-text); color: #fff; border-color: var(--tcs-text); }

/* Status badges (document) */
.app-shell .status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: var(--tcs-fs-xs); font-weight: 500;
  border: 1px solid transparent;
}
.app-shell .status-badge.status-draft    { background: #f3f4f6; color: #374151; border-color: #e5e7eb; }
.app-shell .status-badge.status-approved { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.app-shell .status-badge.status-deleted  { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.app-shell .status-badge.status-paid     { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.app-shell .status-badge.status-pending  { background: #fef3c7; color: #92400e; border-color: #fde68a; }

/* Role pill (topbar) */
.app-shell .role-pill {
  display: inline-flex; align-items: center;
  padding: 1px 7px;
  font-size: var(--tcs-fs-xs); font-weight: 500;
  border-radius: 999px;
}
.app-shell .role-owner      { background: #EDE9FE; color: #6D28D9; }
.app-shell .role-admin      { background: #DBEAFE; color: #1D4ED8; }
.app-shell .role-accountant { background: #D1FAE5; color: #047857; }
.app-shell .role-employee   { background: #FEF3C7; color: #92400E; }
.app-shell .role-viewer     { background: #F3F4F6; color: #374151; }

/* ── KPI tiles ─────────────────────────────────────────────────────── */
.app-shell .kpi-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.app-shell .kpi-tile {
  background: var(--tcs-bg);
  border: 1px solid var(--tcs-border);
  border-radius: var(--tcs-radius);
  padding: 12px 14px;
  box-shadow: var(--tcs-card-shadow);
}
.app-shell .kpi-tile .kpi-label {
  font-size: var(--tcs-fs-sm); color: var(--tcs-text-sub);
  margin-bottom: 4px; letter-spacing: -0.005em;
}
.app-shell .kpi-tile .kpi-value {
  font-size: var(--tcs-fs-2xl); font-weight: 700;
  color: var(--tcs-text); letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.app-shell .kpi-tile .kpi-delta { font-size: var(--tcs-fs-xs); color: var(--tcs-text-sub); margin-top: 2px; }
.app-shell .kpi-tile .kpi-delta.up { color: #047857; }
.app-shell .kpi-tile .kpi-delta.down { color: #B91C1C; }

/* ── Modals / popovers ─────────────────────────────────────────────── */
.app-shell .modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 15, 15, 0.35);
  backdrop-filter: saturate(120%) blur(2px);
  -webkit-backdrop-filter: saturate(120%) blur(2px);
  z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.app-shell .modal-card {
  background: var(--tcs-bg);
  border: 1px solid var(--tcs-border);
  border-radius: var(--tcs-radius-lg);
  box-shadow: var(--tcs-pop-shadow);
  width: 100%; max-width: 520px;
  display: flex; flex-direction: column; max-height: 90vh; overflow: hidden;
}
.app-shell .modal-card .modal-header { padding: 14px 16px; border-bottom: 1px solid var(--tcs-border); display:flex; align-items:center; justify-content:space-between; }
.app-shell .modal-card .modal-title { font-size: var(--tcs-fs-lg); font-weight: 600; margin: 0; }
.app-shell .modal-card .modal-body { padding: 16px; overflow-y: auto; }
.app-shell .modal-card .modal-footer { padding: 12px 16px; border-top: 1px solid var(--tcs-border); background: var(--tcs-bg-sunken); display: flex; justify-content: flex-end; gap: 8px; }

/* ── Confirm dialog (window.confirmDialog in main.js) ─────────────── */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 15, 15, 0.35);
  -webkit-backdrop-filter: saturate(120%) blur(2px);
          backdrop-filter: saturate(120%) blur(2px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.confirm-overlay .confirm-box {
  background: var(--tcs-bg, #fff);
  border: 1px solid var(--tcs-border, #D2D2D7);
  border-radius: var(--tcs-radius-lg, 14px);
  box-shadow: var(--tcs-pop-shadow, 0 10px 30px rgba(0,0,0,0.15));
  width: 100%; max-width: 420px;
  padding: 20px 20px 16px;
}
.confirm-overlay .confirm-msg {
  margin: 0 0 16px;
  font-size: var(--tcs-fs-md, 15px);
  color: var(--tcs-text, #1D1D1F);
  line-height: 1.5;
  word-break: break-word;
}
.confirm-overlay .confirm-actions {
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ── Toast notifications (window.showAlert in main.js) ────────────── */
#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
#toast-container .toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
  padding: 10px 12px;
  background: var(--tcs-bg, #fff);
  color: var(--tcs-text, #1F1F1F);
  border: 1px solid var(--tcs-border, #E6E5E1);
  border-radius: var(--tcs-radius-lg, 10px);
  box-shadow: var(--tcs-pop-shadow, 0 4px 12px rgba(15,15,15,0.10), 0 0 0 1px rgba(15,15,15,0.06));
  font-size: var(--tcs-fs-md, 13px);
  animation: toast-in 220ms cubic-bezier(0.2, 0, 0, 1);
}
#toast-container .toast-item .toast-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
#toast-container .toast-item .toast-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tcs-text-sub, #6B6B6B);
}
#toast-container .toast-item .toast-msg {
  flex: 1 1 auto;
  word-break: break-word;
  line-height: 1.4;
}
#toast-container .toast-item .toast-close {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  padding: 4px;
  border-radius: var(--tcs-radius-sm, 6px);
  color: var(--tcs-text-mute, #9A9A9A);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#toast-container .toast-item .toast-close:hover {
  background: var(--tcs-bg-hover, rgba(55, 53, 47, 0.06));
  color: var(--tcs-text, #1F1F1F);
}
@keyframes toast-in {
  from { transform: translateX(16px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toast-out {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(16px); opacity: 0; }
}

/* ── Button loading state (window.setLoading in main.js) ──────────── */
.btn.loading,
button.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  opacity: 0.85;
}
.btn.loading::after,
button.loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: #FFFFFF;
  animation: btn-spin 600ms linear infinite;
}
.btn.btn-secondary.loading::after,
button.btn-secondary.loading::after {
  color: var(--tcs-text, #1F1F1F);
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ── Progress overlay (window.showProgress in main.js) ────────────── */
.progress-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 15, 15, 0.25);
  -webkit-backdrop-filter: saturate(120%) blur(1px);
          backdrop-filter: saturate(120%) blur(1px);
  z-index: 1050;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.progress-overlay .progress-box {
  background: var(--tcs-bg, #fff);
  border: 1px solid var(--tcs-border, #E6E5E1);
  border-radius: var(--tcs-radius-lg, 10px);
  box-shadow: var(--tcs-pop-shadow, 0 4px 12px rgba(15,15,15,0.10), 0 0 0 1px rgba(15,15,15,0.06));
  padding: 20px 24px;
  display: flex; align-items: center; gap: 14px;
  min-width: 220px; max-width: 360px;
}
.progress-overlay .progress-spinner {
  flex: 0 0 22px;
  width: 22px; height: 22px;
  border: 2.5px solid var(--tcs-border, #E6E5E1);
  border-top-color: var(--tcs-text, #1F1F1F);
  border-radius: 50%;
  animation: btn-spin 700ms linear infinite;
}
.progress-overlay .progress-msg {
  flex: 1 1 auto;
  font-size: var(--tcs-fs-md, 13px);
  color: var(--tcs-text, #1F1F1F);
  line-height: 1.4;
}

.app-shell .popover {
  background: var(--tcs-bg);
  border: 1px solid var(--tcs-border);
  border-radius: var(--tcs-radius);
  box-shadow: var(--tcs-pop-shadow);
  padding: 6px;
  font-size: var(--tcs-fs-md);
}
.app-shell .popover .menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: var(--tcs-radius-sm);
  color: var(--tcs-text);
  text-decoration: none;
  cursor: pointer;
}
.app-shell .popover .menu-item:hover { background: var(--tcs-bg-hover); }
.app-shell .popover .menu-item.is-danger { color: var(--tcs-accent); }
.app-shell .popover .menu-divider { height: 1px; background: var(--tcs-border); margin: 4px 0; }

/* ── Switch / toggle ───────────────────────────────────────────────── */
.app-shell .switch {
  width: 36px; height: 22px; border-radius: 11px;
  background: #D6D5D0; border: none; cursor: pointer;
  position: relative; transition: background 140ms ease;
  flex-shrink: 0; padding: 0;
}
.app-shell .switch::after {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  transition: transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.app-shell .switch.is-on { background: var(--tcs-accent); }
.app-shell .switch.is-on::after { transform: translateX(14px); }
.app-shell .switch:focus-visible { outline: none; box-shadow: var(--tcs-focus-ring); }

.app-shell .toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--tcs-border);
}
.app-shell .toggle-row:last-child { border-bottom: 0; }
.app-shell .toggle-label { font-size: var(--tcs-fs-md); font-weight: 500; color: var(--tcs-text); }
.app-shell .toggle-hint  { font-size: var(--tcs-fs-sm); color: var(--tcs-text-sub); margin-top: 2px; }

/* ── Item-type selector card (used on item-form.php) ──────────────── */
.app-shell .item-type-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  background: var(--tcs-bg);
  border: 1px solid var(--tcs-border);
  border-radius: var(--tcs-radius);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.app-shell .item-type-card:hover { border-color: var(--tcs-border-hover); }
.app-shell .peer:checked ~ .item-type-card,
.app-shell .peer:focus-visible ~ .item-type-card {
  border-color: var(--tcs-accent);
  background: var(--tcs-accent-soft);
  box-shadow: 0 0 0 1px var(--tcs-accent) inset;
}
.app-shell .item-type-card .type-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: var(--tcs-radius-sm);
  background: var(--tcs-bg-sunken);
  color: var(--tcs-text-sub);
}
.app-shell .peer:checked ~ .item-type-card .type-icon {
  background: var(--tcs-bg);
  color: var(--tcs-accent);
}
.app-shell .item-type-card .type-title {
  font-size: var(--tcs-fs-md);
  font-weight: 600;
  color: var(--tcs-text);
  margin: 0 0 2px;
}
.app-shell .item-type-card .type-desc {
  font-size: var(--tcs-fs-sm);
  color: var(--tcs-text-sub);
  margin: 0; line-height: 1.4;
}

/* ── Bottom sticky bar (form save) ─────────────────────────────────── */
.app-shell .bottom-bar {
  position: sticky; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; padding: 10px 16px;
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--tcs-border);
  margin: 24px -16px -20px;
}
.app-shell .bottom-bar .bar-left { margin-right: auto; }

/* ── Empty state ───────────────────────────────────────────────────── */
.app-shell .empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--tcs-text-sub);
}
.app-shell .empty-state .empty-ico { font-size: 32px; margin-bottom: 8px; opacity: 0.5; }
.app-shell .empty-state .empty-title { font-size: var(--tcs-fs-lg); font-weight: 600; color: var(--tcs-text); margin-bottom: 4px; }
.app-shell .empty-state .empty-desc { font-size: var(--tcs-fs-md); }

/* ── Notion-like inline edit ───────────────────────────────────────── */
.app-shell .inline-editable {
  cursor: text; padding: 1px 4px; border-radius: var(--tcs-radius-xs);
  transition: background 100ms ease;
}
.app-shell .inline-editable:hover {
  background: var(--tcs-bg-hover);
  outline: 1px dashed var(--tcs-border-hover);
}
.app-shell .inline-input {
  border: 1px solid var(--tcs-accent);
  border-radius: var(--tcs-radius-xs);
  padding: 1px 5px;
  font-size: inherit; width: 100%; outline: none;
  background: #fff;
}
.app-shell .saving { opacity: 0.6; }
.app-shell .flash-success { background: #dcfce7 !important; transition: none; }
.app-shell .flash-error   { background: #fee2e2 !important; transition: none; }

/* ── Compatibility shim for legacy Tailwind utility patterns ───────── */
/* Old forms still use `border border-gray-300 rounded-md px-3 py-2 text-sm`.
   Lift them to token look without touching every page. Scoped under
   .app-shell so we don't bleed into A4/print regions. */
.app-shell form input[type="text"].border-gray-300,
.app-shell form input[type="email"].border-gray-300,
.app-shell form input[type="tel"].border-gray-300,
.app-shell form input[type="number"].border-gray-300,
.app-shell form input[type="date"].border-gray-300,
.app-shell form input[type="time"].border-gray-300,
.app-shell form input[type="password"].border-gray-300,
.app-shell form input[type="url"].border-gray-300,
.app-shell form input[type="search"].border-gray-300,
.app-shell form select.border-gray-300,
.app-shell form textarea.border-gray-300 {
  font-family: var(--tcs-font) !important;
  font-size: var(--tcs-fs-md) !important;
  color: var(--tcs-text) !important;
  background-color: var(--tcs-bg) !important;
  border: 1px solid var(--tcs-border-strong) !important;
  border-radius: var(--tcs-radius-sm) !important;
  height: var(--tcs-h-input);
  padding: 0 10px !important;
  outline: none !important;
  -webkit-appearance: none; appearance: none;
  transition: border-color 100ms ease, box-shadow 100ms ease, background-color 100ms ease !important;
  box-shadow: none !important;
}
.app-shell form textarea.border-gray-300 {
  height: auto !important; min-height: 72px;
  padding: 8px 10px !important; line-height: 1.5 !important; resize: vertical;
}
.app-shell form select.border-gray-300 {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  padding-right: 30px !important;
}
.app-shell form input.border-gray-300:hover:not(:focus):not(:disabled),
.app-shell form select.border-gray-300:hover:not(:focus):not(:disabled),
.app-shell form textarea.border-gray-300:hover:not(:focus):not(:disabled) {
  border-color: var(--tcs-border-hover) !important;
}
.app-shell form input.border-gray-300:focus,
.app-shell form select.border-gray-300:focus,
.app-shell form textarea.border-gray-300:focus {
  border-color: var(--tcs-accent) !important;
  box-shadow: var(--tcs-focus-ring) !important;
}

/* Inline #B92025 buttons (legacy) get unified hover */
.app-shell form button[class*="bg-[#B92025]"],
.app-shell form a[class*="bg-[#B92025]"] {
  box-shadow: 0 1px 2px rgba(185, 32, 37, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  transition: background-color 100ms ease, box-shadow 100ms ease, transform 60ms ease;
}
.app-shell form button[class*="bg-[#B92025]"]:hover,
.app-shell form a[class*="bg-[#B92025]"]:hover { background-color: var(--tcs-accent-hover) !important; }

/* ── Responsive helpers ────────────────────────────────────────────── */
.app-shell .hide-mobile { }
@media (max-width: 768px) {
  .app-shell .hide-mobile { display: none !important; }
  .app-shell .flex-mobile-col { flex-direction: column !important; align-items: stretch !important; }
  .app-shell .data-table thead th,
  .app-shell .data-table tbody td { padding: 6px 8px; font-size: var(--tcs-fs-sm); }
  .app-shell .page-title { font-size: var(--tcs-fs-2xl); }
  .app-shell input.input,
  .app-shell select.select,
  .app-shell textarea.textarea { font-size: 16px; } /* prevent iOS zoom */
}

/* ── Animations ────────────────────────────────────────────────────── */
@keyframes tcs-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.app-shell .shake { animation: tcs-shake 280ms ease; }
@keyframes tcs-fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.app-shell .fade-in { animation: tcs-fade-in 160ms ease; }

/* ── PRINT/A4 SAFETY GUARD ─────────────────────────────────────────── */
/* Belt-and-braces: when printing, neutralize any shell decoration that
   could possibly leak into a print frame. Print pages don't include
   .app-shell, but defensive in case someone embeds a printable region. */
@media print {
  .app-shell .app-topbar,
  .app-shell .app-sidebar,
  .app-shell .bottom-bar,
  .app-shell .toolbar,
  .app-shell .pagination { display: none !important; }
  .app-shell, .app-shell .app-main { background: #fff !important; margin: 0 !important; padding: 0 !important; }
}
