/* ============================================================================
   TLS NOVA v2 — Clean Enterprise Design System for Frappe / ERPNext v16
   ----------------------------------------------------------------------------
   Modeled on the MyTecGlobal reference UI: bright airy canvas, white sidebar
   with a blue active pill + left accent bar, royal-blue actions, pill search
   inputs, chip statuses with dot indicators, roomy white data cards.

   Loads AFTER tls_custom_css.css (see hooks.py) so it owns the cascade.
   The legacy layer's !important rules resolve through CSS variables
   (--tls-primary*, --tls-sidebar-*), so this file re-themes them by
   redefining those variables — no specificity war, fully upgrade-safe.
   ============================================================================ */

/* ===========================================================================
   1 · TOKENS — LIGHT
   =========================================================================== */
:root,
[data-theme="light"] {
  /* Accent — royal blue, flat and confident (reference: "Add New", links) */
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-active: #1e40af;
  --brand-subtle: #eaf1ff;
  --brand-subtle-2: #dbe7fe;
  --brand-wash: #f5f8ff;
  --brand-ring: rgba(37, 99, 235, 0.18);

  /* Legacy layer accent variables (carry !important downstream) */
  --tls-primary: var(--brand);
  --tls-primary-hover: var(--brand-hover);
  --tls-primary-light: var(--brand-subtle);
  --tls-primary-subtle: rgba(37, 99, 235, 0.06);
  --tls-focus-ring: 0 0 0 3px var(--brand-ring);

  /* Frappe blue ramp follows the brand */
  --blue-50: #f5f8ff;  --blue-100: #eaf1ff;  --blue-200: #dbe7fe;
  --blue-300: #bfd4fd;  --blue-400: #60a5fa;  --blue-500: #3b82f6;
  --blue-600: #2563eb;  --blue-700: #1d4ed8;  --blue-800: #1e40af;
  --blue-900: #1e3a8a;

  /* Neutrals — cool, slightly warm-gray canvas like the reference */
  --gray-50: #f8fafc;  --gray-100: #f2f5f9;  --gray-200: #e7ebf1;
  --gray-300: #d7deea;  --gray-400: #9aa5b8;  --gray-500: #64748b;
  --gray-600: #475569;  --gray-700: #334155;  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Surfaces */
  --bg-color: #f4f6f9;
  --fg-color: #ffffff;
  --card-bg: #ffffff;
  --navbar-bg: #ffffff;
  --subtle-accent: #f8fafc;
  --subtle-fg: #f2f5f9;
  --fg-hover-color: #f3f6fa;
  --control-bg: #f2f5f9;
  --control-bg-on-gray: #e7ebf1;
  --awesomebar-focus-bg: #ffffff;
  --modal-bg: #ffffff;
  --toast-bg: #ffffff;
  --popover-bg: #ffffff;
  --highlight-color: #f8fafc;
  --disabled-control-bg: #f2f5f9;
  --disabled-text-color: #9aa5b8;

  /* Text */
  --heading-color: #0f1a2a;
  --text-color: #2c3a4d;
  --text-muted: #8a96a8;
  --text-light: #5a6a80;
  --text-neutral: #2c3a4d;

  /* Borders */
  --border-color: #e7ebf1;
  --dark-border-color: #d7deea;
  --table-border-color: #edf0f5;
  --btn-group-border-color: #d7deea;

  /* Buttons */
  --btn-primary: var(--brand);
  --btn-default-bg: #ffffff;
  --btn-default-hover-bg: #f3f6fa;
  --btn-ghost-hover-bg: #f3f6fa;
  --primary: var(--brand);
  --primary-color: var(--brand);
  --brand-color: var(--brand);

  /* Geometry — soft and generous, like the reference cards */
  --border-radius-sm: 8px;
  --border-radius: 10px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-full: 9999px;
  --navbar-height: 56px;
  --input-height: 34px;
  --btn-height: 34px;
  --sidebar-width: 252px;
  /* Frappe caps form content at 900px by default — far too narrow for an
     enterprise two/three-column layout */
  --page-max-width: 1160px;

  /* Legacy form tokens — keep them aligned with the current palette */
  --tls-form-label: var(--text-light);
  --tls-form-placeholder: #9aa5b8;
  /* Form pages sit on a clearly-gray canvas so the white form card stands
     out (the legacy layer paints .page-container with this token) */
  --tls-form-page-bg: #eef1f6;
  --tls-form-card-border: var(--border-color);

  /* Elevation — very soft, barely-there */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.03);
  --shadow-base: 0 2px 6px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 8px 24px -6px rgba(16, 24, 40, 0.10), 0 2px 6px -2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 16px 40px -10px rgba(16, 24, 40, 0.14), 0 6px 14px -6px rgba(16, 24, 40, 0.07);
  --shadow-2xl: 0 28px 60px -14px rgba(16, 24, 40, 0.20);
  --card-shadow: var(--shadow-sm);
  --modal-shadow: var(--shadow-2xl);
  --btn-shadow: var(--shadow-xs);

  --focus-default: 0 0 0 3px var(--brand-ring);

  /* Sidebar — WHITE, calm. Selected state shares the brand hue with the
     primary button but at a much softer wash, so the primary action stays
     the single strong emphasis on screen. */
  --tls-sidebar-bg: #ffffff;
  --tls-sidebar-border: #e9edf3;
  --tls-sidebar-section-label: #98a3b5;
  --tls-sidebar-item-text: #5a6a80;
  --tls-sidebar-item-hover-bg: #f3f6fa;
  --tls-sidebar-active-bg: rgba(37, 99, 235, 0.07);
  --tls-sidebar-active-bar: var(--brand);
  --tls-sidebar-active-text: var(--brand);
  --surface-menu-bar: #ffffff;
  --sidebar-hover-color: #f3f6fa;
  --sidebar-active-color: rgba(37, 99, 235, 0.07);
  --sidebar-border-color: #e9edf3;
  --divider-color: #edf0f5;
  --sidebar-select-color: rgba(37, 99, 235, 0.07);

  --font-stack: "InterVariable", "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ===========================================================================
   2 · TOKENS — DARK (clean standard dark, same design language)
   =========================================================================== */
[data-theme="dark"] {
  --brand: #4f8bf7;
  --brand-hover: #6ba1f9;
  --brand-active: #3b78ec;
  --brand-subtle: rgba(59, 130, 246, 0.16);
  --brand-subtle-2: rgba(59, 130, 246, 0.26);
  --brand-wash: rgba(59, 130, 246, 0.09);
  --brand-ring: rgba(96, 165, 250, 0.30);

  --tls-primary: var(--brand);
  --tls-primary-hover: var(--brand-hover);
  --tls-primary-light: var(--brand-subtle);
  --tls-primary-subtle: rgba(59, 130, 246, 0.10);

  --blue-50: #101a30;  --blue-100: #14213c;  --blue-200: #1c2f57;
  --blue-300: #29417a;  --blue-400: #3b78ec;  --blue-500: #4f8bf7;
  --blue-600: #6ba1f9;  --blue-700: #8db7fa;  --blue-800: #b4d0fc;
  --blue-900: #d8e6fe;

  --gray-50: #0f1524;  --gray-100: #131a2c;  --gray-200: #202940;
  --gray-300: #2e3a58;  --gray-400: #64748b;  --gray-500: #8b98b0;
  --gray-600: #a9b4c9;  --gray-700: #c6cfdf;  --gray-800: #e2e8f2;
  --gray-900: #f1f5fa;

  --bg-color: #0d1321;
  --fg-color: #131a2c;
  --card-bg: #131a2c;
  --navbar-bg: #111726;
  --subtle-accent: #0f1524;
  --subtle-fg: #182036;
  --fg-hover-color: #1a2340;
  --control-bg: #101828;
  --control-bg-on-gray: #202940;
  --awesomebar-focus-bg: #131a2c;
  --modal-bg: #141c30;
  --toast-bg: #141c30;
  --popover-bg: #161f35;
  --highlight-color: #161f35;
  --disabled-control-bg: #101828;
  --disabled-text-color: #64748b;

  --heading-color: #f1f5fa;
  --text-color: #dee6f2;
  --text-muted: #8b98b0;
  --text-light: #a9b4c9;
  --text-neutral: #dee6f2;

  --border-color: #202940;
  --dark-border-color: #2e3a58;
  --table-border-color: #1d2740;
  --btn-group-border-color: #2e3a58;

  --btn-primary: var(--brand);
  --btn-default-bg: #182036;
  --btn-default-hover-bg: #202940;
  --btn-ghost-hover-bg: #1a2340;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-base: 0 2px 6px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px -6px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 16px 40px -10px rgba(0, 0, 0, 0.65);
  --shadow-2xl: 0 28px 60px -14px rgba(0, 0, 0, 0.75);
  --card-shadow: var(--shadow-sm);
  --modal-shadow: var(--shadow-2xl);
  --focus-default: 0 0 0 3px var(--brand-ring);

  --tls-form-page-bg: #0a0f1c;
  --tls-form-card-border: var(--border-color);
  --tls-sidebar-bg: #10182b;
  --tls-sidebar-border: #1d2740;
  --tls-sidebar-section-label: #64748b;
  --tls-sidebar-item-text: #8fa0ba;
  --tls-sidebar-item-hover-bg: rgba(255, 255, 255, 0.05);
  --tls-sidebar-active-bg: rgba(59, 130, 246, 0.11);
  --tls-sidebar-active-bar: #60a5fa;
  --tls-sidebar-active-text: #93c5fd;
  --surface-menu-bar: #10182b;
  --sidebar-hover-color: rgba(255, 255, 255, 0.05);
  --sidebar-active-color: rgba(59, 130, 246, 0.11);
  --sidebar-border-color: #1d2740;
  --divider-color: #1d2740;
}

/* ===========================================================================
   3 · BASE
   =========================================================================== */
body {
  font-feature-settings: "cv05" 1, "cv08" 1, "ss01" 1;
  letter-spacing: -0.006em;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
::selection { background: var(--brand-subtle-2); color: var(--heading-color); }
input, textarea, select { accent-color: var(--brand); }
h1, h2, h3, .page-title .title-text, .modal-title { letter-spacing: -0.015em; }

/* ===========================================================================
   4 · SIDEBAR — white panel, blue active pill + left bar (reference look).
       The legacy layer already draws this structure via --tls-sidebar-*;
       the refined values live in the token blocks above. Below is polish.
   =========================================================================== */
.body-sidebar {
  background: var(--tls-sidebar-bg) !important;
  border-right: 1px solid var(--tls-sidebar-border) !important;
}
.body-sidebar-container.expanded .body-sidebar {
  box-shadow: none;
}

/* Sidebar header (workspace title + switcher) */
.body-sidebar .sidebar-header .header-title {
  color: var(--heading-color);
  font-weight: 600;
}
.body-sidebar .sidebar-header .header-subtitle { color: var(--text-muted); }
.body-sidebar .sidebar-header button { border-radius: 8px; }
.body-sidebar .sidebar-header button:hover { background: var(--fg-hover-color); }
.body-sidebar .header-logo-container { border-radius: 10px; }

/* Section labels — small caps, quiet */
.body-sidebar .section-break .sidebar-item-label,
.body-sidebar .item-anchor.section-break {
  color: var(--tls-sidebar-section-label) !important;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* Item rows — calm gray, icons match text */
.body-sidebar .standard-sidebar-item .item-anchor:not(.section-break) {
  font-weight: 500;
}
.body-sidebar .standard-sidebar-item .item-anchor:not(.section-break) svg,
.body-sidebar .standard-sidebar-item .item-anchor:not(.section-break) use {
  stroke: #7a889d !important;
}
.body-sidebar .standard-sidebar-item:not(.active-sidebar):has(a.item-anchor):hover .item-anchor:not(.section-break) {
  color: var(--heading-color) !important;
}

/* Active row — light blue pill, blue text/icon, slim left bar */
.body-sidebar .standard-sidebar-item.active-sidebar .item-anchor {
  font-weight: 600 !important;
}
.body-sidebar .standard-sidebar-item.active-sidebar .sidebar-item-icon svg,
.body-sidebar .standard-sidebar-item.active-sidebar .sidebar-item-icon use {
  stroke: var(--brand) !important;
}
.body-sidebar .standard-sidebar-item.active-sidebar::before {
  width: 3px;
  border-radius: 3px;
  background: var(--brand);
  box-shadow: none;
}

/* Chevrons / shortcut chips / divider */
.body-sidebar .drop-icon { color: var(--text-muted); border-radius: 6px; }
.body-sidebar .drop-icon:hover { background: var(--fg-hover-color); }
.body-sidebar .keyboard-shortcut {
  background: var(--control-bg);
  color: var(--text-muted);
  border-radius: 5px;
}
.body-sidebar .divider { border-top-color: var(--divider-color) !important; }

/* Bottom controls */
.body-sidebar .collapse-sidebar-link,
.body-sidebar .dropdown-navbar-user { border-radius: 8px; color: var(--text-light); }
.body-sidebar .collapse-sidebar-link:hover,
.body-sidebar .dropdown-navbar-user:hover { background: var(--fg-hover-color); }

/* Cards that land inside the sidebar (onboarding, promos) */
.body-sidebar .promotional-banner,
.body-sidebar .onboarding-sidebar {
  background: var(--subtle-accent);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

/* App-switcher dropdown — clean white popover */
.sidebar-header-menu,
.body-sidebar .frappe-menu {
  background: var(--popover-bg) !important;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
}
.sidebar-header-menu .dropdown-menu-item,
.body-sidebar .frappe-menu .dropdown-menu-item { border-radius: 8px; }
.sidebar-header-menu .dropdown-menu-item:hover,
.body-sidebar .frappe-menu .dropdown-menu-item:hover {
  background-color: var(--fg-hover-color);
}

/* ===========================================================================
   5 · DESKTOP — the apps list: calm canvas, white cards, soft lift
   =========================================================================== */
.desktop-wrapper {
  min-height: 100vh;
  background: var(--bg-color);
}

/* Desktop top bar — clean white */
.desktop-wrapper .navbar-container {
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--border-color);
}
.desktop-navbar-modal-search {
  border-radius: var(--border-radius-full);
  background: var(--control-bg);
  border: 1px solid transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  max-width: 560px;
  margin: 0 auto;
  height: 36px;
}
.desktop-navbar-modal-search:hover {
  outline: none;
  border-color: var(--dark-border-color);
  background: var(--fg-color);
}

/* Icon tiles — white cards, soft shadow, gentle hover lift */
.desktop-icon {
  border-radius: 18px;
  background: var(--fg-color);
  box-shadow: inset 0 0 0 1px var(--border-color), var(--shadow-xs);
  transition: transform 0.15s cubic-bezier(0.3, 0.7, 0.4, 1),
              box-shadow 0.15s ease;
}
.desktop-icon:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px var(--border-color), var(--shadow-md);
}
.desktop-icon:active { transform: translateY(0); }
.desktop-wrapper .icon-container:hover { transform: none; }
.icon-container { border-radius: 14px; }
.icon-title {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--heading-color);
}
.icon-subtitle { color: var(--text-muted); }
.folder-icon {
  background-color: var(--subtle-fg) !important;
  box-shadow: inset 0 0 0 1px var(--border-color);
}

/* Quick, quiet entrance */
@media (prefers-reduced-motion: no-preference) {
  .desktop-container .icons > .desktop-icon {
    animation: nova-fade 0.28s ease-out both;
  }
  .desktop-container .icons > .desktop-icon:nth-child(2) { animation-delay: 0.03s; }
  .desktop-container .icons > .desktop-icon:nth-child(3) { animation-delay: 0.06s; }
  .desktop-container .icons > .desktop-icon:nth-child(4) { animation-delay: 0.09s; }
  .desktop-container .icons > .desktop-icon:nth-child(5) { animation-delay: 0.12s; }
  .desktop-container .icons > .desktop-icon:nth-child(6) { animation-delay: 0.15s; }
  .desktop-container .icons > .desktop-icon:nth-child(n + 7) { animation-delay: 0.18s; }
}
@keyframes nova-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.desktop-modal .modal-dialog .modal-content {
  border-radius: 22px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-2xl);
}

/* ===========================================================================
   6 · TOP NAVBAR (desk pages) — clean white, hairline border
   =========================================================================== */
.navbar {
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: none;
}
.nova-scrolled .navbar { box-shadow: 0 4px 16px -8px rgba(16, 24, 40, 0.08); }
.navbar .app-logo, .navbar .navbar-brand .app-logo { border-radius: 8px; }
.navbar .vertical-bar { border-right-color: var(--border-color); }
.navbar .nav-link { color: var(--text-light); }
.navbar .nav-link:hover { color: var(--heading-color); }

/* Global search — rounded pill */
#navbar-search,
.navbar .search-bar .form-control,
.navbar .search-bar input {
  border-radius: var(--border-radius-full);
  background: var(--control-bg);
  border: 1px solid transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
#navbar-search:focus,
.navbar .search-bar .form-control:focus,
.navbar .search-bar input:focus {
  background: var(--awesomebar-focus-bg);
  border-color: var(--brand);
  box-shadow: var(--focus-default);
}
.search-bar .search-icon { background: transparent; }

/* Awesomebar results */
.awesomplete ul {
  border-radius: 0 0 14px 14px;
  padding: 6px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  background: var(--popover-bg);
}
.awesomplete ul li { border-radius: 8px; padding: 8px 10px; }
.awesomplete ul li:hover,
.awesomplete ul li[aria-selected="true"] {
  background: var(--brand-wash);
  color: var(--heading-color);
}
.awesomplete mark { background: transparent; color: var(--brand); font-weight: 600; }

/* ===========================================================================
   7 · PAGE HEAD — bigger, bolder titles like the reference
   =========================================================================== */
.page-head {
  background: var(--bg-color);
  border-bottom: none;
}
.page-title .title-text {
  font-weight: 700;
  font-size: 20px;
  color: var(--heading-color);
}
.page-title .sub-heading { color: var(--text-muted); }
.page-head .page-actions .btn { border-radius: var(--border-radius); }

/* ===========================================================================
   8 · BUTTONS — flat blue primary, white bordered default
   =========================================================================== */
.btn {
  border-radius: var(--border-radius);
  font-weight: 500;
  letter-spacing: 0;
  transition: background-color 0.14s ease, box-shadow 0.14s ease,
              border-color 0.14s ease, color 0.14s ease;
}
.btn:focus-visible { box-shadow: var(--focus-default) !important; }

.btn.btn-primary,
.btn-modal-primary,
.page-actions .primary-action {
  background-color: var(--brand);
  border: 1px solid var(--brand);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}
.btn.btn-primary:hover,
.btn-modal-primary:hover,
.page-actions .primary-action:hover {
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #fff;
  box-shadow: 0 3px 8px -2px rgba(37, 99, 235, 0.35);
}
.btn.btn-primary:active { background-color: var(--brand-active); }

.btn.btn-default,
.btn.btn-secondary {
  background-color: var(--btn-default-bg);
  border: 1px solid var(--dark-border-color);
  color: var(--text-light);
  box-shadow: var(--shadow-xs);
}
.btn.btn-default:hover,
.btn.btn-secondary:hover {
  background-color: var(--btn-default-hover-bg);
  border-color: var(--gray-400);
  color: var(--heading-color);
}
.btn.btn-ghost:hover { background-color: var(--btn-ghost-hover-bg); }
.btn.icon-btn { border-radius: var(--border-radius-sm); }

/* ===========================================================================
   9 · FORMS — one wide white card, hairline section labels, roomy fields
        (reference: SDF form — "ENTITY DETAILS ————" inside a single card)
   =========================================================================== */

/* Use the available screen: widen the desk content column on large displays */
@media (min-width: 1240px) {
  .main-section .container { max-width: min(1440px, calc(100% - 40px)); }
}

/* The whole form is ONE card (Frappe already lays it out this way — give it
   the card chrome instead of fragmenting each section into its own box) */
.std-form-layout > .form-layout > .form-page {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--card-shadow);
  overflow: clip;
  padding-bottom: 6px;
}

/* Breathing room: visible gray canvas around the white card (the legacy
   layer pins tighter paddings with the same selector, so match it) */
body[data-route^="Form"] .layout-main-section-wrapper {
  padding: 20px 28px 48px 24px;
}
body[data-route^="Form"] .layout-side-section {
  padding-top: 20px;
}

/* --- Right meta rail: quiet, borderless, on the gray canvas ------------
   The legacy layer paints .layout-main and .form-sidebar white with
   !important, which turns the side panel into a big bordered block.
   Same-specificity overrides below load later and win. */
body[data-route^="Form"] .layout-main { background-color: transparent !important; }
body[data-route^="Form"] .form-sidebar { background-color: transparent !important; }
:root { --form-sidebar-width: 246px; }
.layout-side-section { border-left: none !important; }
.form-sidebar { border-left: none !important; }
body[data-route^="Form"] .form-sidebar .sidebar-section {
  border-bottom: none !important;
  padding: 10px 8px 0;
}
/* Doc header block — restacked: full-width wrapping title, ID beneath,
   icon actions as a chip row below (stock layout squeezes icons beside the
   title, truncating it), one anchoring hairline under the whole block. */
body[data-route^="Form"] .layout-side-section { padding-top: 22px; }
body[data-route^="Form"] .form-sidebar .sidebar-meta-details {
  padding-top: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--table-border-color) !important;
  margin-bottom: 4px;
}
body[data-route^="Form"] .form-sidebar .sidebar-meta-details > .flex.justify-between {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
body[data-route^="Form"] .form-sidebar .sidebar-meta-details .ellipsis { overflow: visible; }
body[data-route^="Form"] .form-sidebar .form-title-text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--heading-color);
  margin-right: 0;
}
body[data-route^="Form"] .form-sidebar .form-name-container {
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
/* icon cluster → quiet chip row under the title */
body[data-route^="Form"] .form-sidebar .form-stats-likes {
  gap: 4px;
  align-items: center !important;
}
body[data-route^="Form"] .form-sidebar .form-stats-likes .btn,
body[data-route^="Form"] .form-sidebar .form-stats-likes .like-action {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
}
body[data-route^="Form"] .form-sidebar .form-stats-likes .btn:hover,
body[data-route^="Form"] .form-sidebar .form-stats-likes .like-action:hover {
  background: rgba(15, 26, 42, 0.05);
  color: var(--text-color);
}
/* consistent rhythm for the remaining sections */
body[data-route^="Form"] .form-sidebar .sidebar-section { padding-top: 12px; }
/* Action rows (Assign / Attachments / Tags / Share) — tight and quiet */
body[data-route^="Form"] .form-sidebar .form-sidebar-items {
  font-size: 13px;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 3px 6px;
  margin: 0 -6px;
  transition: background 0.12s ease, color 0.12s ease;
}
body[data-route^="Form"] .form-sidebar .form-sidebar-items:hover {
  background: rgba(15, 26, 42, 0.045);
  color: var(--text-color);
}
body[data-route^="Form"] .form-sidebar .form-sidebar-items .icon {
  stroke: var(--text-muted);
}
/* Created / modified stamps — small print */
body[data-route^="Form"] .form-sidebar .modified-by,
body[data-route^="Form"] .form-sidebar .created-by {
  font-size: 12px;
  color: var(--text-muted);
}
body[data-route^="Form"] .form-sidebar .frappe-timestamp { font-size: 12px; }

/* Collapsible meta rail: body class set by the header toggle button
   (velto_enterprise.js); preference persists via localStorage */
body.nova-side-hidden[data-route^="Form"] .layout-side-section {
  display: none !important;
}
.nova-side-toggle svg {
  display: block;
  width: 16px !important;
  height: 16px !important;
  flex: none;
}
.nova-side-toggle.nova-side-toggle-off {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--dark-border-color));
  background: var(--brand-wash);
}

/* "Submit this document to confirm" strip → proper info banner */
body[data-route^="Form"] .form-message:not(.alert) {
  background: var(--brand-wash) !important;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: 12px;
  color: var(--text-color);
  padding: 12px 16px;
  margin-bottom: 14px;
}

/* Sections are flat regions — the section-head rule is the ONLY divider
   (no extra border-bottom per section; double lines read as clutter) */
.form-section, .form-tabbed-page .form-section {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.form-section.card-section,
body[data-route^="Form"] .form-section.card-section {
  border-bottom: none !important;
  padding-top: 6px;
  padding-bottom: 16px;
}

/* Section head — LEFT-aligned uppercase micro-label, one hairline rule
   running to the right, chevron in a soft chip at the far edge.
   (The legacy layer centers it between two lines with !important on Form
   routes — these matching-specificity rules load later and win.) */
body[data-route^="Form"] .form-section .section-head,
.form-section .section-head,
.form-dashboard-section .section-head,
.form-tab .section-head {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  gap: 12px !important;
  padding: 18px 0 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.09em !important;
  color: var(--text-muted) !important;
}
/* no left line */
body[data-route^="Form"] .form-section .section-head::before,
.form-section .section-head::before,
.form-dashboard-section .section-head::before {
  content: none !important;
  display: none !important;
}
/* single, very light rule filling the space after the label */
body[data-route^="Form"] .form-section .section-head::after,
.form-section .section-head::after,
.form-dashboard-section .section-head::after {
  content: "" !important;
  flex: 1 1 auto !important;
  min-width: 24px;
  height: 1px !important;
  background: color-mix(in srgb, var(--table-border-color) 65%, transparent) !important;
  order: 2;
}
/* chevron: soft square chip pinned to the far right, after the rule */
body[data-route^="Form"] .form-section .section-head .collapse-indicator,
.form-section .section-head .collapse-indicator {
  order: 3;
  flex: none;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--subtle-fg);
  color: var(--text-muted);
  transition: background 0.12s ease, color 0.12s ease;
}
.form-section .section-head.collapsible:hover { color: var(--text-light) !important; }
.form-section .section-head.collapsible:hover .collapse-indicator {
  background: var(--brand-subtle);
  color: var(--brand);
}

/* Labels & fields — calm weight and size (the legacy layer forces 13px/600
   near-black labels and 14px near-black text in 40px inputs with !important;
   these matching-specificity rules load later and soften them) */
.control-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 5px;
}
body[data-route^="Form"] .layout-main-section .frappe-control .control-label,
body[data-route^="Form"] .layout-main-section .frappe-control .control-label span {
  font-size: 12.5px !important;
  font-weight: 500 !important;
  color: var(--text-light) !important;
  margin-bottom: 6px !important;
}
body[data-route^="Form"] .layout-main-section .form-control {
  min-height: 38px !important;
  padding: 8px 12px !important;
  font-size: 13.5px !important;
  font-weight: 400 !important;
  color: var(--text-color) !important;
}
body[data-route^="Form"] .layout-main-section .form-control::placeholder {
  font-style: normal;
}
body[data-route^="Form"] .layout-main-section .awesomplete input {
  min-height: 38px !important;
}
body[data-route^="Form"] .layout-main-section .checkbox .label-area {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-color);
}
body[data-route^="Form"] .layout-main-section .like-disabled-input {
  font-size: 13.5px;
  font-weight: 400;
}
.form-column .frappe-control input.form-control,
.form-column .frappe-control select.form-control,
.form-column .frappe-control .link-field input {
  height: 38px;
  font-size: 13.5px;
}
.form-column .like-disabled-input {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13.5px;
}
.form-column .frappe-control[data-fieldtype="Text Editor"] .ql-editor { font-size: 13.5px; }
.form-column { margin-bottom: 4px; }

/* Tabs — inside the card, blue active underline */
.form-tabs-list { padding: 0 10px; }
.form-tabs-list .form-tabs .nav-item .nav-link { padding: 13px 0; margin: 0 14px; }

.form-control,
.input-with-feedback,
.like-disabled-input {
  border-radius: var(--border-radius);
  border: 1px solid var(--dark-border-color);
  background: var(--fg-color);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.form-control:hover { border-color: var(--gray-400); }
.form-control:focus { border-color: var(--brand); box-shadow: var(--focus-default); }
.frappe-control[data-fieldtype="Link"] .control-input .link-btn { color: var(--brand); }

/* Linked values in form fields: ink + semibold with a quiet ↗ glyph —
   blue text reads as decoration, not data (user feedback) */
.form-column .control-value a,
.form-column .like-disabled-input a {
  color: var(--heading-color) !important;
  font-weight: 600;
  text-decoration: none;
}
.form-column .control-value a:hover,
.form-column .like-disabled-input a:hover {
  color: var(--brand) !important;
  text-decoration: none;
}
.form-column .control-value a::after,
.form-column .like-disabled-input a::after {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 6px;
  vertical-align: -1px;
  background-color: var(--text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'/%3E%3Cpolyline points='8 7 17 7 17 16'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'/%3E%3Cpolyline points='8 7 17 7 17 16'/%3E%3C/svg%3E") center / contain no-repeat;
}
.form-column .control-value a:hover::after,
.form-column .like-disabled-input a:hover::after {
  background-color: var(--brand);
}
.comment-input-container .comment-input-wrapper { border-radius: var(--border-radius-md); }

/* Tabs */
.form-tabs-list .nav-link,
.nav-tabs .nav-link { color: var(--text-light); font-weight: 500; }
.form-tabs-list .nav-link.active,
.nav-tabs .nav-link.active {
  color: var(--brand);
  border-bottom: 2px solid var(--brand);
  font-weight: 600;
}
.form-tabs-list .nav-link:hover { color: var(--heading-color); }

/* Form sidebar */
.form-sidebar .sidebar-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ===========================================================================
   10 · GRID / CHILD TABLES
   =========================================================================== */
.form-grid {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  overflow: hidden;
}
.grid-heading-row {
  background: var(--subtle-accent);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}
.grid-body .grid-row:hover { background: var(--brand-wash); }
.grid-body .col .static-area { padding: 7px 8px; font-size: 13px; }
.grid-heading-row .col { padding-top: 9px; padding-bottom: 9px; }
.grid-row.grid-row-open { box-shadow: inset 3px 0 0 var(--brand); background: var(--brand-wash); }
.grid-footer .grid-add-row,
.grid-footer .grid-add-multiple-rows { color: var(--brand); font-weight: 600; }
.grid-row .grid-static-col.number { font-variant-numeric: tabular-nums; }

/* ===========================================================================
   11 · LIST VIEW — presented as a rounded white card (reference table)
   =========================================================================== */
.layout-main-section .frappe-list {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  overflow: clip;
}
.frappe-list .list-paging-area {
  border-top: 1px solid var(--table-border-color);
  background: var(--card-bg);
}
.frappe-list .list-row-head {
  background: var(--subtle-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.list-row-container { border-bottom: 1px solid var(--table-border-color); }
.list-row, .list-row-head { padding-left: 16px; padding-right: 16px; }
.list-row { height: 44px; }
.list-row:hover, .list-row-container:hover .list-row { background: var(--brand-wash); }
.list-row .list-subject a {
  font-weight: 600;
  color: var(--brand);
}
.list-row .list-subject a:hover { color: var(--brand-hover); }
.frappe-timestamp { font-variant-numeric: tabular-nums; }
.list-paging-area .btn-group .btn { border-radius: 8px; font-weight: 500; }
.list-sidebar .sidebar-label { text-transform: uppercase; letter-spacing: 0.05em; font-size: 10.5px; }

/* Filters */
.filter-selector .btn, .tag-filters-area .btn { border-radius: var(--border-radius-full); }
.filter-popover, .filter-area { border-radius: var(--border-radius-md); }

/* ===========================================================================
   12 · REPORT / DATATABLE — carded like the reference tables
   =========================================================================== */
.layout-main-section .report-wrapper,
.query-report .report-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 6px;
}
.dt-scrollable { border-radius: var(--border-radius-md); }
.datatable .dt-header, .dt-header .dt-cell { background: var(--subtle-accent); }
.dt-header .dt-cell__content {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.datatable .dt-cell { border-color: var(--table-border-color); }
.datatable .dt-row:hover .dt-cell { background: var(--brand-wash); }
.datatable .dt-cell--header-selected,
.datatable .dt-cell--focus { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.datatable .dt-cell__content { font-variant-numeric: tabular-nums; }

/* ===========================================================================
   13 · WORKSPACE — widgets, shortcuts, number cards
   =========================================================================== */
.widget {
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.widget:hover { box-shadow: var(--shadow-md); }
.widget .widget-head .widget-title { font-weight: 600; color: var(--heading-color); }
.number-widget-box .widget-body .number {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--heading-color);
}
.links-widget-box .link-item {
  border-radius: var(--border-radius-sm);
  transition: background 0.12s ease, color 0.12s ease;
}
.links-widget-box .link-item:hover { background: var(--brand-wash); color: var(--brand); }
.widget-group .widget-group-title { font-weight: 700; letter-spacing: -0.01em; }
.onboarding-widget-box { border-radius: var(--border-radius-lg); }
.ce-block { border-radius: var(--border-radius); }

/* ===========================================================================
   14 · MODALS
   =========================================================================== */
.modal-content {
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--modal-shadow);
  overflow: hidden;
}
.modal-header { border-bottom: 1px solid var(--border-color); padding: 16px 20px; }
.modal-title { font-weight: 700; color: var(--heading-color); }
.modal-footer { border-top: 1px solid var(--border-color); background: var(--subtle-accent); }
.modal-backdrop.show { background-color: rgba(16, 24, 40, 0.45); opacity: 1; }

/* ===========================================================================
   15 · MENUS / DROPDOWNS / POPOVERS
   =========================================================================== */
.dropdown-menu {
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  background: var(--popover-bg);
}
.dropdown-menu .dropdown-item { border-radius: 8px; transition: background 0.1s ease; }
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus { background: var(--fg-hover-color); }
.dropdown-divider { border-top-color: var(--border-color); }
.frappe-menu { border-radius: 12px; border: 1px solid var(--border-color); box-shadow: var(--shadow-lg); }
.popover { border-radius: var(--border-radius-md); box-shadow: var(--shadow-lg); border-color: var(--border-color); }

/* ===========================================================================
   16 · STATUS CHIPS — pill with dot indicator (reference: "● Draft",
        "● Pending Dept Review"). Soft tinted bg + hairline border.
   =========================================================================== */
.indicator-pill, .indicator-pill-round {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--border-radius-full);
  font-weight: 600;
  font-size: 11.5px;
  padding: 3px 10px;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
}
.indicator-pill::before, .indicator-pill-round::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* Alerts / toasts */
.desk-alert, .alert {
  border-radius: var(--border-radius-md);
  border-left-width: 3px;
  box-shadow: var(--shadow-md);
}
.desk-alert.blue { border-left-color: var(--brand); }

/* Notifications */
.notifications-list {
  border-radius: 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}
.notifications-list .notification-item-container:hover,
.notifications-list .notification-item:hover { background: var(--subtle-accent); }
.notifications-list .notification-item.unseen { background: var(--brand-wash); }
.dropdown-notifications .notification-item .indicator { color: var(--brand); }

/* ===========================================================================
   17 · TREE / KANBAN
   =========================================================================== */
.tree { padding: 8px; }
.tree .tree-link:hover { background: var(--brand-wash); border-radius: var(--border-radius-sm); }
.tree .tree-link.active, .tree .tree-node.opened > .tree-link { color: var(--brand); }
.tree .tree-node .tree-children { border-left: 1px dashed var(--border-color); margin-left: 12px; }
.tree-node .balance-area { font-variant-numeric: tabular-nums; color: var(--text-muted); }

.kanban .kanban-column {
  background: var(--subtle-accent);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
}
.kanban .kanban-card.content {
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.14s ease;
}
.kanban .kanban-card.content:hover { box-shadow: var(--shadow-md); }

/* ===========================================================================
   18 · APP LAUNCHER OVERLAY (tls_custom_css feature)
   =========================================================================== */
.tls-launcher-panel {
  border-radius: 18px;
  background: var(--card-bg);
  box-shadow: var(--shadow-2xl);
}
.tls-launcher-backdrop { background: rgba(16, 24, 40, 0.25); }
.tls-launcher-card { border-radius: 12px; }
.tls-launcher-card:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border-color));
  box-shadow: 0 4px 14px -4px rgba(37, 99, 235, 0.20);
  transform: translateY(-1px);
}
.tls-launcher-section-head { letter-spacing: 0.08em; }

/* ===========================================================================
   18b · CUSTOM DESKTOP (module portal rendered by tls_custom_css.js) —
        match the "Your Apps" reference: heading directly on the canvas,
        wide grid of horizontal white cards.
   =========================================================================== */
/* The stock desktop centers a shrink-to-fit flex column; give our portal a
   real width so the card grid can compute its columns */
.desktop-container:has(.tls-desktop-page) { display: block; }
.tls-desktop-page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 32px 80px;
}

/* Header: no card chrome — big bold title on the canvas */
.tls-desktop-header {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 8px 4px 4px;
  margin-bottom: 8px;
}
.tls-desktop-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.tls-desktop-subtitle { font-size: 14px; margin-top: 4px; }

/* Section heads: quiet uppercase with muted count */
.tls-desktop-body .tls-launcher-section { margin-top: 28px; }
.tls-desktop-body .tls-launcher-section-head {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

/* Cards: reference pattern — icon tile, title + meta line, "Open →" footer */
.tls-desktop-body .tls-launcher-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.tls-desktop-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  gap: 0;
  min-height: 0;
  padding: 18px 20px 14px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}
.tls-desktop-card:hover {
  border-color: var(--dark-border-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tls-desktop-card .tls-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.tls-desktop-card .tls-launcher-card-icon {
  width: 48px;
  height: 48px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--subtle-fg);
  overflow: hidden;
}
.tls-desktop-card .tls-launcher-card-icon img,
.tls-desktop-card .tls-launcher-card-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.tls-desktop-card .tls-card-text { min-width: 0; }
.tls-desktop-card .tls-launcher-card-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--heading-color);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tls-desktop-card .tls-card-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tls-desktop-card .tls-launcher-card-chevron {
  margin-left: auto;
  flex: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-muted);
  transition: background 0.12s ease, transform 0.15s ease;
}
.tls-desktop-card .tls-launcher-card-chevron:hover { background: var(--fg-hover-color); }
.tls-desktop-card.submenu-open .tls-launcher-card-chevron { transform: rotate(180deg); }
.tls-desktop-card .tls-card-foot {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--subtle-fg);
}
.tls-desktop-card .tls-card-open {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}
.tls-desktop-card .tls-open-arrow {
  display: inline-block;
  transition: transform 0.15s ease;
}
.tls-desktop-card:hover .tls-open-arrow { transform: translateX(3px); }

/* Submenu that expands under a card */
.tls-submenu {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}
.tls-submenu .tls-submenu-item { border-radius: 8px; }
.tls-submenu .tls-submenu-item:hover { background: var(--brand-wash); color: var(--brand); }

/* ===========================================================================
   18c · MODULE RAIL — sibling sections of the current module group, shown
        at the top of the left sidebar (injected by tls_custom_css.js)
   =========================================================================== */
.tls-module-rail { width: 100%; padding: 2px 2px 0; }
.tls-module-rail-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tls-sidebar-section-label);
  padding: 8px 10px 6px;
}
.tls-module-rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--tls-sidebar-item-text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 1px;
}
.tls-module-rail-item:hover {
  background: var(--tls-sidebar-item-hover-bg);
  color: var(--heading-color);
  text-decoration: none;
}
.tls-module-rail-item.active {
  background: var(--tls-sidebar-active-bg);
  color: var(--tls-sidebar-active-text);
  font-weight: 600;
}
.tls-module-rail-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tls-module-rail-icon,
.tls-module-rail-icon img,
.tls-module-rail-icon svg {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 4px;
  display: block;
}
.tls-module-rail-divider {
  border-top: 1px solid var(--divider-color);
  margin: 8px 6px 6px;
}
/* icon-only collapsed sidebar: the rail has no room — hide it */
.body-sidebar-container:not(.expanded) .tls-module-rail { display: none; }

/* ===========================================================================
   19 · LOGIN — split-screen enterprise layout (hero injected by
        velto_enterprise.js as .nova-login-hero; body gets .nova-login)
   =========================================================================== */

/* Left brand hero */
.nova-login-hero {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 46%;
  display: flex;
  flex-direction: column;
  padding: 48px 60px;
  color: #fff;
  z-index: 10;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 255, 255, 0.14), transparent 55%),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(160deg, #1e3fae 0%, #2563eb 55%, #3b82f6 100%);
}
.nova-hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.nova-hero-brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.30);
}
.nova-hero-main { margin: auto 0; max-width: 480px; }
.nova-hero-title {
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.022em;
}
.nova-hero-sub {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.85);
}
.nova-hero-features {
  list-style: none;
  margin: 34px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nova-hero-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}
.nova-hero-features li::before {
  content: "\2713";
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.nova-hero-foot { font-size: 12.5px; color: rgba(255, 255, 255, 0.62); }

/* Right side: shift the page past the fixed hero, center the form */
body.nova-login { padding-left: 46%; background: var(--fg-color); }
body.nova-login .navbar, body.nova-login .web-footer { display: none; }
body.nova-login section.for-login,
body.nova-login section.for-email-login,
body.nova-login section.for-forgot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: var(--fg-color);
  max-width: none;
}

/* Form card: no chrome, left-aligned enterprise copy */
body.nova-login .page-card {
  border: none;
  box-shadow: none;
  background: transparent;
  width: 100%;
  max-width: 424px;
  padding: 0;
}
body.nova-login .for-login .page-card-head,
body.nova-login .for-email-login .page-card-head { text-align: left !important; }
body.nova-login .for-login img.app-logo,
body.nova-login .for-email-login img.app-logo { display: none; }
body.nova-login .for-login .page-card-head h4,
body.nova-login .for-login .page-card-head h1,
body.nova-login .for-login .page-card-head h2,
body.nova-login .for-email-login .page-card-head h4 {
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.022em;
  color: var(--heading-color);
  text-align: left;
  margin: 0;
}
.nova-login-sub {
  font-size: 14.5px;
  color: var(--text-muted);
  text-align: left;
  margin: 10px 0 30px;
}
.nova-login-sub b { color: var(--text-color); font-weight: 600; }

/* Visible field labels (Frappe ships them screen-reader-only) */
body.nova-login .form-label.sr-only {
  position: static;
  width: auto;
  height: auto;
  margin: 0 0 6px;
  padding: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-color);
}
body.nova-login .form-group { margin-bottom: 18px; }
body.nova-login .login-content input.form-control {
  height: 46px !important;
  font-size: 14.5px !important;
  border-radius: 10px !important;
  border: 1px solid var(--dark-border-color) !important;
  background: var(--fg-color) !important;
  color: var(--text-color) !important;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
body.nova-login .login-content input.form-control:focus {
  border-color: var(--brand) !important;
  box-shadow: var(--focus-default) !important;
}
body.nova-login .login-content .toggle-password {
  font-size: 12.5px;
  font-weight: 500;
}
body.nova-login .forgot-password-message {
  text-align: right;
  font-size: 13px;
  margin: 6px 0 22px;
}
body.nova-login .forgot-password-message a { color: var(--brand); font-weight: 500; }

body.nova-login .btn-login[type="submit"],
body.nova-login .page-card-actions .btn-primary {
  height: 46px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.30);
}
body.nova-login .btn-login[type="submit"]:hover { background: var(--brand-hover); }
body.nova-login .login-divider { margin: 18px 0; }
body.nova-login .btn-login-option {
  height: 44px;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid var(--dark-border-color);
  background: var(--fg-color);
  color: var(--text-color);
}
body.nova-login .btn-login-option:hover { background: var(--subtle-fg); }
.nova-login-secure {
  margin-top: 30px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
}

/* Small screens: hero hides, form goes full width, logo returns */
@media (max-width: 991px) {
  .nova-login-hero { display: none; }
  body.nova-login { padding-left: 0; }
  body.nova-login .page-card .page-card-head img.app-logo { display: inline-block; }
}

/* Non-login public pages keep the simple card treatment */
.for-signup { background: var(--bg-color); }
.for-signup .page-card {
  border-radius: 18px;
  border: 1px solid var(--border-color);
  background: var(--fg-color);
  box-shadow: var(--shadow-lg);
}
.web-form-container .form-control {
  border-radius: var(--border-radius);
  border: 1px solid var(--dark-border-color);
}
.web-form-container .btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  border-radius: var(--border-radius);
  font-weight: 600;
}
.navbar.navbar-expand .container .navbar-brand { font-weight: 700; }

/* ===========================================================================
   20 · SCROLLBARS + POLISH
   =========================================================================== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); background-clip: content-box; }

.frappe-card, .dashboard-card {
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
}
.skeleton { border-radius: var(--border-radius); }

#navbar-breadcrumbs a, .disable-click .breadcrumb-item {
  font-weight: 500;
  color: var(--text-muted);
}
#navbar-breadcrumbs a:hover { color: var(--brand); }

kbd, .shortcut-label {
  border-radius: 5px;
  background: var(--control-bg);
  border: 1px solid var(--border-color);
  font-variant-numeric: tabular-nums;
}

/* ===========================================================================
   21 · MOTION SAFETY
   =========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .btn, .widget, .form-control, .desktop-icon, .kanban .kanban-card.content,
  .tls-launcher-card { transition: none !important; animation: none !important; }
}
/* ===== END TLS NOVA v2 ===== */
