.s-site-logo-img {
  content: url(../../img/tech5aims-logo-white.svg);
}

/* Sidebar header: dark logo on a white badge so it stays legible on any header colour */
.s-sidebar-header .s-sidebar-header-logo {
  content: url(../../img/tech5aims-logo.svg) !important;
  background: #fff;
  border-radius: 6px;
  padding: 3px;
  box-sizing: border-box;
}

/* Find an IMEI: a search box in the top bar; on a phone, an icon that opens the page instead */
.s-serial-find {
  display: flex;
  align-items: center;
}

.s-serial-find-form {
  position: relative;
  margin-right: 1.5rem;
}

.s-serial-find-form .fa {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.55;
  pointer-events: none;
}

.s-serial-find-form input {
  width: 230px;
  padding-left: 1.7rem;
  border-radius: 999px;
}

.s-serial-find-link {
  display: none;
}

@media (max-width: 767.98px) {
  .s-serial-find-form {
    display: none;
  }

  .s-serial-find-link {
    display: inline-block;
  }
}

html[dir="rtl"] .s-serial-find-form {
  margin-right: 0;
  margin-left: 1.5rem;
}

html[dir="rtl"] .s-serial-find-form .fa {
  left: auto;
  right: 0.65rem;
}

html[dir="rtl"] .s-serial-find-form input {
  padding-left: 0.5rem;
  padding-right: 1.7rem;
}

/* Branch sync in the top bar (Modules/Common/Sync/SyncBadge.tsx): a dot and a word, green online, amber offline,
   red when the sync needs someone; the panel under it says why and has Sync now */
.t5-sync {
  display: flex;
  align-items: center;
}

.t5-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 0.75rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 12%, transparent);
  color: inherit;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: nowrap;
  text-decoration: none;
}

.t5-sync-badge:hover,
.t5-sync-badge:focus-visible {
  color: inherit;
  background: color-mix(in srgb, currentColor 20%, transparent);
}

.t5-sync-dot {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--bs-secondary, #6c757d);
}

.t5-sync-badge[data-tone="ok"] .t5-sync-dot { background: var(--bs-success, #198754); }
.t5-sync-badge[data-tone="warn"] .t5-sync-dot { background: var(--bs-warning, #ffc107); }
.t5-sync-badge[data-tone="bad"] .t5-sync-dot { background: var(--bs-danger, #dc3545); }
.t5-sync-badge[data-tone="hub"] .t5-sync-dot { background: var(--bs-info, #0dcaf0); }

.t5-sync-badge.t5-sync-running .t5-sync-dot {
  animation: t5-sync-pulse 1s ease-in-out infinite;
}

@keyframes t5-sync-pulse {
  50% { opacity: 0.3; }
}

.t5-sync-count {
  padding: 0 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 18%, transparent);
  font-weight: 600;
}

.t5-sync-menu {
  min-width: 280px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 0.75rem 1rem;
  white-space: normal;
}

.t5-sync-menu h6 {
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.t5-sync-menu p {
  margin: 0 0 0.4rem;
  font-size: 0.875rem;
}

.t5-sync-menu .t5-sync-why {
  color: var(--bs-secondary-color, #6c757d);
}

.t5-sync-menu ul {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

.t5-sync-menu li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0;
  font-size: 0.875rem;
}

.t5-sync-menu li > span:last-child {
  color: var(--bs-secondary-color, #6c757d);
  white-space: nowrap;
}

html[dir="rtl"] .t5-sync-badge {
  margin-right: 0;
  margin-left: 0.75rem;
}

@media (max-width: 767.98px) {
  .t5-sync-label {
    display: none;
  }

  .t5-sync-badge {
    margin-right: 0.25rem;
    padding: 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .t5-sync-badge.t5-sync-running .t5-sync-dot {
    animation: none;
  }
}

.t5-sync-menu .t5-sync-issues a {
  color: var(--bs-warning-text-emphasis, #997404);
  font-weight: 600;
}

/* a branch that hasn't synced for a week: by when it must (Common/Sync/OfflineLimit.cs) */
.t5-sync-menu .t5-sync-limit {
  color: var(--bs-warning-text-emphasis, #997404);
}

.t5-sync-menu .t5-sync-limit.t5-urgent,
.t5-sync-menu li.t5-urgent > span:last-child {
  color: var(--bs-danger-text-emphasis, #b02a37);
  font-weight: 600;
}

.t5-sync-menu li.t5-urgent > span:last-child {
  white-space: normal;
  text-align: end;
}

/* Sync Issues (Modules/Administration/SyncIssues): the checks above the list, each folded until opened, and in an
   issue the two copies of its row side by side, the columns that differ marked */
.t5-sync-checks .t5-sync-check {
  margin-bottom: 0.25rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.375rem;
  background: var(--bs-body-bg, #fff);
}

.t5-sync-checks .t5-sync-check summary {
  cursor: pointer;
}

.t5-sync-checks .t5-sync-check .fa-check {
  color: var(--bs-success, #198754);
}

.t5-sync-checks .t5-sync-check.t5-found .fa-exclamation-triangle {
  color: var(--bs-warning, #ffc107);
}

.t5-sync-check-count {
  margin-inline-start: 0.5rem;
  color: var(--bs-secondary-color, #6c757d);
  font-size: 0.85em;
}

.t5-sync-check.t5-found .t5-sync-check-count {
  color: inherit;
  font-weight: 600;
}

.t5-sync-compare td:first-child {
  color: var(--bs-secondary-color, #6c757d);
  white-space: nowrap;
}

.t5-sync-compare td {
  overflow-wrap: anywhere;
}

.t5-sync-compare tr.t5-differs td {
  background: var(--bs-warning-bg-subtle, #fff3cd);
  font-weight: 600;
}

/* another site's document, or hub-only data at a branch (Modules/Common/Sites/SiteReadOnly.ts): the buttons that would
   change it are hidden */
.tool-button.t5-site-hidden {
  display: none !important;
}

/* Select2 dropdown highlight — use theme primary instead of hardcoded blue */
.select2-results .select2-highlighted {
  background: var(--bs-primary, #3875d7);
}

.s-TranslationGrid input.custom-text {
  width: 100%;
  height: 23px;
  padding: 0 3px;
}

.s-PermissionCheckEditor {
  min-height: 450px;
}

/* ==========================================================================
   AUTH PAGES DESIGN SYSTEM (Login + SignUp)
   Split-screen layout with teal/emerald palette.
   Shared styles scoped via #s-LoginPage, #s-SignUpPage
   --------------------------------------------------------------------------
   Color Palette:
     --auth-primary-dark:   #042f2e  (teal 950)
     --auth-primary:        #134e4a  (teal 900)
     --auth-accent:         #14b8a6  (teal 500)
     --auth-accent-hover:   #0d9488  (teal 600)
     --auth-accent-light:   #2dd4bf  (teal 400)
     --auth-surface:        #ffffff
     --auth-text-dark:      #1e293b
     --auth-text-muted:     #64748b  (slate 500)
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */
/* Auth color defaults at :root so theme injection can override them */
:root {
  --auth-primary-dark: #042f2e;
  --auth-primary: #134e4a;
  --auth-accent: #14b8a6;
  --auth-accent-hover: #0d9488;
  --auth-accent-light: #2dd4bf;
}

#s-LoginPage,
#s-SignUpPage {
  --auth-surface: #ffffff;
  --auth-text-dark: #1e293b;
  --auth-text-muted: #64748b;
  --auth-border: #e2e8f0;
  --auth-bg-subtle: #f8fafc;
}

/* ---------- Body reset for auth pages ---------- */
#s-LoginPage,
#s-SignUpPage {
  background: var(--auth-surface);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- Auth Wrapper: split-screen grid ---------- */
.auth-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  width: 100%;
}

/* ==========================================================================
   LEFT PANEL: Branding
   ========================================================================== */
.auth-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 3rem 2.5rem;
  background-image: url(auth-bg.jpg);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  text-align: center;
}

/* Dark gradient overlay for text readability */
.auth-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--auth-primary-dark) 95%, transparent) 0%,
    color-mix(in srgb, var(--auth-primary) 80%, transparent) 35%,
    color-mix(in srgb, var(--auth-primary-dark) 55%, transparent) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* Subtle bottom accent line */
.auth-brand-panel::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--auth-accent), transparent);
  pointer-events: none;
}

/* -- Branding content -- */
.auth-brand-content {
  position: relative;
  z-index: 1;
  max-width: 380px;
}

.auth-brand-content .auth-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px;
  box-sizing: border-box;
  margin: 0 auto 1.5rem;
  display: block;
  transition: transform 0.3s ease;
}

.auth-brand-content .auth-logo:hover {
  transform: scale(1.05);
}

.auth-brand-content .auth-brand-title {
  display: block;
  color: #ffffff;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.auth-brand-content .auth-brand-subtitle {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.auth-brand-content .auth-brand-tagline {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

/* Feature highlights on the branding panel */
.auth-brand-features {
  text-align: left;
  width: 100%;
}

.auth-brand-features .auth-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.auth-brand-features .auth-feature-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(20, 184, 166, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-accent-light);
  font-size: 0.95rem;
}

.auth-brand-features .auth-feature-text {
  flex: 1;
}

.auth-brand-features .auth-feature-text strong {
  display: block;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.auth-brand-features .auth-feature-text span {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  line-height: 1.4;
}


/* ==========================================================================
   RIGHT PANEL: Form
   ========================================================================== */
.auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 2.5rem;
  background: var(--auth-surface);
  overflow-y: auto;
}

/* Ensure s-full-page inside form panel adapts correctly */
.auth-form-panel .s-full-page {
  min-height: auto;
  width: 100%;
  max-width: 420px;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* SignUp uses s-container-narrow which should be wider */
.auth-form-panel .s-container-narrow {
  max-width: 480px;
}

.auth-form-panel .s-container-tight {
  max-width: 380px;
}


/* ---------- Form Panel heading ---------- */
#s-LoginPage .s-Panel > h5,
#s-SignUpPage .s-Panel > h5 {
  color: var(--auth-text-dark);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

/* ---------- Form info text (SignUp) ---------- */
#s-SignUpPage .s-Panel > p {
  color: var(--auth-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* ---------- s-Panel card styling on form side ---------- */
#s-LoginPage .s-Panel,
#s-SignUpPage .s-Panel {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

/* ---------- Form field labels ---------- */
#s-LoginPage .field .caption,
#s-SignUpPage .field .caption {
  color: var(--auth-text-dark);
  font-weight: 600;
  font-size: 0.82rem;
  text-align: start;
  width: 100%;
}

/* Force vertical layout for auth form fields */
#s-LoginPage .field,
#s-SignUpPage .field {
  flex-wrap: wrap;
}

#s-LoginPage .field .caption,
#s-SignUpPage .field .caption {
  flex: 0 0 100%;
  margin-right: 0;
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

/* ---------- Input fields ---------- */
#s-LoginPage .field input.editor,
#s-LoginPage .field .form-control,
#s-SignUpPage .field input.editor,
#s-SignUpPage .field .form-control {
  background: var(--auth-bg-subtle);
  border: 1.5px solid var(--auth-border);
  border-radius: 0.5rem;
  color: var(--auth-text-dark);
  font-size: 0.925rem;
  padding: 0.65rem 0.85rem;
  height: auto;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#s-LoginPage .field input.editor:focus,
#s-LoginPage .field .form-control:focus,
#s-SignUpPage .field input.editor:focus,
#s-SignUpPage .field .form-control:focus {
  background: #ffffff;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
  color: var(--auth-text-dark);
  outline: none;
}

#s-LoginPage .field input.editor::placeholder,
#s-LoginPage .field .form-control::placeholder,
#s-SignUpPage .field input.editor::placeholder,
#s-SignUpPage .field .form-control::placeholder {
  color: #94a3b8;
}

/* ---------- Forgot password link ---------- */
#s-LoginPage .px-field a {
  color: var(--auth-accent);
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

#s-LoginPage .px-field a:hover {
  color: var(--auth-accent-hover);
}

/* ---------- Remember Me ---------- */
#s-LoginPage .remember-me .form-check-label {
  color: var(--auth-text-dark);
  font-size: 0.82rem;
  cursor: pointer;
}

#s-LoginPage .remember-me .form-check-input:checked {
  background-color: var(--auth-accent);
  border-color: var(--auth-accent);
}

#s-LoginPage .remember-me .form-check-input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

/* ---------- Primary button (Sign In / Sign Up) ---------- */
#s-LoginPage .btn-primary,
#s-SignUpPage .btn-primary {
  background: var(--auth-accent);
  border: none;
  border-radius: 0.5rem;
  color: #ffffff;
  font-size: 0.925rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.7rem 1.5rem;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(20, 184, 166, 0.25);
}

#s-LoginPage .btn-primary:hover,
#s-LoginPage .btn-primary:focus-visible,
#s-SignUpPage .btn-primary:hover,
#s-SignUpPage .btn-primary:focus-visible {
  background: var(--auth-accent-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.35);
}

#s-LoginPage .btn-primary:active,
#s-SignUpPage .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(20, 184, 166, 0.25);
}

/* ---------- Sign up link below the login card ---------- */
#s-LoginPage .login-signup-link {
  text-align: center;
  margin-top: 1.75rem;
  color: var(--auth-text-muted);
  font-size: 0.875rem;
}

#s-LoginPage .login-signup-link a {
  color: var(--auth-accent);
  font-weight: 600;
  transition: color 0.2s ease;
  text-decoration: none;
}

#s-LoginPage .login-signup-link a:hover {
  color: var(--auth-accent-hover);
  text-decoration: underline;
}

/* ---------- "Back to login" link for SignUp ---------- */
#s-SignUpPage .signup-login-link {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--auth-text-muted);
  font-size: 0.875rem;
}

#s-SignUpPage .signup-login-link a {
  color: var(--auth-accent);
  font-weight: 600;
  transition: color 0.2s ease;
  text-decoration: none;
}

#s-SignUpPage .signup-login-link a:hover {
  color: var(--auth-accent-hover);
  text-decoration: underline;
}

/* ---------- Activation alert ---------- */
#s-LoginPage .alert-info {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  color: var(--auth-text-dark);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  max-width: 420px;
  width: 100%;
}

/* ---------- Auth form welcome text (right panel) ---------- */
.auth-form-welcome {
  margin-bottom: 1.75rem;
}

.auth-form-welcome h2 {
  color: var(--auth-text-dark);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.auth-form-welcome p {
  color: var(--auth-text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ---------- Divider line ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  color: #94a3b8;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

.auth-divider::before {
  margin-right: 0.75rem;
}

.auth-divider::after {
  margin-left: 0.75rem;
}

/* ---------- Footer text on form panel ---------- */
.auth-form-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--auth-border);
  color: #94a3b8;
  font-size: 0.75rem;
}


/* ==========================================================================
   ENTRANCE ANIMATION
   ========================================================================== */
@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes authSlideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.auth-brand-content {
  animation: authSlideInLeft 0.6s ease-out both;
}

.auth-form-panel .s-full-page {
  animation: authFadeIn 0.5s ease-out 0.15s both;
}


/* ==========================================================================
   RESPONSIVE: Tablet (< 992px)
   ========================================================================== */
@media (max-width: 991.98px) {
  .auth-wrapper {
    grid-template-columns: 2fr 3fr;
  }

  .auth-brand-panel {
    padding: 2rem 1.5rem;
  }

  .auth-brand-content .auth-brand-tagline {
    font-size: 0.95rem;
  }

  .auth-brand-features {
    display: none;
  }
}


/* ==========================================================================
   RESPONSIVE: Mobile (< 768px)
   ========================================================================== */
@media (max-width: 767.98px) {
  .auth-wrapper {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .auth-brand-panel {
    padding: 1.75rem 1.5rem 1.5rem;
    min-height: auto;
  }

  .auth-brand-content {
    max-width: 100%;
  }

  .auth-brand-content .auth-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    padding: 8px;
    margin-bottom: 0.75rem;
  }

  .auth-brand-content .auth-brand-title {
    font-size: 1.35rem;
  }

  .auth-brand-content .auth-brand-subtitle {
    font-size: 0.7rem;
    margin-bottom: 0;
  }

  .auth-brand-content .auth-brand-tagline {
    display: none;
  }

  .auth-brand-features {
    display: none;
  }

  .auth-form-panel {
    padding: 1.5rem 1.25rem 2rem;
  }

  .auth-form-panel .s-full-page {
    max-width: 100%;
  }

  .auth-form-welcome h2 {
    font-size: 1.25rem;
  }
}


/* ==========================================================================
   RESPONSIVE: Small mobile (< 576px)
   ========================================================================== */
@media (max-width: 575.98px) {
  .auth-form-panel {
    padding: 1.25rem 1rem 2rem;
  }

  .auth-brand-panel {
    padding: 1.25rem 1rem 1rem;
  }

  .auth-brand-content .auth-brand-title {
    font-size: 1.2rem;
  }
}


/* ==========================================================================
   DARK THEME COMPATIBILITY
   ========================================================================== */
html.theme-cosmos-dark #s-LoginPage,
html.theme-cosmos-dark #s-SignUpPage,
html.theme-dark #s-LoginPage,
html.theme-dark #s-SignUpPage,
html[data-bs-theme="dark"] #s-LoginPage,
html[data-bs-theme="dark"] #s-SignUpPage {
  --auth-surface: var(--auth-primary-dark);
  --auth-text-dark: #e2e8f0;
  --auth-text-muted: #94a3b8;
  --auth-border: var(--auth-primary);
  --auth-bg-subtle: var(--auth-primary);
}

html.theme-cosmos-dark .auth-brand-panel,
html.theme-dark .auth-brand-panel,
html[data-bs-theme="dark"] .auth-brand-panel {
  background-color: var(--auth-primary-dark);
}

html.theme-cosmos-dark .auth-form-panel,
html.theme-dark .auth-form-panel,
html[data-bs-theme="dark"] .auth-form-panel {
  background: var(--auth-surface);
}

html.theme-cosmos-dark #s-LoginPage .s-Panel > h5,
html.theme-cosmos-dark #s-SignUpPage .s-Panel > h5,
html.theme-dark #s-LoginPage .s-Panel > h5,
html.theme-dark #s-SignUpPage .s-Panel > h5,
html[data-bs-theme="dark"] #s-LoginPage .s-Panel > h5,
html[data-bs-theme="dark"] #s-SignUpPage .s-Panel > h5 {
  color: #e2e8f0;
}

html.theme-cosmos-dark .auth-form-welcome h2,
html.theme-dark .auth-form-welcome h2,
html[data-bs-theme="dark"] .auth-form-welcome h2 {
  color: #e2e8f0;
}

html.theme-cosmos-dark .auth-form-welcome p,
html.theme-dark .auth-form-welcome p,
html[data-bs-theme="dark"] .auth-form-welcome p {
  color: #94a3b8;
}

html.theme-cosmos-dark #s-LoginPage .alert-info,
html.theme-dark #s-LoginPage .alert-info,
html[data-bs-theme="dark"] #s-LoginPage .alert-info {
  background: color-mix(in srgb, var(--auth-accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--auth-accent) 20%, transparent);
  color: #e2e8f0;
}


/* ==========================================================================
   REDUCED MOTION PREFERENCE
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .auth-brand-content,
  .auth-form-panel .s-full-page {
    animation: none;
  }

  #s-LoginPage .btn-primary:hover,
  #s-SignUpPage .btn-primary:hover {
    transform: none;
  }

  .auth-brand-content .auth-logo:hover {
    transform: none;
  }
}

/* ---------- RTL support ---------- */
html[dir="rtl"] .auth-brand-features .auth-feature {
  text-align: right;
}

html[dir="rtl"] .auth-brand-features .auth-feature-icon {
  order: 1;
}

/* Serenity's theme assumes a left-hand sidebar; mirror it for right-to-left languages */
html[dir="rtl"] .s-sidebar {
  left: auto;
  right: 0;
  transform: translateX(100%);
}

html[dir="rtl"] .s-sidebar-expanded .s-sidebar {
  transform: translateX(0);
}

html[dir="rtl"] .s-sidebar-pane {
  border-right: 0;
  border-left: 1px solid #e8e9ea;
}

html[dir="rtl"] .s-sidebar-header-link {
  margin-right: 0;
  margin-left: 1.5rem;
}

html[dir="rtl"] .s-sidebar-header-title {
  margin-left: 0;
  margin-right: 8px;
}

html[dir="rtl"] .s-sidebar-header-actions {
  margin-left: 0;
  margin-right: auto;
}

html[dir="rtl"] .s-sidebar-icon {
  margin-right: 0;
  margin-left: 8px;
}

html[dir="rtl"] .s-sidebar-link {
  padding: 0.2rem 18px 0.2rem 12px;
}

html[dir="rtl"] .s-sidebar-menu .s-sidebar-menu {
  margin-left: 0;
  margin-right: 1em;
}

/* the toggle is fa-angle-right: point it left when collapsed, down when expanded */
html[dir="rtl"] .s-sidebar-menu-toggle {
  transform: rotate(180deg);
}

html[dir="rtl"] [aria-expanded="true"] > .s-sidebar-menu-toggle {
  transform: rotate(90deg);
}

html[dir="rtl"] .s-sidebar-search-icon {
  left: auto;
  right: 0.4em;
}

html[dir="rtl"] .s-sidebar-search-input {
  padding-left: 0.75rem;
  padding-right: 2.3rem;
}

html[dir="rtl"] .panel-titlebar-close {
  margin-left: 0;
  margin-right: auto;
  padding-right: 6px;
  padding-left: 0;
}

/* grid scrollbars sit on the left in RTL, so reserve the scrollbar gap there instead */
html[dir="rtl"] .slick-hscrollspacer,
html[dir="rtl"] .slick-footerrow-columns.sg-main,
html[dir="rtl"] .slick-headerrow-columns.sg-main,
html[dir="rtl"] .slick-header-columns.sg-main,
html[dir="rtl"] .grid-canvas.sg-top.sg-main,
html[dir="rtl"] .grid-canvas.sg-bottom.sg-main {
  margin-right: 0;
  margin-left: var(--sg-scrollbar-w);
}

@media (min-width: 1200px) {
  html[dir="rtl"] .s-sidebar {
    transform: translateX(0);
  }

  html[dir="rtl"] .s-main {
    padding-left: 0;
    padding-right: 300px;
  }
}

/* ---------- Inline link reset ---------- */
#s-LoginPage a,
#s-SignUpPage a {
  text-decoration: none;
}

/* Sidebar menu scrolls when navigation exceeds viewport height */
#s-sidebar-menu {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

/* ---------- Folding sidebar (Modules/Common/Helpers/SidebarToggle.ts) ----------
   On a wide screen the sidebar is a strip of icons on every page as it opens
   (body.s-sidebar-pane-collapsed, set in _Layout.cshtml); pointing at the strip opens it over the page
   (.s-sidebar-peek) and the header's menu button opens it beside the page until the next page.
   Narrow screens keep Serenity's slide-in menu. */
@media (min-width: 1200px) {
  .s-sidebar-toggler {
    visibility: visible;
    width: auto !important;
  }

  :root {
    --s-sidebar-strip: 54px;
  }

  .s-sidebar,
  .s-sidebar-pane {
    transition: width 0.2s ease, box-shadow 0.2s ease;
  }

  .s-main {
    transition: padding 0.2s ease;
  }

  .s-sidebar-pane-collapsed .s-sidebar,
  .s-sidebar-pane-collapsed .s-sidebar-pane {
    width: var(--s-sidebar-strip);
  }

  .s-sidebar-pane-collapsed .s-sidebar-pane {
    overflow: hidden;
  }

  .s-sidebar-pane-collapsed .s-sidebar.s-sidebar-peek,
  .s-sidebar-pane-collapsed .s-sidebar-peek .s-sidebar-pane {
    width: 300px;
  }

  .s-sidebar-pane-collapsed .s-sidebar-peek .s-sidebar-pane {
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.2);
  }

  /* the menu keeps its open width and is cut off, so its text doesn't re-wrap while the strip opens */
  .s-sidebar-pane-collapsed #s-sidebar-menu {
    min-width: 299px;
  }

  .s-sidebar-pane-collapsed .s-main {
    padding-left: var(--s-sidebar-strip);
  }

  html[dir="rtl"] .s-sidebar-pane-collapsed .s-main {
    padding-left: 0;
    padding-right: var(--s-sidebar-strip);
  }

  /* on the strip: icons only */
  .s-sidebar-pane-collapsed .s-sidebar .s-sidebar-link-text,
  .s-sidebar-pane-collapsed .s-sidebar .s-sidebar-menu-toggle,
  .s-sidebar-pane-collapsed .s-sidebar .s-sidebar-search-input {
    transition: opacity 0.2s ease;
  }

  .s-sidebar-pane-collapsed .s-sidebar:not(.s-sidebar-peek) .s-sidebar-link-text,
  .s-sidebar-pane-collapsed .s-sidebar:not(.s-sidebar-peek) .s-sidebar-menu-toggle,
  .s-sidebar-pane-collapsed .s-sidebar:not(.s-sidebar-peek) .s-sidebar-search-input {
    opacity: 0;
  }

  .s-sidebar-pane-collapsed .s-sidebar:not(.s-sidebar-peek) .s-sidebar-menu .s-sidebar-menu {
    display: none;
  }
}

@media (min-width: 1200px) and (prefers-reduced-motion: reduce) {
  .s-sidebar,
  .s-main,
  .s-sidebar-pane-collapsed .s-sidebar * {
    transition: none !important;
  }
}

/* ==========================================================================
   INNER PAGES: the Tech5A "ambient" background
   #PageBackground (in _Layout) paints a light wash and two soft glows in the theme's primary
   colour, and the brand name (Branding > Brand Name, the text inside the div) as a large faint
   watermark, so every inner page carries the dealer's name and colour. It sits behind the content;
   cards, grids and panels stay opaque on top of it. The same rules live in the tech5a-branding
   skill (assets/tech5a-brand.css): change both.
   ========================================================================== */
#PageBackground {
  --page-bg-wash: color-mix(in srgb, var(--bs-primary) 5%, transparent);
  --page-bg-glow: color-mix(in srgb, var(--bs-primary) 18%, transparent);
  --page-bg-glow-2: color-mix(in srgb, var(--bs-primary) 12%, transparent);
  --page-bg-mark: color-mix(in srgb, var(--bs-primary) 9%, transparent);
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 48% 42% at 100% 0%, var(--page-bg-glow), transparent 70%),
    radial-gradient(ellipse 42% 38% at 0% 100%, var(--page-bg-glow-2), transparent 70%),
    linear-gradient(var(--page-bg-wash), var(--page-bg-wash));
}

/* the brand name in the bottom corner, cut off a little by the edge like a pressed mark */
#PageBackground > span {
  position: absolute;
  inset-block-end: -0.3em;
  inset-inline-end: -0.04em;
  /* the full size for a short name; a long one shrinks to fit the room beside the menu, so the whole name
     shows: --t5-mark-chars is its length (set in _Layout.cshtml), 0.65em a character covers a normal name */
  font-size: min(clamp(96px, 14vw, 220px), calc(var(--t5-mark-room) / (var(--t5-mark-chars, 8) * 0.65)));
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  white-space: nowrap;
  color: var(--page-bg-mark);
  user-select: none;
}

/* the width the page's watermark may fill: all of it while the menu overlays the page (under 1200px), else
   what the open menu (300px) or its collapsed strip leaves */
:root {
  --t5-mark-room: 100vw;
}

@media (min-width: 1200px) {
  :root {
    --t5-mark-room: calc(100vw - 300px);
  }

  .s-sidebar-pane-collapsed {
    --t5-mark-room: calc(100vw - var(--s-sidebar-strip));
  }
}

html[dir="rtl"] #PageBackground {
  background:
    radial-gradient(ellipse 48% 42% at 0% 0%, var(--page-bg-glow), transparent 70%),
    radial-gradient(ellipse 42% 38% at 100% 100%, var(--page-bg-glow-2), transparent 70%),
    linear-gradient(var(--page-bg-wash), var(--page-bg-wash));
}

html.theme-cosmos-dark #PageBackground,
html.theme-dark #PageBackground,
html[data-bs-theme="dark"] #PageBackground {
  --page-bg-wash: color-mix(in srgb, var(--bs-primary) 8%, transparent);
  --page-bg-glow: color-mix(in srgb, var(--bs-primary) 24%, transparent);
  --page-bg-glow-2: color-mix(in srgb, var(--bs-primary) 16%, transparent);
  --page-bg-mark: color-mix(in srgb, var(--bs-primary) 14%, transparent);
}

/* ---------- Accent band: the Dashboard's header in the theme colour, with the brand watermark ----------
   <div class="t5-band"> in the page's ContentHeader section, flush with the content padding; the row
   right after it gets .t5-band-overlap and sits on the band's lower edge. --t5-ink is the primary
   darkened enough to carry white text: 55% with #0b1220 keeps 4.5:1 or better for every theme colour,
   light or dark (white on it: teal-600 8.1, emerald-500 6.2, amber-400 4.6). The 86% first used here
   passed only on the default teal (4.5) and failed lighter themes (emerald 3.2, amber 2.1). */
.t5-band {
  --t5-ink: color-mix(in srgb, var(--bs-primary) 55%, #0b1220);
  container-type: inline-size;
  position: relative;
  overflow: hidden;
  margin: -1.25rem -1.25rem 0;
  padding: 2rem 2.5rem 5.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  color: #fff;
  background: linear-gradient(118deg,
    var(--t5-ink) 0%,
    color-mix(in srgb, var(--bs-primary) 38%, #0b1220) 100%);
}

.t5-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 18% -30%, rgba(255, 255, 255, 0.2), transparent 45%);
  pointer-events: none;
}

.t5-band > * {
  position: relative;
  z-index: 1;
}

.t5-band > .t5-band-mark {
  position: absolute;
  z-index: 0;
  inset-inline-end: -0.08em;
  inset-block-end: -0.33em;
  font-size: min(clamp(72px, 11vw, 176px), calc(100cqw / (var(--t5-mark-chars, 8) * 0.65)));
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.07);
  pointer-events: none;
  user-select: none;
}

.t5-band-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.88;
}

.t5-band h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.t5-band-sub {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

.t5-band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.t5-band-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 42px;
  padding: 0 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.t5-band-btn:hover,
.t5-band-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.t5-band-btn-primary {
  background: #fff;
  border-color: #fff;
  color: var(--t5-ink);
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.4);
}

.t5-band-btn-primary:hover,
.t5-band-btn-primary:focus-visible {
  background: #f1f5f9;
  color: var(--t5-ink);
}

.t5-band-overlap {
  position: relative;
  margin-top: -4rem;
}

@media (max-width: 575.98px) {
  .t5-band {
    padding: 1.5rem 1.25rem 4.75rem;
  }
}

/* ---------- Sheet: a detail page as a white sheet on the tinted desk, with a letterhead ----------
   <div class="t5-sheet"> around a page's content, .t5-sheet-narrow to cap it at reading width;
   Views/Shared/_SheetHead.cshtml renders the letterhead strip (mark, brand name, section) and the
   faint brand name along the sheet's foot; the content goes in <div class="t5-sheet-body">. */
.t5-sheet {
  --t5-ink: color-mix(in srgb, var(--bs-primary) 55%, #0b1220);
  container-type: inline-size;
  position: relative;
  overflow: hidden;
  background: var(--s-card-bg, #fff);
  border: 1px solid color-mix(in srgb, var(--bs-primary) 22%, var(--s-card-border, #e2e8f0));
  border-radius: 18px;
  box-shadow: 0 30px 70px -36px color-mix(in srgb, var(--bs-primary) 55%, rgba(15, 23, 42, 0.35));
}

.t5-sheet-narrow {
  max-width: 1140px;
}

.t5-sheet > * {
  position: relative;
  z-index: 1;
}

.t5-sheet-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.75rem;
  border-bottom: 1px solid var(--s-card-border, #f1f5f9);
  background: color-mix(in srgb, var(--bs-primary) 4%, var(--s-card-bg, #fff));
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t5-ink);
}

.t5-sheet-head img {
  width: 18px;
  height: 18px;
  vertical-align: -4px;
  margin-inline-end: 0.5rem;
}

.t5-sheet-dot {
  margin: 0 0.5rem;
  opacity: 0.5;
}

.t5-sheet > .t5-sheet-mark {
  position: absolute;
  z-index: 0;
  inset-inline-start: 1rem;
  inset-block-end: -0.3em;
  font-size: min(clamp(72px, 10vw, 150px), calc(100cqw / (var(--t5-mark-chars, 8) * 0.65)));
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  white-space: nowrap;
  color: color-mix(in srgb, var(--bs-primary) 6%, transparent);
  pointer-events: none;
  user-select: none;
}

.t5-sheet-body {
  padding: 1.5rem 1.75rem 2.5rem;
}

html.theme-cosmos-dark .t5-sheet > .t5-sheet-mark,
html.theme-dark .t5-sheet > .t5-sheet-mark,
html[data-bs-theme="dark"] .t5-sheet > .t5-sheet-mark {
  color: color-mix(in srgb, var(--bs-primary) 12%, transparent);
}

@media print {
  #PageBackground,
  .t5-sheet-head,
  .t5-sheet > .t5-sheet-mark,
  .t5-band > .t5-band-mark {
    display: none;
  }

  .t5-sheet {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .t5-sheet-body {
    padding: 0;
  }
}

/* ---------- Show/hide password (Modules/Common/Helpers/PasswordReveal.ts) ---------- */
.pw-reveal {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: stretch;
}

.pw-reveal > input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding-inline-end: 2.5rem !important;
}

/* Edge draws its own eye; one is enough */
.pw-reveal > input::-ms-reveal,
.pw-reveal > input::-ms-clear {
  display: none;
}

.pw-reveal-btn {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  z-index: 2;
}

.pw-reveal-btn:hover,
.pw-reveal-btn:focus-visible {
  color: var(--bs-primary, #2B5BE3);
}

.pw-reveal-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
  border-radius: 0.375rem;
}

.pw-reveal-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

html[data-bs-theme="dark"] .pw-reveal-btn {
  color: #94a3b8;
}

/* ==========================================================================
   SURFACES: list, form and report pages built from the dashboard's recipe (2026-11-08)
   The dashboard's KPI cards set it: a white tile with a 14px radius, a soft shadow and a 2px lift on
   hover. Every other signed-in page follows. The grid is one tile and a form panel or dialog is one
   (big surfaces stay still); the stat boxes on detail pages are small tiles (.t5-tile) and lift;
   reports sit on the sheet with one table style; and every button, toolbar button, pager button and
   menu icon moves a little on hover. The same recipe, with generic class names, is in the
   tech5a-branding skill (assets/tech5a-brand.css, "Surfaces"): change both.
   ========================================================================== */
:root {
  --t5-tile-radius: 14px;
  --t5-tile-shadow: 0 14px 34px -18px rgba(15, 23, 42, 0.35);
  --t5-tile-shadow-hover: 0 22px 44px -20px color-mix(in srgb, var(--bs-primary) 45%, rgba(15, 23, 42, 0.45));
  --t5-ease: 0.18s ease;
  /* the title colour: the primary darkened so it reads as text on white */
  --t5-title: color-mix(in srgb, var(--bs-primary) 72%, #0b1220);
  /* Bootstrap's corner radius (inputs, buttons, tool buttons, cards): a little rounder */
  --bs-border-radius: 0.5rem;
  /* Serenity's own knobs, moved onto the theme colour: toolbar and pager icons, the input focus ring,
     the column header under the pointer, the zebra rows */
  --s-tool-icon: var(--bs-primary);
  --s-pager-icon: var(--bs-primary);
  --s-input-outline: color-mix(in srgb, var(--bs-primary) 25%, transparent);
  --s-column-header-hover-bg: color-mix(in srgb, var(--bs-primary) 7%, transparent);
  --s-alt-row-bg: color-mix(in srgb, var(--bs-primary) 3%, transparent);
}

/* --t5-title is near-black on a dark surface: a light step of the primary there */
html.theme-cosmos-dark,
html.theme-dark,
html[data-bs-theme="dark"] {
  --t5-title: color-mix(in srgb, var(--bs-primary) 80%, #fff);
}

/* ---------- Tile: the dashboard card's chrome, for any box that should feel like one ---------- */
.t5-tile {
  background: var(--s-card-bg, #fff);
  border: 1px solid var(--s-card-border, rgba(0, 0, 0, 0.08));
  border-radius: var(--t5-tile-radius);
  box-shadow: var(--t5-tile-shadow);
  transition: transform var(--t5-ease), box-shadow var(--t5-ease);
}

.t5-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--t5-tile-shadow-hover);
}

/* ---------- KPI card: a figure on a tile, its colour on a 40px icon chip and on the footer link ----------
   The Dashboard's figures, Warehouse Stock's counts, AI Usage's totals. Markup:
   <div class="card kpi-card t5-tile bg-kpi-success"><div class="card-body"><i class="fa fa-th kpi-icon"></i>
   <p class="kpi-value">42</p><p class="kpi-label">Products</p></div>
   <div class="card-footer"><a href="…"><i class="fa fa-arrow-circle-right"></i> View products</a></div></div>
   .kpi-card-compact is the small stat box of a detail page; .kpi-note a line of detail under the label. */
.kpi-card {
  --kpi: var(--bs-primary, #0d6efd);
  overflow: hidden;
}

.kpi-card .card-body {
  padding: 1.1rem 1.25rem 1rem;
}

.kpi-card .kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 0.6rem;
  border-radius: 10px;
  font-size: 20px;
  color: var(--kpi);
  background: color-mix(in srgb, var(--kpi) 12%, var(--s-card-bg, #fff));
}

.kpi-card .kpi-value {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kpi-card .kpi-label {
  margin: 0;
  font-size: 13px;
  color: var(--bs-secondary-color, #475569);
}

.kpi-card .kpi-note {
  margin: 0.4rem 0 0;
  font-size: 12.5px;
  color: var(--bs-secondary-color, #475569);
}

.kpi-card .card-footer {
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: none;
  border-top: 1px solid var(--s-card-border, rgba(0, 0, 0, 0.08));
}

.kpi-card .card-footer a {
  color: var(--kpi);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.kpi-card .card-footer a:hover {
  text-decoration: underline;
}

html[dir="rtl"] .kpi-card .card-footer .fa-arrow-circle-right {
  transform: scaleX(-1);
}

.kpi-card-compact .card-body {
  padding: 0.75rem 1rem;
}

.kpi-card-compact .kpi-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 0.45rem;
  border-radius: 8px;
  font-size: 16px;
}

.kpi-card-compact .kpi-value {
  font-size: 20px;
  letter-spacing: -0.01em;
}

.bg-kpi-success { --kpi: #198754; }
.bg-kpi-warning { --kpi: #b45309; }
.bg-kpi-danger { --kpi: #dc3545; }

/* ---------- Page title: one weight everywhere, a short accent rule under it ---------- */
section.content-header > h1,
.grid-title,
.panel-titlebar {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--t5-title);
}

section.content-header > h1,
.grid-title > .title-text,
.panel-titlebar > .panel-titlebar-text {
  position: relative;
  padding-bottom: 0.6rem;
}

section.content-header > h1::after,
.grid-title > .title-text::after,
.panel-titlebar > .panel-titlebar-text::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 2.25rem;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 25%, transparent));
}

html[dir="rtl"] section.content-header > h1::after,
html[dir="rtl"] .grid-title > .title-text::after,
html[dir="rtl"] .panel-titlebar > .panel-titlebar-text::after {
  background: linear-gradient(270deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 25%, transparent));
}

/* ---------- The grid as one tile; small-caps column headers; a tint under the pointer ---------- */
section.content > .s-DataGrid {
  border-radius: var(--t5-tile-radius);
  box-shadow: var(--t5-tile-shadow);
  padding: 1.25rem 1.25rem 1rem;
}

.slick-header {
  border-bottom-color: color-mix(in srgb, var(--bs-primary) 30%, var(--s-column-header-border, #ebeff2));
}

.slick-header-column {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.slick-row {
  transition: background-color var(--t5-ease);
}

.slick-row:hover,
.slick-row.odd:hover {
  background-color: color-mix(in srgb, var(--bs-primary) 8%, transparent);
}

.s-QuickSearchInput {
  border-radius: 999px;
}

/* ---------- Toolbar buttons: ghost buttons that lift; the main action (New, Save) filled in the theme
   colour; Delete warms to red ---------- */
.s-Toolbar .tool-button {
  background: var(--s-card-bg, #fff);
  border-color: color-mix(in srgb, var(--bs-primary) 18%, var(--bs-border-color, #dee2e6));
  font-weight: 500;
  transition: background-color var(--t5-ease), border-color var(--t5-ease), color var(--t5-ease),
    transform var(--t5-ease), box-shadow var(--t5-ease);
}

.s-Toolbar .tool-button:hover:not(.disabled) {
  position: relative;
  z-index: 1; /* the lifted button's border over its neighbours: the group overlaps borders by 1px */
  background: color-mix(in srgb, var(--bs-primary) 8%, var(--s-card-bg, #fff));
  border-color: color-mix(in srgb, var(--bs-primary) 45%, var(--bs-border-color, #dee2e6));
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--bs-primary) 60%, rgba(15, 23, 42, 0.4));
}

.s-Toolbar .tool-button:active:not(.disabled) {
  transform: translateY(0);
  box-shadow: none;
}

/* Serenity colours its stock icons itself (.text-blue, .text-purple, with !important): the theme colour instead */
.s-Toolbar .tool-button .button-inner > i.text-blue,
.s-Toolbar .tool-button .button-inner > i.text-purple {
  color: var(--s-tool-icon) !important;
}

.s-Toolbar .tool-button.add-button,
.s-Toolbar .tool-button.save-and-close-button {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
  font-weight: 600;
}

.s-Toolbar .tool-button.add-button .button-inner > i,
.s-Toolbar .tool-button.save-and-close-button .button-inner > i {
  color: #fff !important;
}

.s-Toolbar .tool-button.add-button:hover:not(.disabled),
.s-Toolbar .tool-button.save-and-close-button:hover:not(.disabled) {
  background: color-mix(in srgb, var(--bs-primary) 86%, #0b1220);
  border-color: color-mix(in srgb, var(--bs-primary) 86%, #0b1220);
  color: #fff;
}

.s-Toolbar .tool-button.delete-button:hover:not(.disabled) {
  background: color-mix(in srgb, var(--bs-danger, #dc3545) 8%, var(--s-card-bg, #fff));
  border-color: color-mix(in srgb, var(--bs-danger, #dc3545) 45%, var(--bs-border-color, #dee2e6));
}

.slick-pg-btn {
  border-radius: 8px;
  transition: background-color var(--t5-ease), transform var(--t5-ease);
}

.slick-pg-btn:hover {
  background: color-mix(in srgb, var(--bs-primary) 10%, transparent);
  transform: translateY(-1px);
}

/* ---------- Buttons lift on hover, everywhere ---------- */
.btn {
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,
    box-shadow var(--t5-ease), transform var(--t5-ease), filter var(--t5-ease);
}

.btn:hover:not(:disabled):not(.disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -10px rgba(15, 23, 42, 0.55);
}

.btn-primary:hover:not(:disabled):not(.disabled) {
  box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--bs-primary) 80%, rgba(15, 23, 42, 0.6));
}

.btn:active:not(:disabled):not(.disabled),
.btn.btn-link:hover {
  transform: translateY(0);
  box-shadow: none;
}

.t5-band-btn {
  transition: background-color var(--t5-ease), transform var(--t5-ease), box-shadow var(--t5-ease);
}

.t5-band-btn:hover,
.t5-band-btn:focus-visible {
  transform: translateY(-1px);
}

/* ---------- Menu: links fade, the icon steps forward; top-bar icons rise ---------- */
.s-sidebar-link {
  transition: background-color var(--t5-ease), color var(--t5-ease);
}

.s-sidebar-link > .s-sidebar-icon {
  transition: transform var(--t5-ease), color var(--t5-ease);
}

.s-sidebar-link:hover > .s-sidebar-icon {
  transform: translateX(2px);
}

html[dir="rtl"] .s-sidebar-link:hover > .s-sidebar-icon {
  transform: translateX(-2px);
}

.s-sidebar-header-link {
  transition: transform var(--t5-ease), opacity var(--t5-ease);
}

.s-sidebar-header-link:hover {
  transform: translateY(-1px);
}

/* ---------- Forms: the panel and the dialog as tiles, letterhead-style group titles, calm fields ---------- */
section.content > .s-Panel {
  border-radius: var(--t5-tile-radius);
  box-shadow: var(--t5-tile-shadow);
  padding: 1.25rem 1.5rem 1.5rem;
}

.modal {
  --bs-modal-border-radius: var(--t5-tile-radius);
  --bs-modal-inner-border-radius: calc(var(--t5-tile-radius) - 1px);
}

.modal-content {
  box-shadow: 0 30px 70px -36px color-mix(in srgb, var(--bs-primary) 55%, rgba(15, 23, 42, 0.5));
}

.modal-header {
  background-color: color-mix(in srgb, var(--bs-primary) 4%, var(--s-card-bg, #fff));
}

.modal-title {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--t5-title);
}

.category-title,
.category-title a {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t5-title);
}

.category-title::before,
.category-title::after {
  border-bottom-color: color-mix(in srgb, var(--bs-primary) 28%, transparent);
}

.field > .caption {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bs-secondary-color, #475569);
}

.field .editor:hover:not(:focus):not(.readonly):not([readonly]):not(.s-DataGrid) {
  border-color: color-mix(in srgb, var(--bs-primary) 40%, var(--bs-border-color, #dee2e6));
}

/* ---------- Reports: the filter row, the table and its totals ----------
   /Reports/* (Views/Reports/ReportTable.cshtml), the financial statements, the General Ledger and the
   Bank Reconciliation Report sit on the sheet and share these; a report keeps only its own extras in
   its view (Financial/Statements/_StatementStyles.cshtml). .btn-apply and .btn-print are the plain
   buttons of those forms. */
.report-page {
  max-width: 1100px;
}

form.report-filter {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  max-width: none;
  margin: 0 0 18px;
}

.report-filter > div {
  flex: 0 0 auto;
  margin: 0;
}

.report-filter label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--bs-secondary-color, #64748b);
}

.report-filter input,
.report-filter select {
  min-width: 160px;
  padding: 7px 10px;
  border: 1px solid var(--bs-border-color, #ced4da);
  border-radius: var(--bs-border-radius);
  background: var(--s-input-bg, #fff);
}

.btn-apply,
.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 18px;
  border-radius: var(--bs-border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--t5-ease), border-color var(--t5-ease), color var(--t5-ease),
    transform var(--t5-ease), box-shadow var(--t5-ease);
}

.btn-apply {
  background: var(--bs-primary);
  border: 1px solid var(--bs-primary);
  color: #fff;
}

.btn-apply:hover {
  background: color-mix(in srgb, var(--bs-primary) 86%, #0b1220);
  border-color: color-mix(in srgb, var(--bs-primary) 86%, #0b1220);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--bs-primary) 80%, rgba(15, 23, 42, 0.6));
}

.btn-print {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--bs-primary) 45%, transparent);
  color: var(--bs-primary);
}

.btn-print:hover {
  background: color-mix(in srgb, var(--bs-primary) 8%, var(--s-card-bg, #fff));
  border-color: var(--bs-primary);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -10px rgba(15, 23, 42, 0.4);
}

.btn-apply:active,
.btn-print:active {
  transform: translateY(0);
  box-shadow: none;
}

.report-table {
  width: 100%;
  margin-bottom: 24px;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--s-card-bg, #fff);
}

.report-table th {
  padding: 9px 12px;
  text-align: start;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t5-title);
  background: color-mix(in srgb, var(--bs-primary) 7%, var(--s-card-bg, #fff));
  border-bottom: 2px solid color-mix(in srgb, var(--bs-primary) 45%, transparent);
}

.report-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--s-cell-border, rgba(53, 68, 78, 0.1));
}

.report-table tbody tr {
  transition: background-color var(--t5-ease);
}

.report-table tbody tr:hover {
  background-color: color-mix(in srgb, var(--bs-primary) 6%, transparent);
}

.report-table .num,
.report-table .text-end {
  font-variant-numeric: tabular-nums;
}

.report-table .num {
  text-align: end;
}

.report-table tr.total-row td {
  font-weight: 700;
  border-top: 2px solid var(--bs-primary);
  background: color-mix(in srgb, var(--bs-primary) 6%, var(--s-card-bg, #fff));
}

.report-table .neg {
  color: var(--bs-danger, #dc3545);
}

.report-section-title {
  margin: 18px 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--bs-primary);
}

.report-meta {
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--bs-secondary-color, #6c757d);
}

.report-empty {
  padding: 24px 0;
  color: var(--bs-secondary-color, #6c757d);
}

/* the other tables on a sheet (stock by warehouse, a phone's history): the same tint under the pointer */
.t5-sheet-body table:not(.report-table) tbody tr:hover > td {
  background-color: color-mix(in srgb, var(--bs-primary) 6%, transparent);
}

/* ==========================================================================
   QUICK ACCESS: the dock in the top bar (Views/Shared/_QuickDock.cshtml, 2026-11-10)
   The most-used actions, one click from any page: a pill in the middle of the top bar, which stays put
   while the page scrolls. One button is filled (the action
   used most), up to four sit beside it, the rest are in the More menu, grouped. Wide screens show
   every label; under 1500px the unfilled buttons are icons whose label drops under the pointer;
   under 1100px the buttons fold into the More menu; on a phone the menu's button floats in the
   bottom corner, where a thumb reaches it. The list is Modules/Common/QuickAccess/QuickActions.cs.
   The same rules live in the tech5a-branding skill (assets/tech5a-brand.css): change both.
   ========================================================================== */
.t5-dock {
  --t5-ink: color-mix(in srgb, var(--bs-primary) 55%, #0b1220);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

/* the brand before the dock and the icons after it share the free room equally, which puts the dock in
   the middle of the bar; a side that needs more than its share (a long brand name) takes it, and the
   dock moves over instead of covering anything */
.s-sidebar-header:has(> .t5-dock) > .s-sidebar-header-branding {
  flex: 1 1 0;
}

html .t5-dock ~ .s-sidebar-header-actions {
  flex: 1 1 0;
  justify-content: flex-end;
  margin-left: 0;
  margin-right: 0;
}

.t5-dock-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 32px;
  min-width: 32px;
  padding: 0 0.75rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--t5-ease), transform var(--t5-ease), box-shadow var(--t5-ease);
}

.t5-dock-btn > .fa {
  font-size: 1.2rem;
}

.t5-dock-btn:hover,
.t5-dock-btn:focus-visible,
.t5-dock-btn.show {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
  transform: translateY(-1px);
}

.t5-dock-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.t5-dock-btn-primary {
  background: #fff;
  color: var(--t5-ink);
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.45);
}

.t5-dock-btn-primary:hover,
.t5-dock-btn-primary:focus-visible {
  background: #f1f5f9;
  color: var(--t5-ink);
}

.t5-dock-more > .t5-dock-btn {
  padding: 0;
  width: 32px;
}

/* the dock with nothing under More (a person whose menu has only the bar's screens) */
@media (min-width: 1100px) {
  .t5-dock-flat > .t5-dock-more {
    display: none;
  }
}

/* ---------- the More menu: a tile with its groups side by side ---------- */
.t5-dock-menu {
  padding: 0.6rem;
  border: 0;
  border-radius: var(--t5-tile-radius);
  box-shadow: var(--t5-tile-shadow), 0 0 0 1px rgba(15, 23, 42, 0.06);
  font-size: 0.875rem;
}

/* on a dark page the soft shadow is lost: a light hairline marks the menu's edge instead */
html.theme-cosmos-dark .t5-dock-menu,
html.theme-dark .t5-dock-menu,
html[data-bs-theme="dark"] .t5-dock-menu {
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* a menu in the top bar is placed by these rules, not by a script: under its button, centred on it */
.t5-dock-more > .t5-dock-menu.dropdown-menu {
  top: calc(100% + 0.6rem);
  left: 50%;
  right: auto;
  margin: 0;
  translate: -50% 0;
}

.t5-dock-menu.show {
  display: flex;
  gap: 0.25rem 0.75rem;
  animation: t5-dock-pop 0.16s ease-out;
}

@keyframes t5-dock-pop {
  from {
    opacity: 0;
    translate: -50% -6px;
  }
}

@keyframes t5-dock-rise {
  from {
    opacity: 0;
    translate: 0 6px;
  }
}

.t5-dock-group {
  min-width: 12.5rem;
}

.t5-dock-menu .dropdown-header {
  padding: 0.35rem 0.6rem 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

.t5-dock-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  transition: background-color var(--t5-ease), color var(--t5-ease);
}

.t5-dock-menu .dropdown-item > .icon {
  flex: 0 0 1.25rem;
  font-size: 1.15rem;
  text-align: center;
  color: var(--bs-primary);
  transition: transform var(--t5-ease);
}

.t5-dock-menu .dropdown-item:hover,
.t5-dock-menu .dropdown-item:focus-visible {
  background: color-mix(in srgb, var(--bs-primary) 10%, transparent);
  color: var(--bs-body-color);
}

.t5-dock-menu .dropdown-item:hover > .icon {
  transform: translateX(2px);
}

html[dir="rtl"] .t5-dock-menu .dropdown-item:hover > .icon {
  transform: translateX(-2px);
}

/* the bar's actions, listed in the menu only while the buttons are folded away */
.t5-dock-group-bar {
  display: none;
}

/* ---------- under 1500px: icons, the label under the pointer (the filled button keeps its label) ---------- */
@media (max-width: 1499.98px) {
  .t5-dock-btn:not(.t5-dock-btn-primary) {
    padding: 0;
    width: 32px;
  }

  .t5-dock-btn:not(.t5-dock-btn-primary) > .t5-dock-label {
    position: absolute;
    top: calc(100% + 11px);
    left: 50%;
    z-index: 1;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    background: #0b1220;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0;
    transform: translate(-50%, -4px);
    pointer-events: none;
    transition: opacity var(--t5-ease), transform var(--t5-ease);
  }

  .t5-dock-btn:hover > .t5-dock-label,
  .t5-dock-btn:focus-visible > .t5-dock-label {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ---------- under 1100px: one button; its menu lists the bar's actions first ---------- */
@media (max-width: 1099.98px) {
  .t5-dock > .t5-dock-btn {
    display: none;
  }

  .t5-dock-group-bar {
    display: block;
  }

  .t5-dock-group-bar > .dropdown-item:first-child {
    font-weight: 600;
  }
}

@media (max-width: 767.98px) {
  .t5-dock-menu.show {
    flex-direction: column;
    max-height: calc(100vh - 9rem);
    overflow-y: auto;
  }
}

/* ---------- on a phone: the button floats in the bottom corner, the menu opens above it ---------- */
@media (max-width: 575.98px) {
  .t5-dock {
    position: fixed;
    inset-block-end: 1rem;
    inset-inline-end: 1rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
  }

  .t5-dock-more > .t5-dock-btn {
    width: 52px;
    height: 52px;
    background: var(--t5-ink);
    box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.18);
  }

  .t5-dock-more > .t5-dock-btn > .fa {
    font-size: 1.6rem;
  }

  .t5-dock-more > .t5-dock-menu.dropdown-menu {
    top: auto;
    bottom: calc(100% + 0.6rem);
    left: auto;
    inset-inline-end: 0;
    translate: none;
    min-width: 15rem;
    max-height: calc(100vh - 10rem);
  }

  .t5-dock-menu.show {
    animation-name: t5-dock-rise;
  }

  .t5-dock-more > .t5-dock-btn:hover,
  .t5-dock-more > .t5-dock-btn.show {
    background: color-mix(in srgb, var(--bs-primary) 70%, #0b1220);
  }
}

@media print {
  .s-sidebar-pane,
  .s-sidebar-header,
  .report-filter,
  .statement-presets,
  .btn-apply,
  .btn-print,
  section.content-header > h1::after {
    display: none !important;
  }

  .s-main,
  section.content {
    margin: 0 !important;
    padding: 0 !important;
  }

  body {
    background: #fff !important;
  }

  section.content > .s-DataGrid,
  section.content > .s-Panel,
  .t5-tile {
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .t5-tile,
  .btn,
  .t5-band-btn,
  .tool-button,
  .slick-pg-btn,
  .slick-row,
  .report-table tbody tr,
  .btn-apply,
  .btn-print,
  .s-sidebar-link,
  .s-sidebar-link > .s-sidebar-icon,
  .s-sidebar-header-link,
  .t5-dock-btn,
  .t5-dock-label,
  .t5-dock-menu .dropdown-item,
  .t5-dock-menu .dropdown-item > .icon {
    transition: none !important;
  }

  .t5-dock-menu.show {
    animation: none;
  }

  .t5-tile:hover,
  .btn:hover,
  .t5-band-btn:hover,
  .tool-button:hover,
  .slick-pg-btn:hover,
  .btn-apply:hover,
  .btn-print:hover,
  .s-sidebar-link:hover > .s-sidebar-icon,
  .s-sidebar-header-link:hover,
  .t5-dock-btn:hover,
  .t5-dock-menu .dropdown-item:hover > .icon {
    transform: none !important;
  }
}
